limited-insurance-37393
04/28/2021, 7:42 PMtemplates
directory in my repository that has some Python files and other templates, but shouldn't necessarily have any BUILD files. When I run ./pants tailor
it errors out because one of the subdirectories doesn't have a BUILD file, and there doesn't appear to be a way to tell the command to ignore any directories, or to tell it to run only against the src/
directory.echoing-manchester-70122
04/28/2021, 8:31 PMechoing-manchester-70122
04/28/2021, 8:31 PMechoing-manchester-70122
04/28/2021, 8:32 PM#!/bin/sh
PEX_MODULE=foo:main /usr/local/bin/foo_and_bar.pex "$@"
plain-carpet-73994
04/28/2021, 9:49 PMvenv
but I think that can't be done from within Pants, right?user
04/29/2021, 2:20 AMhelpful-lunch-92084
04/29/2021, 3:14 PMMDB_MAP_FULL: Environment mapsize limit reached"
Any suggestions?user
04/29/2021, 5:11 PMuser
04/29/2021, 6:45 PMcuddly-flag-68085
04/29/2021, 8:39 PMENV XDG_CACHE_HOME /root/.cache
(src)
RUN --mount=type=cache,target=/root/.cache/ ./pants binary some/jar/to/build:
But all subsequent docker runs dont use any cached data, and the build starts from scratch. Are there any examples of pants + docker + caching that are known to work?busy-vase-39202
04/29/2021, 9:54 PMplain-carpet-73994
04/29/2021, 11:02 PMcheck
that runs lint
, typecheck
, etc. I know with a macro you can create multiple targets but it doesn't look like macros let you combine goals. I can create a custom rule but (1) is that necessary and (2) if so, I think I need to do some await Get(LintResult, Target, target)
like calls, once for each target, but I'm not sure what the right types to await
are for the other goals -- how do I find those?user
04/30/2021, 3:54 PMpolite-garden-50641
04/30/2021, 5:06 PMproud-jackal-16497
04/30/2021, 6:40 PM--changed-since
flag in v1.30 when using a custom targetplain-carpet-73994
05/01/2021, 12:37 AMutils
with an __init__.py
that looks like this:
from .require import require
from .foo import foo
__all__ = ['require', 'foo']
and the foo.py
and require.py
files exist and can be imported from other packages as expected (e.g. import utils.require
). I added a unit test for foo
which does not use require
. require
currently doesn't have any unit tests. My BUILD file is super simple:
python_library()
python_tests(name='test')
When I try to run the tests in utils
I get:
E ModuleNotFoundError: No module named 'utils.require'
My theory is that since I'm not using require
in any tests that file doesn't get put in my sandbox so it's not available and I therefore get the error. But adding a dependencies=['./:utils']
to my python_tests
target doesn't help either. Having an __init__.py
that exports a bunch of things some of which may not have unit tests seems fairly common so I suspect I'm doing something wrong. Any advice?plain-carpet-73994
05/01/2021, 12:59 AM~/.cache/python/setup
directory but on each build I see the ./pants
script re-downloading pants and re-installing the associated pip packages. Am I doing something wrong?user
05/01/2021, 3:54 PMsalmon-nest-5801
05/01/2021, 10:22 PMREQUESTS_CA_BUNDLE
and PIP_CERT
, etc. I've also experimented with PANTS_CA_CERTS_PATH
and --ca-certs-path=${SSL_CERT_FILE}
(the variable being a handy reference to the bundle I generated). But regardless of what I set, I always get the following when trying to do anything other than --version
with pants:
Exception: Error downloading file: error sending request for url (<https://github.com/pantsbuild/pex/releases/download/v2.1.35/pex>): error trying to connect: invalid certificate: BadDER
I thought maybe there was some sort of issue with pants not liking the openssl that homebrew has installed, and that maybe I needed to rebuild it from sources, so I attempted that - same output. I have longer logs from that if anyone wants to see (I didn't post them here as this is already too long). Regardless of what I set, if I set those variables, if I don't set them, I get the same response. I know pip
and anything requests
based work perfectly fine on my system - I needed those awhile ago and I sorted them out; I know for sure that the generated bundle works perfectly fine with those tools, and other things like pip
, pipenv
, poetry
, etc.
Any ideas? I'm just looking for a workaround that isn't getting out from behind the SSL Inspection server (I could, but then this won't work for anyone if they're ever inside the company intranet, and that's not really a solution). I can set whatever complicated environment I need. I know I could host the artifacts myself a-la proxy limitations, but I'd really rather not do that either. I really think this should work, I just can't figure out why it doesn't.happy-kitchen-89482
05/02/2021, 10:42 PMhappy-kitchen-89482
05/02/2021, 10:42 PMplain-carpet-73994
05/03/2021, 6:03 PMpip-compile
that includes an extra like:
google-api-core[grpc]==1.26.3
but Pants doesn't like that:
DEPRECATION: Constraints are only allowed to take the form of a package name and a version specifier. Other forms were originally permitted as an accident of the implementation, but were undocumented. The new implementation of the resolver no longer supports these forms. A possible replacement is replacing the constraint with a requirement.. You can find discussion regarding this at <https://github.com/pypa/pip/issues/8210>.
ERROR: Constraints cannot have extras
Aren't extras required for proper support in some cases? What's the correct way to deal with an optional extra that is required by the code if I want to be freezing dependencies?big-xylophone-43403
05/03/2021, 6:20 PMuser
05/03/2021, 7:21 PMuser
05/03/2021, 8:07 PMsquare-oxygen-75288
05/04/2021, 11:10 AMNo valid Python interpreter found. For `pants_version = "1.30.0"`, Pants requires Python 3.6, 3.7, or 3.8 to run. Please check that a valid interpreter is installed and on your $PATH.
If I open IDEA's terminal and run python
there, I will see:
% python
Python 3.8.6 (default, May 4 2021, 09:31:45)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Cause I have pyenv configured for this (scala) project
So I don't get how to get Pants in IDEA up and running cause it seems like it tries to use 3.9.x and fails (and it ignored pyenv)
Any ideas how to fix it? Cheers.polite-garden-50641
05/04/2021, 2:27 PM.pants.d/pants.log
) we do it in pants:
https://github.com/pantsbuild/pants/pull/11860 and this is also possible in other CI systems, for example circle ci: https://circleci.com/docs/2.0/artifacts/
BTW - travis can't do it on its own (it only allows uploading somewhere else, like s3) so we might want to reconsider using it as an example in the docs and in the example-python repo... since I don't think anyone using pants 2.x will be using travis.... (I would be surprised....) so a GH actions/CircleCI makes more sense. since those are the more common ones people are familiar with (and are not slowly dying).user
05/04/2021, 5:54 PMplain-sundown-25537
05/04/2021, 7:13 PMfoobar
to myproject
and start with itproud-dentist-22844
05/04/2021, 7:49 PMtailor
to use copier for a smarter / updatable repo template.