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

@asottile asottile commented Jul 31, 2022

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
11 checks passed
@asottile asottile deleted the dupe-sys-path branch Jul 31, 2022
@sigmavirus24
Copy link
Member

sigmavirus24 commented Jul 31, 2022

Importlib just keeps getting worse and worse, eh?

@asottile
Copy link
Member Author

asottile commented Jul 31, 2022

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.

2 participants