diff --git a/cibuildwheel/resources/constraints-python310.txt b/cibuildwheel/resources/constraints-python310.txt index 4076fb994..951be74d4 100644 --- a/cibuildwheel/resources/constraints-python310.txt +++ b/cibuildwheel/resources/constraints-python310.txt @@ -1,21 +1,18 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# nox -s update_constraints-3.10 -# +# This file was autogenerated by uv via the following command: +# uv pip compile --python-version=3.10 cibuildwheel/resources/constraints.in --output-file=cibuildwheel/resources/constraints-python310.txt build==1.1.1 - # via -r cibuildwheel/resources/constraints.in delocate==0.10.7 - # via -r cibuildwheel/resources/constraints.in distlib==0.3.8 # via virtualenv filelock==3.13.1 # via virtualenv +importlib-metadata==7.0.1 + # via build packaging==23.2 # via # build # delocate +pip==24.0 platformdirs==4.2.0 # via virtualenv pyproject-hooks==1.0.0 @@ -27,8 +24,5 @@ tomli==2.0.1 typing-extensions==4.10.0 # via delocate virtualenv==20.25.1 - # via -r cibuildwheel/resources/constraints.in - -# The following packages are considered to be unsafe in a requirements file: -pip==24.0 - # via -r cibuildwheel/resources/constraints.in +zipp==3.17.0 + # via importlib-metadata diff --git a/cibuildwheel/resources/constraints-python311.txt b/cibuildwheel/resources/constraints-python311.txt index e1723ac5f..55c880f65 100644 --- a/cibuildwheel/resources/constraints-python311.txt +++ b/cibuildwheel/resources/constraints-python311.txt @@ -1,13 +1,7 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# nox -s update_constraints-3.11 -# +# This file was autogenerated by uv via the following command: +# uv pip compile --python-version=3.11 cibuildwheel/resources/constraints.in --output-file=cibuildwheel/resources/constraints-python311.txt build==1.1.1 - # via -r cibuildwheel/resources/constraints.in delocate==0.10.7 - # via -r cibuildwheel/resources/constraints.in distlib==0.3.8 # via virtualenv filelock==3.13.1 @@ -16,6 +10,7 @@ packaging==23.2 # via # build # delocate +pip==24.0 platformdirs==4.2.0 # via virtualenv pyproject-hooks==1.0.0 @@ -23,8 +18,3 @@ pyproject-hooks==1.0.0 typing-extensions==4.10.0 # via delocate virtualenv==20.25.1 - # via -r cibuildwheel/resources/constraints.in - -# The following packages are considered to be unsafe in a requirements file: -pip==24.0 - # via -r cibuildwheel/resources/constraints.in diff --git a/cibuildwheel/resources/constraints-python312.txt b/cibuildwheel/resources/constraints-python312.txt index e9895dfb6..8f649dda0 100644 --- a/cibuildwheel/resources/constraints-python312.txt +++ b/cibuildwheel/resources/constraints-python312.txt @@ -1,13 +1,7 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# nox -s update_constraints-3.12 -# +# This file was autogenerated by uv via the following command: +# uv pip compile --python-version=3.12 cibuildwheel/resources/constraints.in --output-file=cibuildwheel/resources/constraints-python312.txt build==1.1.1 - # via -r cibuildwheel/resources/constraints.in delocate==0.10.7 - # via -r cibuildwheel/resources/constraints.in distlib==0.3.8 # via virtualenv filelock==3.13.1 @@ -16,6 +10,7 @@ packaging==23.2 # via # build # delocate +pip==24.0 platformdirs==4.2.0 # via virtualenv pyproject-hooks==1.0.0 @@ -23,8 +18,3 @@ pyproject-hooks==1.0.0 typing-extensions==4.10.0 # via delocate virtualenv==20.25.1 - # via -r cibuildwheel/resources/constraints.in - -# The following packages are considered to be unsafe in a requirements file: -pip==24.0 - # via -r cibuildwheel/resources/constraints.in diff --git a/cibuildwheel/resources/constraints-python37.txt b/cibuildwheel/resources/constraints-python37.txt index bc064d09a..8d23614b9 100644 --- a/cibuildwheel/resources/constraints-python37.txt +++ b/cibuildwheel/resources/constraints-python37.txt @@ -1,13 +1,7 @@ -# -# This file is autogenerated by pip-compile with Python 3.7 -# by the following command: -# -# nox -s update_constraints-3.7 -# +# This file was autogenerated by uv via the following command: +# uv pip compile --python-version=3.7 cibuildwheel/resources/constraints.in --output-file=cibuildwheel/resources/constraints-python37.txt build==1.1.1 - # via -r cibuildwheel/resources/constraints.in delocate==0.10.7 - # via -r cibuildwheel/resources/constraints.in distlib==0.3.8 # via virtualenv filelock==3.12.2 @@ -20,6 +14,7 @@ packaging==23.2 # via # build # delocate +pip==24.0 platformdirs==4.0.0 # via virtualenv pyproject-hooks==1.0.0 @@ -34,10 +29,5 @@ typing-extensions==4.7.1 # importlib-metadata # platformdirs virtualenv==20.25.1 - # via -r cibuildwheel/resources/constraints.in zipp==3.15.0 # via importlib-metadata - -# The following packages are considered to be unsafe in a requirements file: -pip==24.0 - # via -r cibuildwheel/resources/constraints.in diff --git a/cibuildwheel/resources/constraints-python38.txt b/cibuildwheel/resources/constraints-python38.txt index 027cc0055..bd1bf6030 100644 --- a/cibuildwheel/resources/constraints-python38.txt +++ b/cibuildwheel/resources/constraints-python38.txt @@ -1,13 +1,7 @@ -# -# This file is autogenerated by pip-compile with Python 3.8 -# by the following command: -# -# nox -s update_constraints-3.8 -# +# This file was autogenerated by uv via the following command: +# uv pip compile --python-version=3.8 cibuildwheel/resources/constraints.in --output-file=cibuildwheel/resources/constraints-python38.txt build==1.1.1 - # via -r cibuildwheel/resources/constraints.in delocate==0.10.7 - # via -r cibuildwheel/resources/constraints.in distlib==0.3.8 # via virtualenv filelock==3.13.1 @@ -18,6 +12,7 @@ packaging==23.2 # via # build # delocate +pip==24.0 platformdirs==4.2.0 # via virtualenv pyproject-hooks==1.0.0 @@ -29,10 +24,5 @@ tomli==2.0.1 typing-extensions==4.10.0 # via delocate virtualenv==20.25.1 - # via -r cibuildwheel/resources/constraints.in zipp==3.17.0 # via importlib-metadata - -# The following packages are considered to be unsafe in a requirements file: -pip==24.0 - # via -r cibuildwheel/resources/constraints.in diff --git a/cibuildwheel/resources/constraints-python39.txt b/cibuildwheel/resources/constraints-python39.txt index 8662e7bb7..80046c154 100644 --- a/cibuildwheel/resources/constraints-python39.txt +++ b/cibuildwheel/resources/constraints-python39.txt @@ -1,13 +1,7 @@ -# -# This file is autogenerated by pip-compile with Python 3.9 -# by the following command: -# -# nox -s update_constraints-3.9 -# +# This file was autogenerated by uv via the following command: +# uv pip compile --python-version=3.9 cibuildwheel/resources/constraints.in --output-file=cibuildwheel/resources/constraints-python39.txt build==1.1.1 - # via -r cibuildwheel/resources/constraints.in delocate==0.10.7 - # via -r cibuildwheel/resources/constraints.in distlib==0.3.8 # via virtualenv filelock==3.13.1 @@ -18,6 +12,7 @@ packaging==23.2 # via # build # delocate +pip==24.0 platformdirs==4.2.0 # via virtualenv pyproject-hooks==1.0.0 @@ -29,10 +24,5 @@ tomli==2.0.1 typing-extensions==4.10.0 # via delocate virtualenv==20.25.1 - # via -r cibuildwheel/resources/constraints.in zipp==3.17.0 # via importlib-metadata - -# The following packages are considered to be unsafe in a requirements file: -pip==24.0 - # via -r cibuildwheel/resources/constraints.in diff --git a/cibuildwheel/resources/constraints.txt b/cibuildwheel/resources/constraints.txt index e9895dfb6..8f649dda0 100644 --- a/cibuildwheel/resources/constraints.txt +++ b/cibuildwheel/resources/constraints.txt @@ -1,13 +1,7 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# nox -s update_constraints-3.12 -# +# This file was autogenerated by uv via the following command: +# uv pip compile --python-version=3.12 cibuildwheel/resources/constraints.in --output-file=cibuildwheel/resources/constraints-python312.txt build==1.1.1 - # via -r cibuildwheel/resources/constraints.in delocate==0.10.7 - # via -r cibuildwheel/resources/constraints.in distlib==0.3.8 # via virtualenv filelock==3.13.1 @@ -16,6 +10,7 @@ packaging==23.2 # via # build # delocate +pip==24.0 platformdirs==4.2.0 # via virtualenv pyproject-hooks==1.0.0 @@ -23,8 +18,3 @@ pyproject-hooks==1.0.0 typing-extensions==4.10.0 # via delocate virtualenv==20.25.1 - # via -r cibuildwheel/resources/constraints.in - -# The following packages are considered to be unsafe in a requirements file: -pip==24.0 - # via -r cibuildwheel/resources/constraints.in diff --git a/noxfile.py b/noxfile.py index 8747b91dd..b761203f4 100644 --- a/noxfile.py +++ b/noxfile.py @@ -9,8 +9,6 @@ nox.options.sessions = ["lint", "pylint", "check_manifest", "tests"] -PYTHON_ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - DIR = Path(__file__).parent.resolve() if os.environ.get("CI", None): @@ -60,32 +58,33 @@ def check_manifest(session: nox.Session) -> None: session.run("check-manifest", *session.posargs) -@nox.session(python=PYTHON_ALL_VERSIONS) +@nox.session def update_constraints(session: nox.Session) -> None: """ Update the dependencies inplace. """ - session.install("pip-tools") - assert isinstance(session.python, str) - python_version = session.python.replace(".", "") - env = os.environ.copy() - # CUSTOM_COMPILE_COMMAND is a pip-compile option that tells users how to - # regenerate the constraints files - env["CUSTOM_COMPILE_COMMAND"] = f"nox -s {session.name}" - session.run( - "pip-compile", - "--allow-unsafe", - "--upgrade", - "cibuildwheel/resources/constraints.in", - f"--output-file=cibuildwheel/resources/constraints-python{python_version}.txt", - env=env, - ) - if session.python == PYTHON_ALL_VERSIONS[-1]: - RESOURCES = DIR / "cibuildwheel" / "resources" - shutil.copyfile( - RESOURCES / f"constraints-python{python_version}.txt", - RESOURCES / "constraints.txt", + session.install("uv") + for minor_version in range(7, 13): + python_version = f"3.{minor_version}" + env = os.environ.copy() + # CUSTOM_COMPILE_COMMAND is a pip-compile option that tells users how to + # regenerate the constraints files + env["CUSTOM_COMPILE_COMMAND"] = f"nox -s {session.name}" + session.run( + "uv", + "pip", + "compile", + f"--python-version={python_version}", + "--upgrade", + "cibuildwheel/resources/constraints.in", + f"--output-file=cibuildwheel/resources/constraints-python{python_version.replace('.', '')}.txt", + env=env, ) + RESOURCES = DIR / "cibuildwheel" / "resources" + shutil.copyfile( + RESOURCES / "constraints-python312.txt", + RESOURCES / "constraints.txt", + ) @nox.session