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

pylint tox environment has false import-errors on local tox runs #32504

Open
scbedd opened this issue Oct 13, 2023 · 0 comments
Open

pylint tox environment has false import-errors on local tox runs #32504

scbedd opened this issue Oct 13, 2023 · 0 comments
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library.

Comments

@scbedd
Copy link
Member

scbedd commented Oct 13, 2023

Context

Thanks @pvaneck for repro and investigation!

# install eng/ci_tools.txt
cd sdk/monitor/azure-monitor-query
tox -v -c ../../../eng/tox/tox.ini --root . -e pylint

results in bunches of:

azure\monitor\query\aio\_metrics_query_client_async.py:14: [E0401(import-error), ] Unable to import 'azure.core.tracing.decorator_async'
azure\monitor\query\aio\_metrics_query_client_async.py:14: [E0611(no-name-in-module), ] No name 'core' in module 'azure'

This started occurring with the python 3.12 upgrade. The origin of the new behavior is the new pip version interacting with pylint erroneously.

Specifically, when a dependency of the package being pylinted is editable installed, import errors are thrown when they really shouldn't be. See this pylint issue for the discussion. These aren't real import errors, they are caused by how pylint is interacting with a new setuptools required by py 3.12.

This can be bypassed temporarily by setting env variable:

  • SETUPTOOLS_ENABLE_FEATURES="legacy-editable"

We don't see this in CI because in CI, no editable requirements are installed. They're all pre-built!

Solutions

  1. Commit to temporary solution first off
  2. Add an additional PR that forces all dev_requirements.txt installs within the pylint environment to prebuilt packages. REGARDLESS of whether it is being run in CI or not.
@github-actions github-actions bot added Azure.Core Client This issue points to a problem in the data-plane of the library. needs-team-triage Workflow: This issue needs the team to triage. labels Oct 13, 2023
@xiangyan99 xiangyan99 removed the needs-team-triage Workflow: This issue needs the team to triage. label Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library.
Projects
None yet
Development

No branches or pull requests

2 participants