curved-television-656810/27/2021, 5:08 PM
happy-kitchen-8948210/27/2021, 8:01 PM
since the pex is what the docker image consumes. And the
target should have a dep on
, since that is what it consumes in turn.
happy-kitchen-8948210/27/2021, 8:02 PM
happy-kitchen-8948210/27/2021, 8:02 PM
bitter-ability-3219010/27/2021, 8:02 PM
) • If CODEOWNERS isn't what we expect due to changes in CODEOWNERS.yml, we error on the right command (like
?) • If someone touches CODEOWNERS but not the yml, also error in a command (like
) Any thoughts on this inside of Pants (I presume as a plugin)
brash-family-7205710/27/2021, 8:41 PM
bitter-ability-3219010/27/2021, 8:45 PM
equivalent? Specifically looking to clean: • The cache • Previously leaked tempdirs used for debugging
fresh-cat-9082710/27/2021, 10:04 PM
file), I configure
When running the tests, I can see this being printed:
[python-setup] ... requirement_constraints = "constraints.txt" resolve_all_constraints = false
Does it mean that Pants ignores the
Starting: Building requirements.pex with 4 requirements: PyYAML, dataclasses==0.6, marshmallow>=3.5, requests>=2.22
file? I’ve left a dependency out of the
on purpose and got this message, so Pants must be able to find it
The constraints file constraints.txt does not contain entries for the following requirements: elasticsearch
user10/27/2021, 11:00 PM
user10/28/2021, 12:08 AM
ambitious-actor-3678110/28/2021, 1:34 AM
no longer works... on CI. locally works fine:
./pants --changed-since=origin/master list
but on ci... fails:
╰─➤ git --version git version 2.30.2 ╰─➤ ./pants --changed-since=origin/master list 14:33:17.78 [INFO] Initializing scheduler...
$ git --version git version 2.20.1 $ ./pants -ldebug --changed-since=$CHANGED_SINCE list 01:32:16.80 [DEBUG] Detected git repository at /builds/infloai/repo on branch None 01:32:16.80 [DEBUG] Executing: git --git-dir=/builds/infloai/repo/.git --work-tree=/builds/infloai/repo diff --name-only HEAD -- /builds/infloai/repo 01:32:16.83 [DEBUG] Executing: git --git-dir=/builds/infloai/repo/.git --work-tree=/builds/infloai/repo diff --name-only origin/master...HEAD -- /builds/infloai/repo 01:32:16.84 [ERROR] git --git-dir=/builds/infloai/repo/.git --work-tree=/builds/infloai/repo diff --name-only origin/master...HEAD -- /builds/infloai/repo failed with exit code 128 (Use --print-stacktrace for more error details and/or --no-process-execution-local-cleanup to inspect chroots. See <https://www.pantsbuild.org/v2.7/docs/troubleshooting> for common issues. Consider reaching out for help: <https://www.pantsbuild.org/v2.7/docs/getting-help.>)
fresh-cat-9082710/28/2021, 11:28 AM
targets in a particular project within a Pants monorepo than doing:
./pants filter --target-type=pex_binary --filter-address-regex="myproject" :: | xargs ./pants package
curved-television-656810/28/2021, 12:03 PM
to the pex binary
as Benjy suggested, then run
and check for the log that reads
./pants -ldebug package bar:docker
should tell you what the pex binary name is that you can use.
"Packages for Docker image: …"
stale-nightfall-2980110/28/2021, 1:34 PM
binary in this:
stale-nightfall-2980110/28/2021, 1:36 PM
docker_image( name='docker_server', dependencies=[":bar"], sources=["Dockerfile"] )
stale-nightfall-2980110/28/2021, 1:40 PM
curved-television-656810/28/2021, 1:43 PM
which is the name of your pex binary target.
curved-television-656810/28/2021, 1:44 PM
curved-television-656810/28/2021, 1:45 PM
bitter-ability-3219010/28/2021, 4:10 PM
is running & using for it's internal rules? I just noticed if I run
from within/without some virtual env I have, it'll toggle between 2.7 (system-default) or 3.8 (virtual environment version)
loud-laptop-1794910/28/2021, 5:15 PM
in our CI system and and get this error
. Not sure how to debug this further without a more detailed error message?
Error: 6.70 [ERROR] git --git-dir=/home/runner/work/color/color/.git --work-tree=/home/runner/work/color/color diff --name-only master...HEAD -- /home/runner/work/color/color failed with exit code 128
brash-baker-9119010/28/2021, 5:19 PM
This is when I'm trying to run
Traceback (most recent call last): File "/home/maier/.cache/pants/setup/bootstrap-Linux-x86_64/2.8.0rc0_py37/lib/python3.7/site-packages/pants/engine/internals/selectors.py", line 711, in native_engine_generator_send res = func.send(arg) File "/home/maier/.cache/pants/setup/bootstrap-Linux-x86_64/2.8.0rc0_py37/lib/python3.7/site-packages/pants/backend/python/util_rules/pex.py", line 441, in build_pex resolve_name, File "/home/maier/.cache/pants/setup/bootstrap-Linux-x86_64/2.8.0rc0_py37/lib/python3.7/site-packages/pants/backend/python/util_rules/lockfile_metadata.py", line 126, in from_lockfile concrete_class = _concrete_metadata_classes[metadata["version"]] KeyError: 'version'
to update things. Has anyone run into this before?
brash-baker-9119010/28/2021, 5:22 PM
brash-baker-9119010/28/2021, 8:55 PM
with 2.7.1rc0 seems to fix the issue. I'm not a Python packaging expert by a long shot, so I'm not entirely sure how this distinction would have such a big effect. Has anybody else seen this? Is there additional information I could provide that might be useful here? Thanks in advance 🙇
busy-vase-3920210/28/2021, 8:59 PM
fresh-cat-9082710/28/2021, 10:12 PM
to get the version of the package at the runtime (to be put into some logs/reports — to tell what version was used for producing the outputs).
Now, the package is not installed any longer as a wheel and instead is run as a PEX file (and of course it doesn’t have a “version” any longer). What approach do people take when they need to access the version dynamically when running the code? I see https://github.com/pantsbuild/pants/blob/main/src/python/pants/version.py#L13-L18 but curious what other clever tricks others have came up with 🙂
from pkg_resources import get_distribution get_distribution("my_project").version
ambitious-actor-3678110/29/2021, 12:19 AM
automatically gave pants the right set of flags to work
clean-city-6447210/29/2021, 3:45 AM
I much prefer the second one - it makes diffs so much more readable. Guessing this is configurable if I look for the option but maybe we want to override the defaults on Black for this use case out of the box?
pex_binary(name="manage", entry_point="manage.py", dependencies=["src/mysite:mysite", "src/polls:polls"], restartable=True) VS pex_binary( name="manage", entry_point="manage.py", dependencies=[ "src/mysite:mysite", "src/polls:polls" ], restartable=True )
ambitious-actor-3678110/29/2021, 4:52 AM