From 0f2a64833df87f200093ebba391813caae4eeb85 Mon Sep 17 00:00:00 2001 From: pdmurray Date: Mon, 18 May 2026 11:58:25 -0700 Subject: [PATCH] Move from requirements.txt to dependency groups Signed-off-by: pdmurray --- .github/workflows/build_wheels.yml | 18 +++++++++--------- .github/workflows/coverage.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/lint_and_docs.yml | 2 +- CONTRIBUTING.md | 2 +- Dockerfile | 4 ++-- MANIFEST.in | 1 - README.md | 3 +-- pyproject.toml | 24 ++++++++++++++++++++++++ requirements-docs.txt | 5 ----- requirements-extra.txt | 5 ----- requirements-test.txt | 6 ------ 12 files changed, 40 insertions(+), 34 deletions(-) delete mode 100644 requirements-docs.txt delete mode 100644 requirements-extra.txt delete mode 100644 requirements-test.txt diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 8d7dc757..d0f48704 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -106,7 +106,7 @@ jobs: - name: Install Python dependencies run: | python3 -m pip install --upgrade pip - python3 -m pip install -r requirements-test.txt + python3 -m pip install --group test python3 -m pip install --no-index --find-links=dist/ --only-binary=pystack pystack - name: Disable ptrace security restrictions run: | @@ -141,7 +141,7 @@ jobs: sudo apt-get install -qy gdb - name: Install Python dependencies run: | - uv pip install -r requirements-test.txt + uv pip install --group test uv pip install --no-index --find-links=dist/ --only-binary=pystack pystack - name: Disable ptrace security restrictions run: | @@ -176,7 +176,7 @@ jobs: - name: Install Python dependencies run: | python${{matrix.python_version}} -m pip install --upgrade pip - python${{matrix.python_version}} -m pip install -r requirements-test.txt + python${{matrix.python_version}} -m pip install --group test python${{matrix.python_version}} -m pip install --no-index --find-links=dist/ --only-binary=pystack pystack - name: Disable ptrace security restrictions run: | @@ -214,7 +214,7 @@ jobs: - name: Install Python dependencies run: | python${{matrix.python_version}} -m pip install --upgrade pip - python${{matrix.python_version}} -m pip install -r requirements-test.txt + python${{matrix.python_version}} -m pip install --group test python${{matrix.python_version}} -m pip install --no-index --find-links=dist/ --only-binary=pystack pystack - name: Disable ptrace security restrictions run: | @@ -253,7 +253,7 @@ jobs: - name: Install Python dependencies run: | python${{matrix.python_version}} -m pip install --upgrade pip - python${{matrix.python_version}} -m pip install -r requirements-test.txt + python${{matrix.python_version}} -m pip install --group test python${{matrix.python_version}} -m pip install --no-index --find-links=dist/ --only-binary=pystack pystack - name: Install setuptools for the free-threading version run: | @@ -290,7 +290,7 @@ jobs: run: | python3 -m venv venv venv/bin/python3 -m pip install --upgrade pip - venv/bin/python3 -m pip install -r requirements-test.txt + venv/bin/python3 -m pip install --group test venv/bin/python3 -m pip install --no-index --find-links=dist/ --only-binary=pystack pystack - name: Run pytest env: @@ -326,7 +326,7 @@ jobs: - name: Install Python dependencies run: | python3 -m pip install --upgrade pip - python3 -m pip install -r requirements-test.txt + python3 -m pip install --group test python3 -m pip install --no-index --find-links=dist/ --only-binary=pystack pystack - name: Run pytest env: @@ -364,7 +364,7 @@ jobs: run: | python -m venv venv venv/bin/python -m pip install --upgrade pip - venv/bin/python -m pip install -r requirements-test.txt + venv/bin/python -m pip install --group test venv/bin/python -m pip install --no-index --find-links=dist/ --only-binary=pystack pystack - name: Run pytest env: @@ -402,7 +402,7 @@ jobs: run: | python3 -m venv venv venv/bin/python3 -m pip install --upgrade pip - venv/bin/python3 -m pip install -r requirements-test.txt + venv/bin/python3 -m pip install --group test venv/bin/python3 -m pip install --no-index --find-links=dist/ --only-binary=pystack pystack - name: Run pytest env: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 91edb19a..42cbc480 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -47,7 +47,7 @@ jobs: - name: Install Python dependencies run: | python3 -m pip install --upgrade pip scikit-build-core nanobind - python3 -m pip install -e . -r requirements-test.txt + python3 -m pip install -e . --group test - name: Disable ptrace security restrictions run: | echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9e86acec..e956ff6c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -24,7 +24,7 @@ jobs: sudo apt-get install -qy libdw-dev libelf-dev pkg-config - name: Install Python dependencies run: | - python3 -m pip install -r requirements-extra.txt + python3 -m pip install --group extra - name: Install Package run: | python3 -m pip install -e . diff --git a/.github/workflows/lint_and_docs.yml b/.github/workflows/lint_and_docs.yml index 483fc028..839cab8b 100644 --- a/.github/workflows/lint_and_docs.yml +++ b/.github/workflows/lint_and_docs.yml @@ -16,7 +16,7 @@ jobs: sudo apt-get install -qy libdw-dev libelf-dev - name: Install Python dependencies run: | - python3 -m pip install -r requirements-extra.txt + python3 -m pip install --group extra - name: Install Package run: | python3 -m pip install -e . diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9216621b..11fe046e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,7 +64,7 @@ easier to validate it. Before commiting anything, install the pre-commit hooks: ```shell -python3 -m pip install -r requirements-extra.txt +python3 -m pip install --group extra pre-commit install ``` diff --git a/Dockerfile b/Dockerfile index aa7a050f..d74e0cc7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -93,12 +93,12 @@ ENV PYTHON=python3.12 \ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig # Copy the required files -COPY ["requirements-test.txt", "requirements-extra.txt", "requirements-docs.txt", "/tmp/"] +COPY pyproject.toml /tmp/ # Install Python packages RUN $PYTHON -m venv $VIRTUAL_ENV \ && pip install -U pip wheel setuptools cython pkgconfig \ - && pip install -U -r /tmp/requirements-test.txt -r /tmp/requirements-extra.txt + && pip install -U --group "/tmp/pyproject.toml:test" --group "/tmp/pyproject.toml:extra" # Set the working directory WORKDIR /src diff --git a/MANIFEST.in b/MANIFEST.in index def84573..c0b658b5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,7 +3,6 @@ exclude CONTRIBUTING.md exclude Dockerfile exclude src/pystack/*.cpp exclude src/pystack/*.h -exclude requirements-*.txt exclude tox.ini exclude valgrind.supp diff --git a/README.md b/README.md index a6df6fe3..276e3b18 100644 --- a/README.md +++ b/README.md @@ -84,8 +84,7 @@ cd pystack python3 -m venv ../pystack-env/ # just an example, put this wherever you want source ../pystack-env/bin/activate python3 -m pip install --upgrade pip -python3 -m pip install -e . -python3 -m pip install -r requirements-test.txt -r requirements-extra.txt +python3 -m pip install -e . --group test --group extra ``` This will install PyStack in the virtual environment in development mode (the `-e` of the last diff --git a/pyproject.toml b/pyproject.toml index 3688239a..28885b38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,30 @@ classifiers = [ "Topic :: Software Development :: Debuggers", ] +[dependency-groups] +docs = [ + "recommonmark", + "sphinx", + "sphinx-autobuild", + "sphinx-argparse", + "furo", +] +extra = [ + "mypy", + "bump2version", + "towncrier", + "pre-commit", + {include-group = "docs"}, +] +test = [ + "coverage[toml]", + "pyinstaller", + "pytest", + "pytest-cov", + "pytest-xdist", + "setuptools", +] + [project.urls] Homepage = "https://github.com/bloomberg/pystack" diff --git a/requirements-docs.txt b/requirements-docs.txt deleted file mode 100644 index 7df390dd..00000000 --- a/requirements-docs.txt +++ /dev/null @@ -1,5 +0,0 @@ -recommonmark -sphinx -sphinx-autobuild -sphinx-argparse -furo diff --git a/requirements-extra.txt b/requirements-extra.txt deleted file mode 100644 index 19921e61..00000000 --- a/requirements-extra.txt +++ /dev/null @@ -1,5 +0,0 @@ -mypy -bump2version -towncrier -pre-commit --r requirements-docs.txt diff --git a/requirements-test.txt b/requirements-test.txt deleted file mode 100644 index feb58e57..00000000 --- a/requirements-test.txt +++ /dev/null @@ -1,6 +0,0 @@ -coverage[toml] -pyinstaller -pytest -pytest-cov -pytest-xdist -setuptools