creamy-airplane-38079
01/20/2022, 10:17 PMpython_library
goal ( which includes a provides=setup_py
) in v2. Seems like python_library
has been replaced with python_sources
and if you want to specify distribution config then you add the python_distribution
goal too in the BUILD file ? Is that correct ?high-yak-85899
01/20/2022, 10:26 PMconftest.py
to not run modules called *_manual_test.py
. I know my conftest.py
is getting picked up properly because I can see it with ./pants dependencies
calls. Are there any special things to get conftest to apply other than making sure it's a dependency like that? The docs make it seem like it should just work ™️ after that.dry-analyst-73584
01/20/2022, 11:18 PMhigh-yak-85899
01/21/2022, 12:54 AMprotobuf_sources
scattered under a tree and I need to bring them all in as a dependency for a python_source
.curved-television-6568
01/21/2022, 1:20 PM./pants help … | less
and then exit it with ctrl-c
I get a BrokenPipe
error (nothing strange about that) but the terminal is broken after that. (no echo etc..) (using bash
on Mac)stale-nightfall-29801
01/21/2022, 4:17 PMdry-analyst-73584
01/21/2022, 5:54 PM[python].interpreter_constraints
to CPython>=2.7,<3 and pants instructed me to generate a new lockfile for pytest. Running /v2pants generate-lockfiles --resolve=pytest
fails on what looks like a py2/3 compatibility error in parsing python imports.
ProcessExecutionFailure: Process 'Determine Python imports for src/python/fsluigi/main.py' failed with exit code 1.
stdout:
stderr:
Traceback (most recent call last):
File "./__parse_python_imports.py", line 114, in <module>
main(sys.argv[1])
File "./__parse_python_imports.py", line 105, in main
visitor.visit(tree)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
return visitor(node)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 249, in generic_visit
self.visit(item)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
return visitor(node)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 249, in generic_visit
self.visit(item)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
return visitor(node)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 249, in generic_visit
self.visit(item)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
return visitor(node)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 249, in generic_visit
self.visit(item)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
return visitor(node)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 251, in generic_visit
self.visit(value)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
return visitor(node)
File "./__parse_python_imports.py", line 57, in visit_Call
elif isinstance(node.args[0], ast.Constant):
AttributeError: 'module' object has no attribute 'Constant'
loud-laptop-17949
01/21/2022, 6:56 PM$ p list ::
Bootstrapping Pants using /Users/ryan.king/.asdf/shims/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 870 0 --:--:-- --:--:-- --:--:-- 876
100 3529k 100 3529k 0 0 2633k 0 0:00:01 0:00:01 --:--:-- 18.5M
No version is set for command python3.8
Consider adding one of the following versions in your config file at
python 3.8.12
SHA256 of <https://github.com/pantsbuild/pex/releases/download/v2.1.42/pex> is not as expected. Aborting.
Adding config to upgrade doesn't seem to help
diff --git a/pants.toml b/pants.toml
index bb0945af39..8758c5189b 100644
--- a/pants.toml
+++ b/pants.toml
@@ -147,3 +147,6 @@ build_args = [
config = ".pylintrc"
source_plugins = ["//src/clr_pylint_checkers"]
lockfile = ".pylint.lockfile"
+
+[download-pex-bin]
+version = "2.1.63"`
For context I both recently upgrade to Mac OS Monterey and we upgraded pants to 2.9.0high-yak-85899
01/21/2022, 11:54 PMimport requests
in my module and the dependencies
goal is not showing in the output. I know it's in my requirements.txt
and shows up in my constraints.txt
as expected (specifically requests==2.27.1
). I didn't see anything obvious in troubleshooting that was applicable. Any thoughts?enough-analyst-54434
01/21/2022, 11:55 PMadorable-engine-71736
01/24/2022, 1:53 PM2.9.0
and im getting a dependency conflict with docker-compose
over the pyyaml version
i created a new venv to clarify the problem - and doing
pip install pantsbuild.pants==2.9.0 docker-compose
results in
ERROR: ResolutionImpossible: for help visit <https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies>
adorable-engine-71736
01/24/2022, 1:54 PMwitty-crayon-22786
01/24/2022, 6:13 PMloud-stone-83419
01/24/2022, 7:54 PMhappy-kitchen-89482
01/24/2022, 8:52 PMstatler-2:[~/src/pants][main]$ ./pants test src/python/pants/base/::
12:50:44.89 [INFO] Starting: Resolving plugins: hdrhistogram, toolchain.pants.plugin==0.17.0
12:50:49.77 [INFO] Completed: Resolving plugins: hdrhistogram, toolchain.pants.plugin==0.17.0
12:50:51.96 [INFO] Initializing scheduler...
12:50:53.10 [INFO] Scheduler initialized.
12:50:53.12 [INFO] Starting: Resolving plugins: hdrhistogram, toolchain.pants.plugin==0.17.0
12:50:56.64 [INFO] Completed: Resolving plugins: hdrhistogram, toolchain.pants.plugin==0.17.0
loud-laptop-17949
01/24/2022, 10:19 PMhallowed-plastic-91664
01/24/2022, 11:42 PMfew-gigabyte-4152
01/25/2022, 12:36 AMnutritious-hair-72580
01/25/2022, 10:43 AM./pants export ::
to create a venv (for my IDE), but this doesn’t include extra_requirements for e.g. pytest. Is there a way i can get those exported as well?busy-vase-39202
01/25/2022, 5:52 PMcreamy-airplane-38079
01/25/2022, 6:03 PMpantsv2
test
goal to run on __init__.py
files in the test target ? If so, has anyone encountered situations where it will fail , even though they are empty files ? Tried running with debug logs but nothing meaningful is shown other than the exit code being 5creamy-airplane-38079
01/25/2022, 6:03 PMpants
to ignore those files ?modern-leather-27612
01/25/2022, 7:36 PM~/.pex
and ~/.cache/pants
. A typical error trace is attached and any help would be much appreciated. This is a blocker for her picking up issues that touch on the repository (which coincidentally contains a new tool to validate package requirements across all our repositories that is about to go CI for all).
Also, to exclude any peculiarities due to our local Python package mirror or some such, I nuked the Pex and Pants caches on my work laptop and tried to bootstrap from scratch. The results are mixed: The good news is that I was able to bootstrap and Pants does run mypy, tests, etc. The bad news is that I cannot format or lint the code anymore since Pants just can’t find the lockfile for Black. I tried regenerating the main lockfiles etc to no avail. Part of me is ecstatic about never having to deal with Pylint again, but I fear that CI nor the CTO won’t let me get away with that. Again, any help would be much appreciated.
14:24:15.68 [ERROR] 1 Exception encountered:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/grr/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.DZStIS/install/lib/python3.9/site-packages/pants/backend/python/lint/black/lockfile.txt'
hallowed-plastic-91664
01/26/2022, 12:20 AMhallowed-plastic-91664
01/26/2022, 5:28 AMbusy-vase-39202
01/26/2022, 6:48 PMhigh-energy-55500
01/26/2022, 7:47 PMpoetry install
?
I ask because it’s convenient to be able to create a local environment for debugging that contains every package, but unfortunately i’m not able to use poetry install
in our monorepo because of a tensorflow dependency that doesn’t work on M1 macs.
[long story short: https://pantsbuild.slack.com/archives/C046T6T9U/p1642537615072100 we’re using an older tensorflow version in pyproject.toml
(which doesn’t work on M1) and then using markers to tell pants to ignore it on M1 and install tensorflow-macos==2.7.0
instead by setting it in a python_requirement_library
in a BUILD file]
it would be helpful if there were some pants command to create an environment with contains everything, including these additional pants constraintswitty-crayon-22786
01/26/2022, 10:16 PMhigh-yak-85899
01/27/2022, 6:03 AMrequirements.txt
that come from a repository? It seems the python_requirement
target happily consumes these, but I got an error when pants was resolving my constraints.txt
generated by pip-compile
.clean-animal-18291
01/27/2022, 5:44 PM#9 597.1 Failed to begin watching the filesystem: Bad file descriptor (os error 9)
#9 597.1 Traceback (most recent call last):
#9 597.1 File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/bin/pants_loader.py", line 95, in run_default_entrypoint
#9 597.1 exit_code = runner.run(start_time)
#9 597.1 File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/bin/pants_runner.py", line 97, in run
#9 597.1 runner = LocalPantsRunner.create(
#9 597.1 File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/bin/local_pants_runner.py", line 119, in create
#9 597.1 options_initializer = options_initializer or OptionsInitializer(options_bootstrapper)
#9 597.1 File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/init/options_initializer.py", line 101, in __init__
#9 597.1 self._bootstrap_scheduler = create_bootstrap_scheduler(options_bootstrapper, executor)
#9 597.1 File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/init/options_initializer.py", line 74, in create_bootstrap_scheduler
#9 597.1 EngineInitializer.setup_graph(
#9 597.1 File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/init/engine_initializer.py", line 181, in setup_graph
#9 597.1 return EngineInitializer.setup_graph_extended(
#9 597.1 File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/init/engine_initializer.py", line 285, in setup_graph_extended
#9 597.1 scheduler = Scheduler(
#9 597.1 File "/home/ripplinguser/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py39/lib/python3.9/site-packages/pants/engine/internals/scheduler.py", line 209, in __init__
#9 597.1 self._py_scheduler = native_engine.scheduler_create(
#9 597.1 ValueError: Failed to begin watching the filesystem: Bad file descriptor (os error 9)