echoing-farmer-15630
07/02/2021, 4:27 PMrapid-bird-79300
07/02/2021, 7:25 PM--changed-since
at the same time as target arguments but it's not in the command at all:
./pants import-fixer --jobs=cross-imports --import-fixer-output-file=cross_imports_output.json app/::
17:27:47.34 [INFO] Initializing scheduler...
17:27:47.50 [INFO] Scheduler initialized.
17:27:47.53 [ERROR] You used `--changed-since` at the same tie as using target arguments. Please use only one.
Traceback (most recent call last):
File "/home/ubuntu/workspace/backend_master/.cache/pants/setup/bootstrap-Linux-x86_64/2.5.1rc3_py38/lib/python3.8/ite-packages/pants/bin/daemon_pants_unner.py", line 125, in single_daemonized_run
runner = LocalPantsRunner.create(
File "/home/ubuntu/workspace/backend_master/.cache/pants/setup/bootstrap-Linux-x86_64/2.5.1rc3_py3/lib/python3.8/site-package/pants/bin/local_pants_runner.py", line 150, in create
specs = calculate_specs(
File "/home/ubuntu/workspace/backend_master/.cache/pants/setup/bootstrap-Linux-x86_64/2.5.1rc3_py38/lib/pthon3.8/site-packages/pants/init/specs_calculator.py", line 47, in calculate_specs
raise InvalidSpecConstraint(
pants.init.specs_calculator.InvalidSpecConstraint: You used `--changed-since` at the same time as using target arguments. Please use only one.
+ ./pants import-fixer --jobs=wildcard-imports --ignore-skip --json-output --import-fixer-output-file=wildcard_imports_output.json app/::
17:27:48.10 [ERROR] You used `--changed-since` at the same time as using target arguments. Please use only one.
Traceback (most recent call last):
File "/home/ubuntu/workspace/backend_master/.cache/pants/setup/bootstrap-Linux-x86_64/2.5.1rc3_py38/lib/python3.8/site-packages/pants/bin/daemon_pants_runner.py", line 125, in single_daemonized_run
runner = LocalPantsRunner.create(
File "/home/ubuntu/workspace/backend_master/.cache/pants/setup/bootstrap-Linux-x86_64/2.5.1rc3_py38/lib/python3.8/site-packages/pants/bin/ocal_pants_runner.py", line 150, in create
specs = calculatespecs(
File "/home/ubuntu/workspace/backend_master/.cache/pants/setup/bootstrp-Linux-x86_64/2.5.1rc3_py38/lib/python3.8/site-packages/pants/init/specs_calculator.py", line 47, in calculat_specs
raise InvalidSpecConstraint(
pants.init.specs_calculator.InvalidSpecConstraint: Youused `--changed-since` at the same time as using target arguments. Please use only one.
I tested the goal locally with no issues. Any ideas why this would happen?powerful-boots-1234
07/02/2021, 8:32 PMnice-france-74763
07/03/2021, 9:20 AMnice-france-74763
07/04/2021, 10:07 AMclick
but not astroid
, did I do something to confuse it?
2. I can't seem to run tests
Also any general "this is bad style" feedback is welcome, I'm unfamiliar with the library still and open to find out more. The ultimate goal is to release 3 pypi packages via a CI/CD pipeline once I'm done.plain-carpet-73994
07/04/2021, 7:51 PMpyrealsense2
and I need to build a cross-platform .pex
that will run on OSX and Linux. I'm building on Linux. I've manually built the right .whl
file on OSX and uploaded it to a private GCP-based PyPi repo. The following works fine in a venv
in which I'm running pants:
pip install --trusted-host /us-central1-python.pkg.dev --index-url <https://us-central1-python.pkg.dev/infrastructure-314723/python-deps/> --platform macosx_10_15_x86_64 --implementation cp --python-version 37 --abi cp37m --only-binary :all: --target /tmp pyrealsense2
However, a ./pants package /path/to/thing
fails with:
$ ./pants package realsense/cli/
12:49:06.11 [INFO] Completed: Resolving 3 requirements: matplotlib, numpy, pyrealsense2
12:49:06.11 [ERROR] Exception caught: (pants.engine.internals.scheduler.ExecutionError)
File "/home/oliver/.cache/pants/setup/bootstrap-Linux-x86_64/2.4.0_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 229, in _run_inner
return self._perform_run(goals)
File "/home/oliver/.cache/pants/setup/bootstrap-Linux-x86_64/2.4.0_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 168, in _perform_run
return self._perform_run_body(goals, poll=False)
File "/home/oliver/.cache/pants/setup/bootstrap-Linux-x86_64/2.4.0_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 185, in _perform_run_body
return self.graph_session.run_goal_rules(
File "/home/oliver/.cache/pants/setup/bootstrap-Linux-x86_64/2.4.0_py38/lib/python3.8/site-packages/pants/init/engine_initializer.py", line 135, in run_goal_rules
exit_code = self.scheduler_session.run_goal_rule(
File "/home/oliver/.cache/pants/setup/bootstrap-Linux-x86_64/2.4.0_py38/lib/python3.8/site-packages/pants/engine/internals/scheduler.py", line 530, in run_goal_rule
self._raise_on_error([t for _, t in throws])
File "/home/oliver/.cache/pants/setup/bootstrap-Linux-x86_64/2.4.0_py38/lib/python3.8/site-packages/pants/engine/internals/scheduler.py", line 498, in _raise_on_error
raise ExecutionError(
Exception message: 1 Exception encountered:
ProcessExecutionFailure: Process 'Resolving 3 requirements: matplotlib, numpy, pyrealsense2' failed with exit code 1.
stdout:
stderr:
ERROR: Could not find a version that satisfies the requirement pyrealsense2
ERROR: No matching distribution found for pyrealsense2
pid 587331 -> /home/oliver/.pyenv/versions/3.7.10/bin/python3.7 /home/oliver/.cache/pants/named_caches/pex_root/pip.pex/cf4106b4c7898b462f7c172dde686a9747103f1a --disable-pip-version-check --no-python-version-warning --exists-action a --isolated -q --cache-dir /home/oliver/.cache/pants/named_caches/pex_root --log /tmp/process-executionntUtWf/.tmp/tmpmzcd3hpx/pip.log download --dest /tmp/process-executionntUtWf/.tmp/tmps_6hxe4q/macosx_10_15_x86_64-cp-37-cp37m --platform macosx_10_15_x86_64 --implementation cp --python-version 37 --abi cp37m --only-binary :all: --constraint constraints.txt matplotlib numpy pyrealsense2 --index-url <https://pypi.org/simple/> --find-links <https://us-central1-python.pkg.dev/infrastructure-314723/python-deps/> --retries 5 --timeout 15 exited with 1 and STDERR:
None
(Use --print-stacktrace to see more error details.)
Note that the command line Pants is generating seems to be saying to use my private repo at <https://us-central1-python.pkg.dev/infrastructure-314723/python-deps/>
. However, I suspect that doesn't know about Google's auth stuff which I did set up correctly with pip
(see the successful pip install above). Or maybe the issue is that pyrealsense2
for Linux is coming from <http://pypi.org|pypi.org>
while for OSX it needs to come from a different repo?? Any help would be appreciated.user
07/07/2021, 7:31 PMuser
07/07/2021, 7:36 PMuser
07/07/2021, 7:43 PMuser
07/07/2021, 9:58 PMuser
07/08/2021, 12:06 AMuser
07/08/2021, 4:33 PMclean-city-64472
07/08/2021, 5:47 PMpython_awslambda
build target. How are you handling the deployment piece? With the limited lambda work we have done we used the serverless framework which took care of both building and deploying to AWS.average-australia-85137
07/08/2021, 7:19 PMcurved-television-6568
07/09/2021, 11:28 AMcurved-television-6568
07/09/2021, 11:53 AMwitty-crayon-22786
07/09/2021, 4:34 PMgorgeous-eve-12553
07/09/2021, 7:34 PMflat-zoo-31952
07/10/2021, 11:08 AM./pants list
and friends as ways to generate input for other build tools?
I ask this because I'm looking for a way to introduce this at my new org, but there's a lot of build work already done that is deeply incompatible with the pants way of doing things, and just trying to get that all working in pants' model on the side would be a big, high-risk project. It seems more sane to try to introduce it slowly.proud-dentist-22844
07/11/2021, 2:29 AM__import__()
on matching classes to extract a dictionary property from the class.
Here's the plugin
https://github.com/st2sandbox/st2/blob/pants/pylint_plugins/api_models.py#L49-L52
Example matching class's schema
property:
https://github.com/st2sandbox/st2/blob/pants/st2common/st2common/models/system/actionchain.py#L125-L149
Maybe astroid provides a way to get the dictionary?proud-dentist-22844
07/11/2021, 9:42 AMfrom ... import *
imports.
This import: https://github.com/st2sandbox/st2/blob/pants/st2common/st2common/services/datastore.py#L22
from st2client.models import KeyValuePair
comes from this file (yes I have [python-infer].inits = true
in pants.toml):
https://github.com/st2sandbox/st2/blob/pants/st2client/st2client/models/__init__.py#L25
from st2client.models.keyvalue import * # noqa
which brings in the transitive dep:
https://github.com/st2sandbox/st2/blob/pants/st2client/st2client/models/keyvalue.py#L26
class KeyValuePair(core.Resource):
If I run the full suite with ./pants lint ::
, pylint succeeds (except for a known real failure somewhere else). But using a narrow target: ./pants lint ./st2common/st2common/services::
pylint fails with:
st2common/st2common/services/datastore.py:22:0: E0611: No name 'KeyValuePair' in module 'st2client.models' (no-name-in-module)
Inspecting the process-execution dir with --no-process-execution-local-cleanup
shows that st2client/st2client/models/keyvalue.py
is not included, which makes sense since it is not directly imported in st2common/st2common/services/datastore.py
.
Is there a way to get *
imports to count as direct imports when pants is putting thing together for pylint?powerful-boots-1234
07/12/2021, 1:07 PMmultiple-applications
, which seems to run into an issue with the same module name being used for two applications. With project-app/app.py and project-app-async/app.py I get the following:
./pants run project-app:project-app
15:02:53.57 [WARN] The pex_binary target project-app has the field `entry_point='app.py'`, which maps to the Python module `app`, but Pants cannot safely infer a dependency because more than one target owns this module, so it is ambiguous which to use: ['project-app-async/app.py:project-app-async0', 'project-app/app.py:project-app0'].
I haven't seen how to fix this without changing the name of the file and that's not really a solution. I tried to make entry_point='project-app/app.py:project-app0'
but that didn't work so the error message is a bit weird that it looks like it wants me to specify which target resolution to use but then it won't let me use the target resolution (is that even a name for this?)salmon-barista-63163
07/12/2021, 11:06 PM2.5.0
running in a python 3.9.6
pyenv environment. I also have python 3.8.11
and python 3.6.12
installed via pyenv as we need those versions for our interpreter constraints for some of our servers.
pants.toml
[python-setup]
resolve_all_constraints = true
interpreter_constraints = ['CPython>=3.6,<3.7']
requirement_constraints = '3rdparty/python/constraints.txt'
interpreter_search_paths = [
'<PYENV>',
'<PATH>',
]
It finds the 3.6.12 interpreter but i get errors like this when trying to resolve the constraints.
WARNING: Requirement '/tmp/process-executionlIuSO7/.tmp/tmpfyzwz_5c/home.centos..pyenv.versions.3.6.12.bin.python3.6/pyOpenSSL-20.0.1-py2.py3-none-any.whl' looks like a filename, but the file does not exist
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/tmp/process-executionlIuSO7/.tmp/tmpfyzwz_5c/home.centos..pyenv.versions.3.6.12.bin.python3.6/pyOpenSSL-20.0.1-py2.py3-none-any.whl'
Anyone see this before?salmon-barista-63163
07/12/2021, 11:18 PMuser
07/12/2021, 11:26 PMuser
07/12/2021, 11:28 PMsalmon-barista-63163
07/12/2021, 11:31 PMresolve_all_constraints=false
. maybe specific to only some of the dependencies??happy-kitchen-89482
07/12/2021, 11:34 PMsalmon-barista-63163
07/12/2021, 11:35 PMhappy-kitchen-89482
07/12/2021, 11:35 PM