Skip to content

Commit 661f73f

Browse files
committed
Merge branch 'main' into patch-1
Signed-off-by: Bernát Gábor <[email protected]>
2 parents f0d13c6 + 07e6110 commit 661f73f

File tree

6 files changed

+94
-131
lines changed

6 files changed

+94
-131
lines changed

.github/workflows/check.yaml

Lines changed: 77 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
name: check
1+
name: 🧪 check
22
on:
33
workflow_dispatch:
44
push:
55
branches: ["main"]
6-
tags-ignore: ["**"]
76
pull_request:
87
schedule:
98
- cron: "0 8 * * *"
@@ -14,7 +13,7 @@ concurrency:
1413

1514
jobs:
1615
test:
17-
name: test ${{ matrix.py }} - ${{ matrix.os }}
16+
name: 🧪 test ${{ matrix.py }} - ${{ matrix.os }}
1817
if: github.event_name != 'schedule' || github.repository_owner == 'pypa'
1918
runs-on: ${{ matrix.os }}
2019
timeout-minutes: 40
@@ -34,133 +33,112 @@ jobs:
3433
- pypy-3.8
3534
- graalpy-24.1
3635
os:
37-
- ubuntu-latest
38-
- macos-latest
39-
- windows-latest
36+
- ubuntu-24.04
37+
- macos-15
38+
- windows-2025
4039
include:
41-
- { os: macos-latest, py: "[email protected]" }
42-
- { os: macos-latest, py: "[email protected]" }
43-
- { os: macos-latest, py: "[email protected]" }
40+
- { os: macos-15, py: "[email protected]" }
41+
- { os: macos-15, py: "[email protected]" }
42+
- { os: macos-15, py: "[email protected]" }
4443
exclude:
45-
- { os: windows-latest, py: "graalpy-24.1" }
46-
- { os: windows-latest, py: "pypy-3.10" }
47-
- { os: windows-latest, py: "pypy-3.9" }
48-
- { os: windows-latest, py: "pypy-3.8" }
44+
- { os: windows-2025, py: "graalpy-24.1" }
45+
- { os: windows-2025, py: "pypy-3.10" }
46+
- { os: windows-2025, py: "pypy-3.9" }
47+
- { os: windows-2025, py: "pypy-3.8" }
4948
steps:
50-
- uses: taiki-e/install-action@cargo-binstall
51-
- name: Install OS dependencies
52-
run: |
53-
set -x
54-
for i in 1 2 3; do
55-
echo "try $i" && \
56-
${{ runner.os == 'Linux' && 'sudo apt-get update -y && sudo apt-get install snapd fish csh -y' || true }} && \
57-
${{ runner.os == 'Linux' && 'cargo binstall -y nu' || true }} && \
58-
${{ runner.os == 'macOS' && 'brew install fish tcsh nushell' || true }} && \
59-
${{ runner.os == 'Windows' && 'choco install nushell' || true }} && \
60-
exit 0 || true;
61-
sleep 1
62-
done
63-
exit 1
64-
shell: bash
65-
- uses: actions/checkout@v4
49+
- name: 🚀 Install uv
50+
uses: astral-sh/setup-uv@v4
51+
- name: 📥 Checkout code
52+
uses: actions/checkout@v4
6653
with:
6754
fetch-depth: 0
68-
- name: Install the latest version of uv
69-
uses: astral-sh/setup-uv@v4
55+
- name: 🐍 Setup Python for tox
56+
uses: actions/setup-python@v5
7057
with:
71-
enable-cache: true
72-
cache-dependency-glob: "pyproject.toml"
73-
github-token: ${{ secrets.GITHUB_TOKEN }}
74-
- name: Add .local/bin to PATH Windows
75-
if: runner.os == 'Windows'
76-
shell: bash
77-
run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH
78-
- name: Add .local/bin to PATH macos-13
79-
if: matrix.os == 'macos-13'
58+
python-version: "3.13"
59+
- name: 📦 Install tox with this virtualenv
8060
shell: bash
81-
run: echo ~/.local/bin >> $GITHUB_PATH
82-
- name: Install tox
83-
if: matrix.py == '3.13' || matrix.py == '3.13t'
84-
run: uv tool install --python-preference only-managed --python 3.12 tox --with tox-uv
85-
- name: Install tox
86-
if: "!(matrix.py == '3.13' || matrix.py == '3.13t')"
87-
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
88-
- name: Setup brew python for test ${{ matrix.py }}
89-
if: startsWith(matrix.py, 'brew@')
9061
run: |
91-
set -e
92-
PY=$(echo '${{ matrix.py }}' | cut -c 6-)
93-
brew cleanup && brew upgrade python@$PY || brew install python@$PY
94-
echo "/usr/local/opt/python@$PY/libexec/bin" >>"${GITHUB_PATH}"
95-
shell: bash
96-
- name: Setup python for test ${{ matrix.py }}
97-
if: "!(startsWith(matrix.py, 'brew@') || endsWith(matrix.py, 't'))"
62+
if [[ "${{ matrix.py }}" == "3.13t" ]]; then
63+
uv tool install --no-managed-python --python 3.13 tox --with .
64+
else
65+
uv tool install --no-managed-python --python 3.13 tox --with tox-uv --with .
66+
fi
67+
- name: 🐍 Setup Python for test ${{ matrix.py }}
9868
uses: actions/setup-python@v5
69+
if: ${{ !startsWith(matrix.py, 'brew@') }}
9970
with:
10071
python-version: ${{ matrix.py }}
101-
allow-prereleases: true
102-
# quansight-labs to install free-threaded python until actions/setup-python supports it
103-
# https://github.com/actions/setup-python/issues/771
104-
- name: Setup python for test ${{ matrix.py }}
105-
if: endsWith(matrix.py, 't')
106-
uses: quansight-labs/[email protected]
107-
with:
108-
python-version: ${{ matrix.py }}
109-
- name: Pick environment to run
110-
if: matrix.py != '3.13t'
111-
run: python tasks/pick_tox_env.py ${{ matrix.py }}
112-
- name: Pick environment to run
113-
if: matrix.py == '3.13t' && runner.os != 'Windows'
114-
run: python tasks/pick_tox_env.py ${{ matrix.py }} $Python_ROOT_DIR/bin/python
115-
- name: Pick environment to run
116-
if: matrix.py == '3.13t' && runner.os == 'Windows'
117-
run: python tasks/pick_tox_env.py ${{ matrix.py }} $env:Python_ROOT_DIR\python.exe
118-
- name: Setup test suite
119-
run: tox run -vv --notest --skip-missing-interpreters false
120-
- name: Run test suite
72+
- name: 🛠️ Install OS dependencies
73+
shell: bash
74+
run: |
75+
if [ "${{ runner.os }}" = "Linux" ]; then
76+
sudo apt-get install -y software-properties-common
77+
sudo apt-add-repository ppa:fish-shell/release-4 -y
78+
curl -fsSL https://apt.fury.io/nushell/gpg.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/fury-nushell.gpg
79+
echo "deb https://apt.fury.io/nushell/ /" | sudo tee /etc/apt/sources.list.d/fury.list
80+
sudo apt-get update -y
81+
sudo apt-get install snapd fish csh nushell -y
82+
elif [ "${{ runner.os }}" = "macOS" ]; then
83+
if [[ "${{ matrix.py }}" == brew@* ]]; then
84+
PY=$(echo '${{ matrix.py }}' | cut -c 6-)
85+
brew install python@$PY || brew upgrade python@$PY
86+
echo "/usr/local/opt/python@$PY/libexec/bin" >>"${GITHUB_PATH}"
87+
fi
88+
brew install fish tcsh nushell || brew upgrade fish tcsh nushell
89+
elif [ "${{ runner.os }}" = "Windows" ]; then
90+
choco install nushell
91+
fi
92+
- name: 🧬 Pick environment to run
93+
shell: bash
94+
run: |
95+
py="${{ matrix.py }}"
96+
if [[ "$py" == brew@* ]]; then
97+
brew_version="${py#brew@}"
98+
echo "TOX_DISCOVER=/opt/homebrew/bin/python${brew_version}" >> "$GITHUB_ENV"
99+
py="$brew_version"
100+
fi
101+
[[ "$py" == graalpy-* ]] && py="graalpy"
102+
echo "TOXENV=$py" >> "$GITHUB_ENV"
103+
echo "Set TOXENV=$py"
104+
- name: 🏗️ Setup test suite
105+
run: tox run -vvvv --notest --skip-missing-interpreters false
106+
- name: 🏃 Run test suite
121107
run: tox run --skip-pkg-install
122108
timeout-minutes: 20
123109
env:
124110
PYTEST_ADDOPTS: "-vv --durations=20"
125111
CI_RUN: "yes"
126112
DIFF_AGAINST: HEAD
127-
128113
check:
129-
name: ${{ matrix.tox_env }} - ${{ matrix.os }}
114+
name: 🔎 check ${{ matrix.tox_env }} - ${{ matrix.os }}
130115
if: github.event_name != 'schedule' || github.repository_owner == 'pypa'
131116
runs-on: ${{ matrix.os }}
132117
strategy:
133118
fail-fast: false
134119
matrix:
135120
os:
136-
- ubuntu-latest
137-
- windows-latest
121+
- ubuntu-24.04
122+
- windows-2025
138123
tox_env:
139124
- dev
140125
- docs
141126
- readme
142127
- upgrade
143128
- zipapp
144129
exclude:
145-
- { os: windows-latest, tox_env: readme }
146-
- { os: windows-latest, tox_env: docs }
130+
- { os: windows-2025, tox_env: readme }
131+
- { os: windows-2025, tox_env: docs }
147132
steps:
148-
- uses: actions/checkout@v4
149-
with:
150-
fetch-depth: 0
151-
- name: Install the latest version of uv
133+
- name: 🚀 Install uv
152134
uses: astral-sh/setup-uv@v4
153-
with:
154-
enable-cache: true
155-
cache-dependency-glob: "pyproject.toml"
156-
github-token: ${{ secrets.GITHUB_TOKEN }}
157-
- name: Add .local/bin to Windows PATH
158-
if: runner.os == 'Windows'
159-
shell: bash
160-
run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH
161-
- name: Install tox
135+
- name: 📦 Install tox
162136
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
163-
- name: Setup check suite
164-
run: tox r -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }}
165-
- name: Run check for ${{ matrix.tox_env }}
166-
run: tox r --skip-pkg-install -e ${{ matrix.tox_env }}
137+
- name: 📥 Checkout code
138+
uses: actions/checkout@v4
139+
with:
140+
fetch-depth: 0
141+
- name: 🏗️ Setup check suite
142+
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }}
143+
- name: 🏃 Run check for ${{ matrix.tox_env }}
144+
run: tox run --skip-pkg-install -e ${{ matrix.tox_env }}

