From ff8cebbcf5094012ee914308dc4f9ecaa7f4684c Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sat, 21 Oct 2023 00:23:00 -0700 Subject: [PATCH] Lock test dependencies (#16283) This was discussed in the contributor meetup today. This is a simple solution that requires very few changes. If you want to upgrade the lock file, you can pass `--upgrade` or just delete it and regenerate. --- .github/workflows/test.yml | 4 +- MANIFEST.in | 1 + test-requirements.in | 19 +++++++ test-requirements.txt | 101 +++++++++++++++++++++++++++++++------ 4 files changed, 108 insertions(+), 17 deletions(-) create mode 100644 test-requirements.in diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index afa5d5823ea9..86704aca2f91 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -133,7 +133,7 @@ jobs: ./misc/build-debug-python.sh $PYTHONVERSION $PYTHONDIR $VENV source $VENV/bin/activate - name: Install tox - run: pip install --upgrade 'setuptools!=50' tox==4.11.0 + run: pip install setuptools==68.2.2 tox==4.11.0 - name: Compiled with mypyc if: ${{ matrix.test_mypyc }} run: | @@ -185,7 +185,7 @@ jobs: default: 3.11.1 command: python -c "import platform; print(f'{platform.architecture()=} {platform.machine()=}');" - name: Install tox - run: pip install --upgrade 'setuptools!=50' tox==4.11.0 + run: pip install setuptools==68.2.2 tox==4.11.0 - name: Setup tox environment run: tox run -e py --notest - name: Test diff --git a/MANIFEST.in b/MANIFEST.in index a1c15446de3f..3ae340c7bd5e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -31,6 +31,7 @@ graft mypyc/doc # files necessary for testing sdist include mypy-requirements.txt include build-requirements.txt +include test-requirements.in include test-requirements.txt include mypy_self_check.ini prune misc diff --git a/test-requirements.in b/test-requirements.in new file mode 100644 index 000000000000..bab3ece29c02 --- /dev/null +++ b/test-requirements.in @@ -0,0 +1,19 @@ +# If you change this file (or mypy-requirements.txt or build-requirements.txt), please run: +# pip-compile --output-file=test-requirements.txt --strip-extras --allow-unsafe test-requirements.in + +-r mypy-requirements.txt +-r build-requirements.txt +attrs>=18.0 +black==23.9.1 # must match version in .pre-commit-config.yaml +filelock>=3.3.0 +# lxml 4.9.3 switched to manylinux_2_28, the wheel builder still uses manylinux2014 +lxml>=4.9.1,<4.9.3; (python_version<'3.11' or sys_platform!='win32') and python_version<'3.12' +pre-commit +pre-commit-hooks==4.5.0 +psutil>=4.0 +pytest>=7.4.0 +pytest-xdist>=1.34.0 +pytest-cov>=2.10.0 +ruff==0.1.0 # must match version in .pre-commit-config.yaml +setuptools>=65.5.1 +tomli>=1.1.0 # needed even on py311+ so the self check passes with --python-version 3.7 diff --git a/test-requirements.txt b/test-requirements.txt index a1fa98917872..3bb9cf29635f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,16 +1,87 @@ --r mypy-requirements.txt --r build-requirements.txt -attrs>=18.0 -black==23.9.1 # must match version in .pre-commit-config.yaml -filelock>=3.3.0 -# lxml 4.9.3 switched to manylinux_2_28, the wheel builder still uses manylinux2014 -lxml>=4.9.1,<4.9.3; (python_version<'3.11' or sys_platform!='win32') and python_version<'3.12' -pre-commit +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# pip-compile --allow-unsafe --output-file=test-requirements.txt --strip-extras test-requirements.in +# +attrs==23.1.0 + # via -r test-requirements.in +black==23.9.1 + # via -r test-requirements.in +cfgv==3.4.0 + # via pre-commit +click==8.1.7 + # via black +coverage==7.3.2 + # via pytest-cov +distlib==0.3.7 + # via virtualenv +execnet==2.0.2 + # via pytest-xdist +filelock==3.12.4 + # via + # -r test-requirements.in + # virtualenv +identify==2.5.30 + # via pre-commit +iniconfig==2.0.0 + # via pytest +lxml==4.9.2 ; (python_version < "3.11" or sys_platform != "win32") and python_version < "3.12" + # via -r test-requirements.in +mypy-extensions==1.0.0 + # via + # -r mypy-requirements.txt + # black +nodeenv==1.8.0 + # via pre-commit +packaging==23.2 + # via + # black + # pytest +pathspec==0.11.2 + # via black +platformdirs==3.11.0 + # via + # black + # virtualenv +pluggy==1.3.0 + # via pytest +pre-commit==3.5.0 + # via -r test-requirements.in pre-commit-hooks==4.5.0 -psutil>=4.0 -pytest>=7.4.0 -pytest-xdist>=1.34.0 -pytest-cov>=2.10.0 -ruff==0.1.0 # must match version in .pre-commit-config.yaml -setuptools>=65.5.1 -tomli>=1.1.0 # needed even on py311+ so the self check passes with --python-version 3.7 + # via -r test-requirements.in +psutil==5.9.6 + # via -r test-requirements.in +pytest==7.4.2 + # via + # -r test-requirements.in + # pytest-cov + # pytest-xdist +pytest-cov==4.1.0 + # via -r test-requirements.in +pytest-xdist==3.3.1 + # via -r test-requirements.in +pyyaml==6.0.1 + # via pre-commit +ruamel-yaml==0.17.40 + # via pre-commit-hooks +ruamel-yaml-clib==0.2.8 + # via ruamel-yaml +ruff==0.1.0 + # via -r test-requirements.in +tomli==2.0.1 + # via -r test-requirements.in +types-psutil==5.9.5.17 + # via -r build-requirements.txt +types-setuptools==68.2.0.0 + # via -r build-requirements.txt +typing-extensions==4.8.0 + # via -r mypy-requirements.txt +virtualenv==20.24.5 + # via pre-commit + +# The following packages are considered to be unsafe in a requirements file: +setuptools==68.2.2 + # via + # -r test-requirements.in + # nodeenv