diff --git a/.github/workflows/check.yml b/.github/workflows/check.yaml similarity index 68% rename from .github/workflows/check.yml rename to .github/workflows/check.yaml index e929054a2..512e54ba6 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yaml @@ -62,10 +62,29 @@ jobs: done exit 1 shell: bash - - name: Setup python for tox - uses: actions/setup-python@v5 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v3 with: - python-version: "3.12" + enable-cache: true + cache-dependency-glob: "pyproject.toml" + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Add .local/bin to PATH Windows + if: runner.os == 'Windows' + shell: bash + run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH + - name: Add .local/bin to PATH macos-13 + if: matrix.os == 'macos-13' + shell: bash + run: echo ~/.local/bin >> $GITHUB_PATH + - name: Install tox + if: matrix.py == '3.13' + run: uv tool install --python-preference only-managed --python 3.12 tox --with tox-uv + - name: Install tox + if: matrix.py != '3.13' + run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv - name: Setup brew python for test ${{ matrix.py }} if: startsWith(matrix.py,'brew@') run: | @@ -74,17 +93,6 @@ jobs: brew cleanup && brew upgrade python@$PY || brew install python@$PY echo "/usr/local/opt/python@$PY/libexec/bin" >>"${GITHUB_PATH}" shell: bash - - name: Install tox-uv - run: python -m pip install tox-uv pip -U - if: "!(startsWith(matrix.py,'pypy') || matrix.py == '3.7' || matrix.py == 'brew@3.9' || matrix.py == 'brew@3.8')" - - name: Install tox - run: python -m pip install tox pip -U - if: "(startsWith(matrix.py,'pypy') || matrix.py == '3.7' || matrix.py == 'brew@3.9' || matrix.py == 'brew@3.8')" - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Use local virtualenv for tox - run: python -m pip install . - name: Setup python for test ${{ matrix.py }} if: "!( startsWith(matrix.py,'brew@') || endsWith(matrix.py, '-dev') )" uses: actions/setup-python@v5 @@ -92,19 +100,11 @@ jobs: python-version: ${{ matrix.py }} allow-prereleases: true - name: Pick environment to run - run: | - import os; import platform; import sys; from pathlib import Path - plat = platform.python_implementation() - e = f"3.{sys.version_info.minor}" if plat == "CPython" else f"pypy3{sys.version_info.minor}" - env = f"TOXENV={e}" - print(f"Picked: {env} for {sys.version} based of {sys.executable}") - with Path(os.environ["GITHUB_ENV"]).open("ta") as file_handler: - file_handler.write(env) - shell: python + run: python tasks/pick_tox_env.py ${{ matrix.py }} - name: Setup test suite - run: tox -vv --notest --skip-missing-interpreters false + run: tox run -vv --notest --skip-missing-interpreters false - name: Run test suite - run: tox --skip-pkg-install + run: tox run --skip-pkg-install timeout-minutes: 20 env: PYTEST_ADDOPTS: "-vv --durations=20" @@ -134,15 +134,19 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup Python "3.12" - uses: actions/setup-python@v5 + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v3 with: - python-version: "3.12" + enable-cache: true + cache-dependency-glob: "pyproject.toml" + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Add .local/bin to Windows PATH + if: runner.os == 'Windows' + shell: bash + run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH - name: Install tox - run: python -m pip install tox-uv - - name: Setup check - run: python -m tox --skip-missing-interpreters false -e ${{ matrix.tox_env }} --notest + run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv + - name: Setup check suite + run: tox r -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }} - name: Run check for ${{ matrix.tox_env }} - run: python -m tox --skip-pkg-install -e ${{ matrix.tox_env }} - env: - UPGRADE_ADVISORY: "yes" + run: tox r --skip-pkg-install -e ${{ matrix.tox_env }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 000000000..e730e6a3b --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,48 @@ +name: Release to PyPI +on: + push: + tags: ["*"] + +env: + dists-artifact-name: python-package-distributions + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v3 + with: + enable-cache: true + cache-dependency-glob: "pyproject.toml" + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Build package + run: uv build --python 3.13 --python-preference only-managed --sdist --wheel . --out-dir dist + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: ${{ env.dists-artifact-name }} + path: dist/* + + release: + needs: + - build + runs-on: ubuntu-latest + environment: + name: release + url: https://pypi.org/project/virtualenv/${{ github.ref_name }} + permissions: + id-token: write + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: ${{ env.dists-artifact-name }} + path: dist/ + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@v1.10.1 + with: + attestations: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index eb55eba1c..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Release to PyPI -on: - push: - tags: ["*"] - -jobs: - release: - runs-on: ubuntu-latest - environment: - name: release - url: https://pypi.org/p/virtualenv - permissions: - id-token: write - steps: - - name: Setup python to build package - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - name: Install build - run: python -m pip install build - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Build package - run: pyproject-build -s -w . -o dist - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.10.1 diff --git a/README.md b/README.md index c0704e8c1..87f45e077 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Discord](https://img.shields.io/discord/803025117553754132)](https://discord.gg/pypa) [![Downloads](https://static.pepy.tech/badge/virtualenv/month)](https://pepy.tech/project/virtualenv) [![PyPI - License](https://img.shields.io/pypi/l/virtualenv?style=flat-square)](https://opensource.org/licenses/MIT) -[![check](https://github.com/pypa/virtualenv/actions/workflows/check.yml/badge.svg)](https://github.com/pypa/virtualenv/actions/workflows/check.yml) +[![check](https://github.com/pypa/virtualenv/actions/workflows/check.yaml/badge.svg)](https://github.com/pypa/virtualenv/actions/workflows/check.yaml) A tool for creating isolated `virtual` python environments. diff --git a/docs/changelog/2765.bugfix.rst b/docs/changelog/2765.bugfix.rst new file mode 100644 index 000000000..4f447b98a --- /dev/null +++ b/docs/changelog/2765.bugfix.rst @@ -0,0 +1 @@ +Upgrade embedded wheels: setuptools to ``75.1.0`` from ``74.1.2`` - by :user:`gaborbernat`. diff --git a/src/virtualenv/seed/wheels/embed/__init__.py b/src/virtualenv/seed/wheels/embed/__init__.py index 0a3a3b86a..f068efc7c 100644 --- a/src/virtualenv/seed/wheels/embed/__init__.py +++ b/src/virtualenv/seed/wheels/embed/__init__.py @@ -13,37 +13,37 @@ }, "3.8": { "pip": "pip-24.2-py3-none-any.whl", - "setuptools": "setuptools-74.1.2-py3-none-any.whl", + "setuptools": "setuptools-75.1.0-py3-none-any.whl", "wheel": "wheel-0.44.0-py3-none-any.whl", }, "3.9": { "pip": "pip-24.2-py3-none-any.whl", - "setuptools": "setuptools-74.1.2-py3-none-any.whl", + "setuptools": "setuptools-75.1.0-py3-none-any.whl", "wheel": "wheel-0.44.0-py3-none-any.whl", }, "3.10": { "pip": "pip-24.2-py3-none-any.whl", - "setuptools": "setuptools-74.1.2-py3-none-any.whl", + "setuptools": "setuptools-75.1.0-py3-none-any.whl", "wheel": "wheel-0.44.0-py3-none-any.whl", }, "3.11": { "pip": "pip-24.2-py3-none-any.whl", - "setuptools": "setuptools-74.1.2-py3-none-any.whl", + "setuptools": "setuptools-75.1.0-py3-none-any.whl", "wheel": "wheel-0.44.0-py3-none-any.whl", }, "3.12": { "pip": "pip-24.2-py3-none-any.whl", - "setuptools": "setuptools-74.1.2-py3-none-any.whl", + "setuptools": "setuptools-75.1.0-py3-none-any.whl", "wheel": "wheel-0.44.0-py3-none-any.whl", }, "3.13": { "pip": "pip-24.2-py3-none-any.whl", - "setuptools": "setuptools-74.1.2-py3-none-any.whl", + "setuptools": "setuptools-75.1.0-py3-none-any.whl", "wheel": "wheel-0.44.0-py3-none-any.whl", }, "3.14": { "pip": "pip-24.2-py3-none-any.whl", - "setuptools": "setuptools-74.1.2-py3-none-any.whl", + "setuptools": "setuptools-75.1.0-py3-none-any.whl", "wheel": "wheel-0.44.0-py3-none-any.whl", }, } diff --git a/src/virtualenv/seed/wheels/embed/setuptools-74.1.2-py3-none-any.whl b/src/virtualenv/seed/wheels/embed/setuptools-75.1.0-py3-none-any.whl similarity index 82% rename from src/virtualenv/seed/wheels/embed/setuptools-74.1.2-py3-none-any.whl rename to src/virtualenv/seed/wheels/embed/setuptools-75.1.0-py3-none-any.whl index 946da59ac..b7f887bd4 100644 Binary files a/src/virtualenv/seed/wheels/embed/setuptools-74.1.2-py3-none-any.whl and b/src/virtualenv/seed/wheels/embed/setuptools-75.1.0-py3-none-any.whl differ diff --git a/tasks/pick_tox_env.py b/tasks/pick_tox_env.py new file mode 100644 index 000000000..fb0088458 --- /dev/null +++ b/tasks/pick_tox_env.py @@ -0,0 +1,12 @@ +from __future__ import annotations + +import os +import sys +from pathlib import Path + +py = sys.argv[1] +if py.startswith("brew@"): + py = py[len("brew@") :] +env = f"TOXENV={py}" +with Path(os.environ["GITHUB_ENV"]).open("ta", encoding="utf-8") as file_handler: + file_handler.write(env) diff --git a/tox.ini b/tox.ini index 9fe66adb4..50b2ab150 100644 --- a/tox.ini +++ b/tox.ini @@ -44,20 +44,21 @@ uv_seed = true description = format the code base to adhere to our styles, and complain about what we cannot do automatically skip_install = true deps = - pre-commit-uv>=4.1 + pre-commit-uv>=4.1.1 commands = pre-commit run --all-files --show-diff-on-failure [testenv:readme] -description = check that the long description is valid (need for PyPI) +description = check that the long description is valid skip_install = true deps = - build[uv]>=1.2.2 + check-wheel-contents>=0.6 twine>=5.1.1 -extras = + uv>=0.4.10 commands = - python -m build -o {envtmpdir} --installer uv --wheel --sdist . - twine check {envtmpdir}/* + uv build --sdist --wheel --out-dir {envtmpdir} . + twine check {envtmpdir}{/}* + check-wheel-contents --no-config {envtmpdir} [testenv:docs] description = build documentation @@ -71,7 +72,7 @@ commands = description = upgrade pip/wheels/setuptools to latest skip_install = true deps = - ruff>=0.6.4 + ruff>=0.6.5 pass_env = UPGRADE_ADVISORY change_dir = {toxinidir}/tasks