.github/workflows/release.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@ env:
88

99
jobs:
1010
build:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-24.04
1212
steps:
13-
- uses: actions/checkout@v4
13+
- name: 📥 Checkout code
14+
uses: actions/checkout@v4
1415
with:
1516
fetch-depth: 0
16-
- name: Install the latest version of uv
17+
- name: 🚀 Install the latest version of uv
1718
uses: astral-sh/setup-uv@v4
1819
with:
1920
enable-cache: true
2021
cache-dependency-glob: "pyproject.toml"
2122
github-token: ${{ secrets.GITHUB_TOKEN }}
22-
- name: Build package
23+
- name: 📦 Build package
2324
run: uv build --python 3.13 --python-preference only-managed --sdist --wheel . --out-dir dist
24-
- name: Store the distribution packages
25+
- name: 📦 Store the distribution packages
2526
uses: actions/upload-artifact@v4
2627
with:
2728
name: ${{ env.dists-artifact-name }}
@@ -30,19 +31,19 @@ jobs:
3031
release:
3132
needs:
3233
- build
33-
runs-on: ubuntu-latest
34+
runs-on: ubuntu-24.04
3435
environment:
3536
name: release
3637
url: https://pypi.org/project/virtualenv/${{ github.ref_name }}
3738
permissions:
3839
id-token: write
3940
steps:
40-
- name: Download all the dists
41+
- name: 📥 Download all the dists
4142
uses: actions/download-artifact@v4
4243
with:
4344
name: ${{ env.dists-artifact-name }}
4445
path: dist/
45-
- name: Publish to PyPI
46+
- name: 🚀 Publish to PyPI
4647
uses: pypa/[email protected]
4748
with:
4849
attestations: true

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
- id: end-of-file-fixer
66
- id: trailing-whitespace
77
- repo: https://github.com/python-jsonschema/check-jsonschema
8-
rev: 0.33.0
8+
rev: 0.33.2
99
hooks:
1010
- id: check-github-workflows
1111
args: ["--verbose"]
@@ -24,13 +24,13 @@ repos:
2424
hooks:
2525
- id: pyproject-fmt
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: "v0.11.11"
27+
rev: "v0.12.2"
2828
hooks:
2929
- id: ruff-format
3030
- id: ruff
3131
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
3232
- repo: https://github.com/rbubley/mirrors-prettier
33-
rev: "v3.5.3"
33+
rev: "v3.6.2"
3434
hooks:
3535
- id: prettier
3636
additional_dependencies:

