Skip to content

Adequate venv fixtures to the latest change in virtualenv for Python 3.12#3915

Merged
abravalheri merged 3 commits into
pypa:mainfrom
abravalheri:fix-py312-virtualenv
May 3, 2023
Merged

Adequate venv fixtures to the latest change in virtualenv for Python 3.12#3915
abravalheri merged 3 commits into
pypa:mainfrom
abravalheri:fix-py312-virtualenv

Conversation

@abravalheri

@abravalheri abravalheri commented May 2, 2023

Copy link
Copy Markdown
Contributor

Summary of changes

Since version v20.23.0, virtualenv will no longer include wheel and setuptools in the created folders.

Some tests in the setuptools test suite assume that these packages are always present. So we need to adequate these tests.

EDIT: Apparently we are also having problems with __version__. It seems that the code path triggered in the "unhappy path" that results in __version__ = "unknown".
Since unknown is not a valid PEP 440, it causes problem. I changed this fallback to be PEP 440-compliant.
This problem might be related to the race conditions between importlib.metadata (used by pytest and plugins) and egg_info (that writes setuptools.egg-info/PKG-INFO).

Closes

Pull Request Checklist

Since version v20.23.0, `virtualenv` will no longer include `wheel` and
`setuptools` in the created folders.

Some tests in the setuptools test suite assume that these packages are
always present. So we need to adequate these tests.
@abravalheri

Copy link
Copy Markdown
Contributor Author

It also seems that somehow setuptools.__version__ ends up either as None or unknown, which will result in an invalid version error.

I added a commit to correct that.

@abravalheri abravalheri marked this pull request as ready for review May 2, 2023 16:45
@abravalheri abravalheri changed the title Adequate venv fixtures to the latest change in virtualenv Adequate venv fixtures to the latest change in virtualenv for Python 3.12 May 2, 2023
@abravalheri abravalheri merged commit b010f52 into pypa:main May 3, 2023
@abravalheri abravalheri deleted the fix-py312-virtualenv branch May 3, 2023 12:52
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