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

Add filtering of interpreter names for tests with multiple Python versions #4368

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Jun 17, 2024

Extends new filters for interpreter paths to apply to tests with multiple Python versions. Adds patch version filtering for them as well, which is needed for #4360 tests.

Comment on lines -196 to +226
.env("UV_TEST_PYTHON_PATH", "/dev/null")
.env("UV_TEST_PYTHON_PATH", &self.python_path())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using multiple Python versions is now "first class" so we can support filtering them.

);
for pattern in Self::path_patterns(executable) {
self.filters
.push_front((format!("{pattern}python.*"), format!("[PYTHON-{version}]")));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These need to be in the front or they can get clobbered by other filters. Prompted the change to a double ended data structure.

@zanieb zanieb marked this pull request as ready for review June 17, 2024 19:19
@zanieb
Copy link
Member Author

zanieb commented Jun 17, 2024

This feels kind of sloppy but it's blocking work I want to release today.

@zanieb zanieb force-pushed the zb/filter-python-versions branch 2 times, most recently from 0bbbc34 to 6e8cd33 Compare June 17, 2024 19:37
Base automatically changed from zb/filter-create-venv to main June 17, 2024 20:15
@zanieb zanieb force-pushed the zb/filter-python-versions branch from 6e8cd33 to c62101d Compare June 17, 2024 20:15
@zanieb zanieb enabled auto-merge (squash) June 17, 2024 20:15
@zanieb zanieb merged commit 0587060 into main Jun 17, 2024
47 checks passed
@zanieb zanieb deleted the zb/filter-python-versions branch June 17, 2024 20:22
Copy link
Member

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

zanieb added a commit that referenced this pull request Jun 18, 2024
It was becoming problematic that the virtual environment test context
diverged from the other one i.e. we had to implement filtering twice.
This combines the contexts and tweaks the `TestContext` API and
filtering mechanisms for Python versions. Combined with my previous
changes to the test context at #4364 and
#4368 this finally unblocks the
snapshots for test cases in #4360 and
#4362.
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.

None yet

2 participants