docs/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ virtualenv
3333
``virtualenv`` is a tool to create isolated Python environments.
3434

3535
virtualenv vs venv
36-
------------
36+
------------------
3737

3838
Since Python ``3.3``, a subset of it has been
3939
integrated into the standard library under the `venv module <https://docs.python.org/3/library/venv.html>`_. The
@@ -46,7 +46,7 @@ integrated into the standard library under the `venv module <https://docs.python
4646
- does not have as rich programmatic API (describe virtual environments without creating them).
4747

4848
Concept and purpose of virtualenv
49-
------------
49+
---------------------------------
5050

5151
The basic problem being addressed is one of dependencies and versions, and indirectly permissions.
5252
Imagine you have an application that needs version ``1`` of ``LibFoo``, but another application requires version
@@ -63,7 +63,7 @@ libraries either).
6363

6464

6565
Compatibility
66-
------------
66+
-------------
6767
With the release of virtualenv 20.22, April 2023, (`release note <https://virtualenv.pypa.io/en/latest/changelog.html#v20-22-0-2023-04-19>`__) target interpreters are now limited to Python v. 3.7+.
6868

6969
Trying to use an earlier version will normally result in the target interpreter raising a syntax error. This virtualenv tool will then print some details about the exception and abort, ie no explicit warning about trying to use an outdated/incompatible version. It may look like this:

tasks/pick_tox_env.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

tests/integration/test_cachedir_tag.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
def compatible_is_tar_present() -> bool:
20-
return TAR and "--exclude-caches" in check_output(args=[TAR, "--help"], text=True)
20+
return TAR and "--exclude-caches" in check_output(args=[TAR, "--help"], text=True, encoding="utf-8")
2121

2222

2323
@pytest.mark.skipif(sys.platform == "win32", reason="Windows does not have tar")
@@ -27,6 +27,6 @@ def test_cachedir_tag_ignored_by_tag(tmp_path: Path) -> None:
2727
cli_run(["--activators", "", "--without-pip", str(venv)])
2828

2929
args = [TAR, "--create", "--file", "/dev/null", "--exclude-caches", "--verbose", venv.name]
30-
tar_result = run(args=args, capture_output=True, text=True, cwd=tmp_path)
30+
tar_result = run(args=args, capture_output=True, text=True, encoding="utf-8", cwd=tmp_path)
3131
assert tar_result.stdout == ".venv/\n.venv/CACHEDIR.TAG\n"
3232
assert tar_result.stderr == f"{TAR}: .venv/: contains a cache directory tag CACHEDIR.TAG; contents not dumped\n"

0 commit comments

Comments
 (0)