Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The poetry_requirements macro does not handle the special python dependency. #12276

Closed
jsirois opened this issue Jul 4, 2021 · 0 comments · Fixed by #12278
Closed

The poetry_requirements macro does not handle the special python dependency. #12276

jsirois opened this issue Jul 4, 2021 · 0 comments · Fixed by #12278
Assignees
Labels

Comments

@jsirois
Copy link
Contributor

jsirois commented Jul 4, 2021

Currently it just maps this to a requirement and that makes things go boom:

On the experiment/pants branch in https://github.com/Incognito/python-architecture-linter for example:

$ PANTS_SHA=0182de9814c7694eed2b9407e3577684db26ea2e ./pants repl python_architecture_linter::
09:23:58.94 [WARN] The target python_architecture_linter/ast_validators/class_validators.py:../python_architecture_linter imports `astroid`, but Pants cannot safely infer a dependency because more than one target owns this module, so it is ambiguous which to use: ['modular_provider_architecture_definition:astroid', 'python_architecture_linter:astroid'].

Please explicitly include the dependency you want in the `dependencies` field of python_architecture_linter/ast_validators/class_validators.py:../python_architecture_linter, or ignore the ones you do not want by prefixing with `!` or `!!` so that one or no targets are left.

Alternatively, you can remove the ambiguity by deleting/changing some of the targets so that only 1 target owns this module. Refer to (https://www.pantsbuild.org/v2.6/docs/troubleshooting#import-errors-and-missing-dependencies).
09:23:58.94 [WARN] The target python_architecture_linter/ast_validators/function_validators.py:../python_architecture_linter imports `astroid`, but Pants cannot safely infer a dependency because more than one target owns this module, so it is ambiguous which to use: ['modular_provider_architecture_definition:astroid', 'python_architecture_linter:astroid'].

Please explicitly include the dependency you want in the `dependencies` field of python_architecture_linter/ast_validators/function_validators.py:../python_architecture_linter, or ignore the ones you do not want by prefixing with `!` or `!!` so that one or no targets are left.

Alternatively, you can remove the ambiguity by deleting/changing some of the targets so that only 1 target owns this module. Refer to (https://www.pantsbuild.org/v2.6/docs/troubleshooting#import-errors-and-missing-dependencies).
09:23:58.94 [WARN] The target python_architecture_linter/node_navigators.py imports `astroid`, but Pants cannot safely infer a dependency because more than one target owns this module, so it is ambiguous which to use: ['modular_provider_architecture_definition:astroid', 'python_architecture_linter:astroid'].

Please explicitly include the dependency you want in the `dependencies` field of python_architecture_linter/node_navigators.py, or ignore the ones you do not want by prefixing with `!` or `!!` so that one or no targets are left.

Alternatively, you can remove the ambiguity by deleting/changing some of the targets so that only 1 target owns this module. Refer to (https://www.pantsbuild.org/v2.6/docs/troubleshooting#import-errors-and-missing-dependencies).
09:23:58.94 [WARN] The target python_architecture_linter/ast_validators/nodeng_validator.py:../python_architecture_linter imports `astroid`, but Pants cannot safely infer a dependency because more than one target owns this module, so it is ambiguous which to use: ['modular_provider_architecture_definition:astroid', 'python_architecture_linter:astroid'].

Please explicitly include the dependency you want in the `dependencies` field of python_architecture_linter/ast_validators/nodeng_validator.py:../python_architecture_linter, or ignore the ones you do not want by prefixing with `!` or `!!` so that one or no targets are left.

Alternatively, you can remove the ambiguity by deleting/changing some of the targets so that only 1 target owns this module. Refer to (https://www.pantsbuild.org/v2.6/docs/troubleshooting#import-errors-and-missing-dependencies).
09:24:04.10 [INFO] Completed: Building requirements.pex with 9 requirements: astroid<3.0.0,>=2.5.8, black<22.0.0,>=21.6b0, coverage<6.0.0,>=5.5, flake8<4.0.0,>=3.9.2, isort<6.0.0,>=5.8.0, mypy<0.903.0,>=0.902, pytest-cov<3.0.0,>=2... (47 characters truncated)
09:24:04.10 [ERROR] Exception caught: (pants.engine.internals.scheduler.ExecutionError)
  File "/home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/2.6.0rc0+git0182de98_py39/lib/python3.9/site-packages/pants/bin/local_pants_runner.py", line 234, in _run_inner
    return self._perform_run(goals)
  File "/home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/2.6.0rc0+git0182de98_py39/lib/python3.9/site-packages/pants/bin/local_pants_runner.py", line 173, in _perform_run
    return self._perform_run_body(goals, poll=False)
  File "/home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/2.6.0rc0+git0182de98_py39/lib/python3.9/site-packages/pants/bin/local_pants_runner.py", line 190, in _perform_run_body
    return self.graph_session.run_goal_rules(
  File "/home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/2.6.0rc0+git0182de98_py39/lib/python3.9/site-packages/pants/init/engine_initializer.py", line 135, in run_goal_rules
    exit_code = self.scheduler_session.run_goal_rule(
  File "/home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/2.6.0rc0+git0182de98_py39/lib/python3.9/site-packages/pants/engine/internals/scheduler.py", line 533, in run_goal_rule
    self._raise_on_error([t for _, t in throws])
  File "/home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/2.6.0rc0+git0182de98_py39/lib/python3.9/site-packages/pants/engine/internals/scheduler.py", line 501, in _raise_on_error
    raise ExecutionError(

Exception message: 1 Exception encountered:

  ProcessExecutionFailure: Process 'Building requirements.pex with 9 requirements: astroid<3.0.0,>=2.5.8, black<22.0.0,>=21.6b0, coverage<6.0.0,>=5.5, flake8<4.0.0,>=3.9.2, isort<6.0.0,>=5.8.0, mypy<0.903.0,>=0.902, pytest-cov<3.0.0,>=2.12.1, pytest<7.0.0,>=6.2.4, python<4.0.0,>=3.9' failed with exit code 1.
stdout:

stderr:
ERROR: Could not find a version that satisfies the requirement python<4.0.0,>=3.9
ERROR: No matching distribution found for python<4.0.0,>=3.9
pid 20560 -> /home/jsirois/.cache/pants/named_caches/pex_root/venvs/8a893dcb01b3ee032bd99c2db556cfa3d015123d/832e95f85413646e8b7b056ab4e60414f83d7397/pex --disable-pip-version-check --no-python-version-warning --exists-action a --isolated -q --cache-dir /home/jsirois/.cache/pants/named_caches/pex_root --log /tmp/process-execution4WOjPI/.tmp/tmpeb9pu1nd/pip.log download --dest /tmp/process-execution4WOjPI/.tmp/tmpjrjd28_0/usr.bin.python3.9 astroid<3.0.0,>=2.5.8 black<22.0.0,>=21.6b0 coverage<6.0.0,>=5.5 flake8<4.0.0,>=3.9.2 isort<6.0.0,>=5.8.0 mypy<0.903.0,>=0.902 pytest-cov<3.0.0,>=2.12.1 pytest<7.0.0,>=6.2.4 python<4.0.0,>=3.9 --index-url https://pypi.org/simple/ --find-links https://binaries.pantsbuild.org/wheels/pantsbuild.pants/0182de9814c7694eed2b9407e3577684db26ea2e/2.6.0rc0%2Bgit0182de98/index.html --retries 5 --timeout 15 exited with 1 and STDERR:
None




(Use --print-stacktrace for more error details and/or --no-process-execution-local-cleanup to inspect chroots and/or -ldebug for more logs. See https://www.pantsbuild.org/v2.6/docs/troubleshooting for common issues. Consider reaching out for help: https://www.pantsbuild.org/v2.6/docs/getting-help.)
@jsirois jsirois self-assigned this Jul 4, 2021
jsirois added a commit to jsirois/pants that referenced this issue Jul 4, 2021
We now skip this entry since it is not representative of an actual
third party distribution requirement.

Fixes pantsbuild#12276

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
jsirois added a commit that referenced this issue Jul 4, 2021
We now skip this entry since it is not representative of an actual
third party distribution requirement.

Fixes #12276
jsirois added a commit to jsirois/pants that referenced this issue Jul 5, 2021
We now skip this entry since it is not representative of an actual
third party distribution requirement.

Fixes pantsbuild#12276

(cherry picked from commit 2a496aa)

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
jsirois added a commit that referenced this issue Jul 5, 2021
We now skip this entry since it is not representative of an actual
third party distribution requirement.

Fixes #12276

(cherry picked from commit 2a496aa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant