diff --git a/.github/workflows/codecov_lints.yml b/.github/workflows/codecov_lints.yml new file mode 100644 index 0000000..b5c3294 --- /dev/null +++ b/.github/workflows/codecov_lints.yml @@ -0,0 +1,35 @@ +name: Code coverage report + +# no permissions by default +permissions: {} + +on: + pull_request: + push: + +jobs: + run: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Set up Python + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: "3.x" + + - name: Install gsw + run: > + python -m pip install --group dev + && python -m pip install -e . + + - name: Run tests with coverage + run: | + python -m pytest -s -rxs -v --cov=gsw gsw/tests + + - name: Run linters + run: > + prek run --all-files diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 0c90a37..1108fe6 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -33,7 +33,7 @@ jobs: - name: Install gsw run: > - python -m pip install -r requirements-dev.txt + python -m pip install --group dev && python -m pip install -e . - name: Build documentation diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100644 index b3d5a09..0000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: pre-commit - -on: - pull_request: - push: - branches: [main] - -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - fetch-depth: 0 - persist-credentials: false - - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 - permissions: - actions: none \ No newline at end of file diff --git a/.github/workflows/test_code_generation.yml b/.github/workflows/test_code_generation.yml index d6cbe3d..9613dc1 100644 --- a/.github/workflows/test_code_generation.yml +++ b/.github/workflows/test_code_generation.yml @@ -24,14 +24,10 @@ jobs: with: python-version: "3.x" - - name: Install gsw - run: > - python -m pip install -r requirements-dev.txt - && python -m pip install -e . - - name: Test Code Generation run: > - git clone https://github.com/TEOS-10/GSW-C.git ../GSW-C + python -m pip install --group dev + && git clone https://github.com/TEOS-10/GSW-C.git ../GSW-C && git clone https://github.com/TEOS-10/GSW-Matlab.git ../GSW-Matlab && python tools/copy_from_GSW-C.py && python tools/mat2npz.py @@ -41,7 +37,7 @@ jobs: - name: Install gsw run: > - python -m pip install -v -e . --no-deps --no-build-isolation --force-reinstall + python -m pip install -e . && python -m pytest -s -rxs -v gsw/tests permissions: actions: none \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8c79f23..dd49e4a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [ "3.11", "3.12", "3.13", "3.14" ] + python-version: [ "3.11", "3.15-dev" ] os: [ windows-latest, ubuntu-latest, macos-latest ] fail-fast: false @@ -31,9 +31,8 @@ jobs: - name: Install gsw run: > - python -m pip install -r requirements-dev.txt + python -m pip install --group dev && python -m pip install -e . - && python -m pip install numpy${{ matrix.numpy-version }} - name: Tests run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 374492c..c368686 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,13 +20,13 @@ repos: - --ignore-words-list=nin,preformed,wih,pres, - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.29.3 + rev: v2.29.4 hooks: - id: pyproject-fmt - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.16.6 + rev: v0.16.7 hooks: - id: ruff diff --git a/pyproject.toml b/pyproject.toml index c189098..589f017 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Topic :: Scientific/Engineering", ] dynamic = [ @@ -30,6 +31,20 @@ dynamic = [ dependencies = [ "numpy>=2", ] + +[dependency-groups] +dev = [ + "dask", + "numpydoc", + "pandas>=2", + "prek", + "pytest", + "pytest-cov", + "scipy", + "sphinx", + "sphinx-rtd-theme", + "xarray", +] urls.documentation = "https://teos-10.github.io/GSW-Python/" urls.homepage = "https://www.teos-10.org/" urls.repository = "https://github.com/TEOS-10/GSW-python" diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 7b8d47a..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,9 +0,0 @@ -dask -numpydoc -pandas>=2 -pytest -scipy -setuptools_scm -sphinx -sphinx_rtd_theme -xarray \ No newline at end of file