From 5a40d2ed61871b400674ff3b3c6e8f5ba410d899 Mon Sep 17 00:00:00 2001 From: David Hall Date: Fri, 13 Sep 2024 12:56:44 -0700 Subject: [PATCH] Add [test] and update CONTRIBUTING (#848) * Add [test] and update CONTRIBUTING * pr comments --- .github/workflows/release.yml | 2 +- .github/workflows/run_tests.yml | 2 +- CONTRIBUTING.md | 2 +- pyproject.toml | 7 +++++++ tests/requirements.txt | 4 ---- 5 files changed, 10 insertions(+), 7 deletions(-) delete mode 100644 tests/requirements.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 46977e56..d81b6816 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: test-script: | cp -r ${{ github.workspace }}/tests ./tests cp ${{ github.workspace }}/pyproject.toml ./pyproject.toml - python -m pip install -r ./tests/requirements.txt + python -m pip install -e ".[tests]" pytest pypi-token: ${{ secrets.pypi_token }} github-user: patrick-kidger diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 5ae7f0c1..bca2d10b 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -23,7 +23,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install -r ./tests/requirements.txt + python -m pip install -e ".[tests]" - name: Checks with pre-commit uses: pre-commit/action@v2.0.3 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2385c93e..2c4739ec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,7 +34,7 @@ Now make your changes. Make sure to include additional tests if necessary. Next verify the tests all pass: ```bash -pip install pytest +pip install -e ".[tests]" pytest ``` diff --git a/pyproject.toml b/pyproject.toml index 88c80af0..7c6defe6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,3 +55,10 @@ reportIncompatibleMethodOverride = true reportIncompatibleVariableOverride = false # Incompatible with eqx.AbstractVar reportFunctionMemberAccess = false include = ["equinox", "tests"] + +[project.optional-dependencies] +tests = [ + "pytest", + "beartype", + "optax" +] diff --git a/tests/requirements.txt b/tests/requirements.txt deleted file mode 100644 index 946ff033..00000000 --- a/tests/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -jaxlib -optax -pytest -beartype