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

prevent duplicate plugin discovery on misconfigured pythons #1631

Merged
merged 1 commit into from Jul 31, 2022

Conversation

asottile
Copy link
Member

for example, venv-virtualenvs on fedora have both lib and lib64 on
sys.path despite them being the same. this causes
importlib.metadata.distributions to double-discover.

$ docker run --rm -t fedora:latest bash -c 'dnf install -qq -y python3 >& /dev/null && python3 -m venv venv && venv/bin/pip -qq install cfgv && venv/bin/python - <<< "from importlib.metadata import distributions; print(len([d for d in distributions() if d.name == '"'"'cfgv'"'"']))"'
2

resolves #1627

for example, `venv`-virtualenvs on fedora have both `lib` and `lib64` on
`sys.path` despite them being the same.  this causes
`importlib.metadata.distributions` to double-discover.

```console
$ docker run --rm -t fedora:latest bash -c 'dnf install -qq -y python3 >& /dev/null && python3 -m venv venv && venv/bin/pip -qq install cfgv && venv/bin/python - <<< "from importlib.metadata import distributions; print(len([d for d in distributions() if d.name == '"'"'cfgv'"'"']))"'
2
```
@asottile asottile added this to the 5.0.1 milestone Jul 31, 2022
@asottile asottile merged commit d20bb97 into main Jul 31, 2022
@asottile asottile deleted the dupe-sys-path branch July 31, 2022 22:07
@sigmavirus24
Copy link
Member

Importlib just keeps getting worse and worse, eh?

@asottile
Copy link
Member Author

Importlib just keeps getting worse and worse, eh?

yep :S

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.

flake8 does not start after upgrade from 4.0.1 to 5.0.0
2 participants