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

experimental: plugins: extended inferred dependencies from a plugin #121

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlexTereshenkov
Copy link
Member

@AlexTereshenkov AlexTereshenkov commented Jan 24, 2023

DO NOT MERGE

Trying to find out if it's possible to extend the inferred dependencies from a plugin if a file doesn't exist, but should still be discovered to let Pants "think" this exists and can be imported.

$ ./pants dependencies helloworld/greet::                       
21:37:39.04 [INFO] Initializing scheduler...
21:37:39.17 [INFO] Scheduler initialized.
21:37:39.23 [WARN] InferSpecialDependenciesRequest(field_set=SpecialDependenciesInferenceFieldSet(address=Address(helloworld/greet:lib), sources=<class 'pants.backend.python.target_types.PythonSourcesGeneratingSourcesField'>(alias='sources', address=helloworld/greet:lib, value=('*.py', '*.pyi', '!test_*.py', '!*_test.py', '!tests.py', '!conftest.py', '!test_*.pyi', '!*_test.pyi', '!tests.pyi'), default=('*.py', '*.pyi', '!test_*.py', '!*_test.py', '!tests.py', '!conftest.py', '!test_*.pyi', '!*_test.pyi', '!tests.pyi'))))
21:37:39.25 [WARN] Owners([Address(helloworld/translator:lib)])
21:37:40.15 [ERROR] 1 Exception encountered:

  UnownedDependencyError: Pants cannot infer owners for the following imports in the target helloworld/greet/greeting.py:lib:

  * helloworld.translator.foobar.baz (line: 13)

If you do not expect an import to be inferrable, add `# pants: no-infer-dep` to the import line. Otherwise, see https://www.pantsbuild.org/v2.14/docs/troubleshooting#import-errors-and-missing-dependencies for common problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant