Skip to content

ci: try using tox-uv #738

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

Merged
merged 5 commits into from
Mar 25, 2025
Merged

ci: try using tox-uv #738

merged 5 commits into from
Mar 25, 2025

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented Feb 22, 2024

Speeds up CI a little bit. Closes #858.

@gaborbernat gaborbernat marked this pull request as draft February 22, 2024 23:23
@henryiii henryiii force-pushed the henryiii/ci/ub branch 2 times, most recently from b03b9bd to e8bb33c Compare September 6, 2024 20:22
@FFY00
Copy link
Member

FFY00 commented Feb 4, 2025

Perhaps we could try using https://github.com/tox-dev/tox-gh?

@henryiii
Copy link
Contributor Author

henryiii commented Feb 5, 2025

The hope here was to make the tests a bit faster; tox-gh might shorten the config, but wouldn't be faster (AFAIK). I don't understand why one test now uninstalls setuptools when it didn't before when running with tox-uv.

@henryiii henryiii marked this pull request as ready for review March 9, 2025 20:54
@@ -68,10 +71,15 @@ jobs:
- name: Setup python for tox
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.12
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
python-version: 3.12
python-version: "3.12"

Copy link
Contributor Author

@henryiii henryiii Mar 9, 2025

Choose a reason for hiding this comment

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

Actually, I think this isn't needed anymore, since I changed tox to be installed via uv tool. Let's check that first.

@henryiii
Copy link
Contributor Author

henryiii commented Mar 9, 2025

Interesting, the three failures are: AssertionError: Expected 'get_paths' to be called once. Called 4 times. from test_can_get_venv_paths_with_posix_local_default_scheme[False].

Signed-off-by: Henry Schreiner <[email protected]>
@henryiii henryiii requested a review from layday March 11, 2025 22:04


@pytest.mark.skipif('posix_local' not in SCHEME_NAMES, reason='workaround for Debian/Ubuntu Python')
@pytest.mark.skipif('venv' in SCHEME_NAMES, reason='different call if venv is in scheme names')
Copy link
Member

Choose a reason for hiding this comment

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

Isn't venv always in SCHEME_NAMES, since 3.11?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How does this test pass, then?

build/src/build/env.py

Lines 346 to 353 in e9adbf0

if 'venv' in scheme_names:
# Python distributors with custom default installation scheme can set a
# scheme that can't be used to expand the paths in a venv.
# This can happen if build itself is not installed in a venv.
# The distributors are encouraged to set a "venv" scheme to be used for this.
# See https://bugs.python.org/issue45413
# and https://github.com/pypa/virtualenv/issues/2208
paths = sysconfig.get_paths(scheme='venv', vars=config_vars)
seems to trigger a path that would fail this test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(get_paths.assert_called_once_with(scheme='posix_prefix', vars=mocker.ANY, specifically)

@gaborbernat gaborbernat merged commit f88af00 into pypa:main Mar 25, 2025
64 checks passed
@henryiii henryiii deleted the henryiii/ci/ub branch March 25, 2025 17:46
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.

4 participants