hundreds-father-404
12/30/2021, 6:22 PM[GLOBAL]
pants_ignore.add = ["my-dir/"]
rhythmic-battery-45198
12/31/2021, 1:45 AMdeploy_jar
target in my java project. The jar is required by one of python classes. Is there any way to represent this type of dependency a BUILD file?hundreds-father-404
12/31/2021, 1:57 AMrhythmic-battery-45198
12/31/2021, 2:16 AMrhythmic-battery-45198
12/31/2021, 2:17 AMhundreds-father-404
12/31/2021, 2:24 AMdeploy_jar
generate ResourceSourceField
so that when you depend on it, it's like depending on resource
but where it gets generated by ~running ./pants package
first
https://www.pantsbuild.org/docs/plugins-codegen
To do this, you'll want to add a private sources
field to deploy_jar
like this: https://github.com/pantsbuild/pants/blob/fe112bf20e9e7cfe4a2c746316ebc2655c428697/src/python/pants/core/target_types.py#L142-L145. You're just doing this to hook into codegen. Use a "plugin field" to extend the existing deploy_jar
target: https://www.pantsbuild.org/docs/target-api-extending-targets
Then, in your codegen rule, you'll call await Get(BuiltPackage, DeployJarFieldSet, field_set)
I think. This essentially calls ./pants package
. You can then return the resulting BuiltPackage.digest
in the GeneratedSources
for your codegen rule
We're happy to help more if you have questions along the way 🙂 Feel free to ask questions here or in #plugins
We may want to generalize that cross-language relationship in core Pants, but in the meantimerhythmic-battery-45198
12/31/2021, 2:30 AMsilly-spring-87100
12/31/2021, 10:58 AMpants==2.8.0
I need multiple tags for every docker image. pants build them corectllt. When I want to push them ./pants publish ::
I get an error from docker.
11:56:49.04 [INFO] Initializing scheduler...
11:56:49.12 [INFO] Scheduler initialized.
11:56:51.83 [INFO] Completed: Building docker image dataprocessor_simple:local-sha +1 additional tag.
11:56:51.83 [INFO] Built docker images:
* dataprocessor_simple:local-sha
* dataprocessor_simple:local-branch
"docker push" requires exactly 1 argument.
See 'docker push --help'.
Usage: docker push [OPTIONS] NAME[:TAG]
Push an image or a repository to a registry
𐄂 dataprocessor_simple:local-sha failed.
𐄂 dataprocessor_simple:local-branch failed.
happy-kitchen-89482
12/31/2021, 9:12 PMpython_sources
, say, depends on a pex_binary
, then IIRC we package that PEX and make it available as a runtime resource for the python sources. This seems no different in principle, so we almost certainly want to support this in core Pants.hundreds-father-404
12/31/2021, 9:46 PMpython_distribution
and then we install that into the venv via your PR from a few months ago?happy-kitchen-89482
01/01/2022, 5:37 AMgentle-hydrogen-65984
01/02/2022, 7:11 PM1.31
release? Would be great to see this bug in the lint.jvm-dep-check.unnecessary_deps
get fixed.
Also after hacking around it, it seems to fire a lot of false positives. I added scope=forced
for all the generated code ones, but it fires in many other places in my scala codebase (mix of many 1stparty, 3rdparty, and internal deps). I have strict_deps=true
everywhere. Anybody else running into this?
./pants lint src/scala/::
(If you're seeing this message in error, you might need to change the `scope` of the dependencies.)
<a lot of deps>
happy-kitchen-89482
01/03/2022, 4:23 AMechoing-farmer-15630
01/03/2022, 1:35 PMstraight-exabyte-59370
01/03/2022, 2:07 PM./pants --version
Bootstrapping Pants using /opt/homebrew/opt/python@3.8/bin/python3.8
Creating the virtualenv PEX.
Downloading the Pex PEX.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 640 100 640 0 0 2413 0 --:--:-- --:--:-- --:--:-- 2452
100 3529k 100 3529k 0 0 3800k 0 --:--:-- --:--:-- --:--:-- 5971k
SHA256 fingerprint of <https://github.com/pantsbuild/pex/releases/download/v2.1.42/pex> verified.
Installing pantsbuild.pants==1.30.4 into a virtual environment at /Users/pawel/.cache/pants/setup/bootstrap-Darwin-arm64/1.30.4_py38
created virtual environment CPython3.8.12.final.0-64 in 138ms
creator CPython3Posix(dest=/Users/pawel/.cache/pants/setup/bootstrap-Darwin-arm64/pants.UyuuvG/install, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/pawel/Library/Application Support/virtualenv)
added seed packages: pip==21.1.2, setuptools==57.0.0, wheel==0.36.2
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
Requirement already satisfied: pip in /Users/pawel/.cache/pants/setup/bootstrap-Darwin-arm64/pants.UyuuvG/install/lib/python3.8/site-packages (21.1.2)
Collecting pip
Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 21.1.2
Uninstalling pip-21.1.2:
Successfully uninstalled pip-21.1.2
Successfully installed pip-21.3.1
ERROR: Could not find a version that satisfies the requirement pantsbuild.pants==1.30.4 (from versions: 0.0.17, 0.0.18, 0.0.20, 0.0.21, 0.0.22, 0.0.23, 0.0.24, 0.0.25, 0.0.26, 0.0.27, 0.0.28, 0.0.29, 0.0.30, 0.0.31, 0.0.32, 0.0.33, 0.0.34, 0.0.35, 0.0.36, 0.0.37, 0.0.38, 0.0.39, 0.0.40, 0.0.41, 0.0.42, 0.0.43, 0.0.44, 0.0.45, 0.0.46, 0.0.47, 0.0.48, 0.0.49, 0.0.50, 0.0.51, 0.0.52, 0.0.53, 0.0.54, 0.0.55, 0.0.56, 0.0.57, 0.0.58, 0.0.59, 0.0.60, 0.0.61, 0.0.62, 0.0.63, 0.0.64, 0.0.65, 0.0.66, 0.0.67, 0.0.68, 0.0.69, 0.0.70, 0.0.71, 0.0.72, 0.0.73, 0.0.74, 0.0.75, 0.0.76, 0.0.77, 0.0.79, 0.0.80, 0.0.81, 0.0.82, 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0)
ERROR: No matching distribution found for pantsbuild.pants==1.30.4
is anyone able to help?
tried to run:
curl -L -O https://static.pantsbuild.org/setup/pants && chmod +x ./pants
rm -rf ~/.cache/pants/echoing-farmer-15630
01/03/2022, 7:52 PM--build-arg CONTAINER_GID={os.getgid()}
. (this was for a development container so that it ran as the existing user rather than as root or some fixed user ID).
It's not clear how to do this with extra_build_args
in pants (or generally, how to pass in a variable like that). I obviously can't import os
to call `getgid`; I could pass it in as an env variable, but I can't see how to use env variables within a BUILD
right now.
Possible or not?curved-television-6568
01/03/2022, 8:11 PMcurved-television-6568
01/03/2022, 8:13 PMdocker_image(extra_build_args=["CONTAINER_GID"])
CONTAINER_GID=$(group_id) ./pants package ..
echoing-farmer-15630
01/03/2022, 8:17 PMechoing-farmer-15630
01/03/2022, 8:17 PMcurved-television-6568
01/03/2022, 8:18 PMcurved-television-6568
01/03/2022, 8:26 PMcurved-television-6568
01/03/2022, 8:26 PMechoing-farmer-15630
01/03/2022, 8:33 PMechoing-farmer-15630
01/03/2022, 9:48 PMhundreds-father-404
01/03/2022, 9:52 PMrefined-addition-53644
01/03/2022, 11:55 PMloud-stone-83419
01/04/2022, 10:59 AMechoing-farmer-15630
01/04/2022, 11:41 AMrefined-addition-53644
01/04/2022, 11:44 AMUnable to import
generated by pylint
when running
./pants lint ::
This is from an internal pants plugin
12:40:29.39 [ERROR] Completed: Lint using Pylint - Pylint failed (exit code 30).
************* Module pants-plugins.internal_plugins.register
pants-plugins/internal_plugins/register.py:1:0: C0114: Missing module docstring (missing-module-docstring)
pants-plugins/internal_plugins/register.py:1:0: E0401: Unable to import 'pants.backend.python.goals.setup_py' (import-error)
pants-plugins/internal_plugins/register.py:2:0: E0401: Unable to import 'pants.engine.fs' (import-error)
pants-plugins/internal_plugins/register.py:3:0: E0401: Unable to import 'pants.engine.rules' (import-error)
pants-plugins/internal_plugins/register.py:4:0: E0401: Unable to import 'pants.engine.target' (import-error)
pants-plugins/internal_plugins/register.py:5:0: E0401: Unable to import 'pants.engine.unions' (import-error)
pants-plugins/internal_plugins/register.py:8:0: C0115: Missing class docstring (missing-class-docstring)
pants-plugins/internal_plugins/register.py:10:4: C0116: Missing function or method docstring (missing-function-docstring)
pants-plugins/internal_plugins/register.py:8:0: R0903: Too few public methods (1/2) (too-few-public-methods)
pants-plugins/internal_plugins/register.py:58:0: C0116: Missing function or method docstring (missing-function-docstring)