From 078bdef190228594316a6f22361ed2f6f4f12778 Mon Sep 17 00:00:00 2001 From: Cameron Kuchta Date: Fri, 13 Sep 2024 11:33:25 -0500 Subject: [PATCH 01/14] Reorder pip installs and add pytest-cov --- mamba_environment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mamba_environment.yml b/mamba_environment.yml index 901e5ce..0753f88 100644 --- a/mamba_environment.yml +++ b/mamba_environment.yml @@ -16,5 +16,6 @@ dependencies: - sphinx - pip - pip: - - pytest - nox + - pytest + - pytest-cov From d28099a96dd18d6bdb86e265d099043aa932349b Mon Sep 17 00:00:00 2001 From: Cameron Kuchta Date: Fri, 13 Sep 2024 12:02:32 -0500 Subject: [PATCH 02/14] Add codecov token. --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 713583b..544a67a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,3 +74,5 @@ jobs: uses: codecov/codecov-action@v3 with: file: ./coverage.xml + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From b229637300671b710a3c15e045f485af325e38c2 Mon Sep 17 00:00:00 2001 From: Cameron Kuchta Date: Fri, 13 Sep 2024 12:02:48 -0500 Subject: [PATCH 03/14] Add coverage to nox testing. --- noxfile.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index aded912..0c70c5f 100644 --- a/noxfile.py +++ b/noxfile.py @@ -28,7 +28,16 @@ def install_environment(session, environment_path="mamba_environment.yml"): def tests(session): """Run tests with pytest.""" install_environment(session) - session.run("pytest") + + with_coverage: tuple[str, ...] = ( + "--cov=wipplpy", + "--cov-report=xml", + "--cov-config=pyproject.toml", + "--cov-append", + "--cov-report", + "xml:coverage.xml", + ) + session.run("pytest", *with_coverage) @nox.session(python=maxpython) From 4289598b1ba3d2524e131f36669ea3028e76098b Mon Sep 17 00:00:00 2001 From: Cameron Kuchta Date: Fri, 8 Nov 2024 10:29:07 -0600 Subject: [PATCH 04/14] Update codecov version. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 544a67a..900ad32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: - name: Upload coverage to codecov if: ${{ contains(matrix.nox_session,'cov') }} - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: file: ./coverage.xml env: From 1418e687cfc942998a9908081552ded83fe47850 Mon Sep 17 00:00:00 2001 From: Cameron Kuchta Date: Fri, 8 Nov 2024 10:50:17 -0600 Subject: [PATCH 05/14] Add codecov yml file. --- codecov.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..ddc192b --- /dev/null +++ b/codecov.yml @@ -0,0 +1,17 @@ +codecov: + token: e8274fcd-34c2-4777-a3c1-688a438292d6 + notify: + wait_for_ci: false + require_ci_to_pass: false +# coverage: +# range: 90..98 +# status: +# project: +# default: +# # Temporarily allow a greater project coverage threshold; see #2757 +# threshold: 0.9% +# removed_code_behavior: adjust_base +# patch: +# default: +# threshold: 0.5% +# removed_code_behavior: adjust_base From 6ba7943f619a2f15cd7cfd1144d817a500d88d33 Mon Sep 17 00:00:00 2001 From: Cameron Kuchta Date: Fri, 8 Nov 2024 17:55:26 -0600 Subject: [PATCH 06/14] Delete token from yml --- codecov.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index ddc192b..930d53f 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,5 +1,4 @@ codecov: - token: e8274fcd-34c2-4777-a3c1-688a438292d6 notify: wait_for_ci: false require_ci_to_pass: false From f7f0b2484815197e2e2439d76a7a9cddae13f435 Mon Sep 17 00:00:00 2001 From: Cameron Kuchta Date: Fri, 8 Nov 2024 17:59:31 -0600 Subject: [PATCH 07/14] Remove if statement for uploading code coverage. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 900ad32..e6c1124 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: run: nox -s ${{ matrix.nox_session }} - name: Upload coverage to codecov - if: ${{ contains(matrix.nox_session,'cov') }} + # if: ${{ contains(matrix.nox_session,'cov') }} uses: codecov/codecov-action@v4 with: file: ./coverage.xml From 47cf45ce690dce33a66b84d849d774b77f4a86ea Mon Sep 17 00:00:00 2001 From: Cameron Kuchta Date: Fri, 8 Nov 2024 18:14:18 -0600 Subject: [PATCH 08/14] Bring if statement back and change one test to have coverage. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6c1124..5c3d04c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,10 +28,10 @@ jobs: python: '3.9' nox_session: tests-3.9 - - name: Tests, Python 3.11, macOS + - name: Tests, Python 3.11, macOS, with code coverage os: macos-latest python: '3.11' - nox_session: tests-3.11 + nox_session: tests-3.11(cov) - name: Tests, Python 3.10, macOS os: macos-latest @@ -70,7 +70,7 @@ jobs: run: nox -s ${{ matrix.nox_session }} - name: Upload coverage to codecov - # if: ${{ contains(matrix.nox_session,'cov') }} + if: ${{ contains(matrix.nox_session,'cov') }} uses: codecov/codecov-action@v4 with: file: ./coverage.xml From 212e203bc06857d082943a33d0ce1a9866c6dcf2 Mon Sep 17 00:00:00 2001 From: Cameron Kuchta Date: Fri, 8 Nov 2024 18:43:41 -0600 Subject: [PATCH 09/14] Add test specifier options. --- .github/workflows/ci.yml | 2 +- noxfile.py | 33 +++++++++++++++++++++++---------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c3d04c..95a08da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: python: '3.9' nox_session: tests-3.9 - - name: Tests, Python 3.11, macOS, with code coverage + - name: Tests, Python 3.11, with code coverage, macOS os: macos-latest python: '3.11' nox_session: tests-3.11(cov) diff --git a/noxfile.py b/noxfile.py index 0c70c5f..ca2b44b 100644 --- a/noxfile.py +++ b/noxfile.py @@ -24,20 +24,33 @@ def install_environment(session, environment_path="mamba_environment.yml"): ) +test_specifiers: list = [ + nox.param("run all tests", id="all"), + nox.param("skip slow tests", id="skipslow"), + nox.param("with code coverage", id="cov"), +] + +with_coverage: tuple[str, ...] = ( + "--cov=wipplpy", + "--cov-report=xml", + "--cov-config=pyproject.toml", + "--cov-append", + "--cov-report", + "xml:coverage.xml", +) + + @nox.session(python=supported_python_versions) -def tests(session): +@nox.parametrize("test_specifier", test_specifiers) +def tests(session, test_specifier): """Run tests with pytest.""" install_environment(session) - with_coverage: tuple[str, ...] = ( - "--cov=wipplpy", - "--cov-report=xml", - "--cov-config=pyproject.toml", - "--cov-append", - "--cov-report", - "xml:coverage.xml", - ) - session.run("pytest", *with_coverage) + options = [] + if test_specifier == "with code coverage": + options += with_coverage + + session.run("pytest", *options) @nox.session(python=maxpython) From 08272b813f5b20e13a016d1f6ec7bd60910397d2 Mon Sep 17 00:00:00 2001 From: Cameron Kuchta Date: Fri, 15 Nov 2024 10:04:36 -0600 Subject: [PATCH 10/14] Add apostrophes around session --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95a08da..57e3c1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: run: python -m pip install --progress-bar off --upgrade nox - name: Run tests - run: nox -s ${{ matrix.nox_session }} + run: nox -s '${{ matrix.nox_session }}' - name: Upload coverage to codecov if: ${{ contains(matrix.nox_session,'cov') }} From 554ac429a1ca0442399715cd448c406d2e242b6c Mon Sep 17 00:00:00 2001 From: Cameron Kuchta Date: Fri, 6 Dec 2024 11:16:26 -0600 Subject: [PATCH 11/14] Remove skip slow option --- noxfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index ca2b44b..c1a82e4 100644 --- a/noxfile.py +++ b/noxfile.py @@ -26,7 +26,6 @@ def install_environment(session, environment_path="mamba_environment.yml"): test_specifiers: list = [ nox.param("run all tests", id="all"), - nox.param("skip slow tests", id="skipslow"), nox.param("with code coverage", id="cov"), ] From b31b7033843ae8245cf4c0e6ff4291e8a7262bee Mon Sep 17 00:00:00 2001 From: Cameron Kuchta Date: Tue, 18 Feb 2025 16:16:46 -0600 Subject: [PATCH 12/14] Show what packages were installed and their version. --- noxfile.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/noxfile.py b/noxfile.py index b4c50f9..8668288 100644 --- a/noxfile.py +++ b/noxfile.py @@ -23,6 +23,14 @@ def install_environment(session, environment_path="mamba_environment.yml"): ], silent=False, ) + session.run( + *[ + session.venv_backend, + "list", + "--prefix", + session.virtualenv.location, + ] + ) test_specifiers: list = [ From 0af3f97cd12ddc1a6e009faa5da9411ed50bf308 Mon Sep 17 00:00:00 2001 From: Cameron Kuchta Date: Tue, 18 Feb 2025 16:47:48 -0600 Subject: [PATCH 13/14] Make sure numpy is less than version 2 so that the _string type still exists. --- mamba_environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mamba_environment.yml b/mamba_environment.yml index 0753f88..06489b1 100644 --- a/mamba_environment.yml +++ b/mamba_environment.yml @@ -6,7 +6,7 @@ channels: dependencies: - python - jupyter - - numpy + - numpy < 2 - scipy - matplotlib - mdsplus From f4a62926b096cff126dacba72b26d88d3db9d77f Mon Sep 17 00:00:00 2001 From: Cameron Kuchta Date: Tue, 25 Mar 2025 13:59:20 -0500 Subject: [PATCH 14/14] Change documentation python version since 3.12 not working. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57e3c1b..341a579 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,9 +38,9 @@ jobs: python: '3.9' nox_session: tests-3.9 - - name: Documentation, Python 3.12, Ubuntu + - name: Documentation, Python 3.11, Ubuntu os: ubuntu-latest - python: '3.12' + python: '3.11' nox_session: docs steps: