Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ jobs:
- uses: actions/checkout@v3

- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@v16
uses: mamba-org/setup-micromamba@v1
with:
environment-file: false
environment-name: TEST
init-shell: bash
create-args: >-
python=3 numpy --file requirements-dev.txt --channel conda-forge

- name: Create environment
- name: Install gsw
shell: bash -l {0}
run: >
micromamba create --name TEST python=3 numpy --file requirements-dev.txt --channel conda-forge
&& micromamba activate TEST
&& pip install -e . --no-deps --force-reinstall
run: |
python -m pip install -e . --no-deps --force-reinstall

- name: Build documentation
shell: bash -l {0}
run: |
micromamba activate TEST
run: >
set -e
pushd docs
make clean html linkcheck
popd
&& pushd docs
&& make clean html linkcheck
&& popd

- name: GitHub Pages action
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
if: success() && github.event_name == 'release'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/tarball-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,16 @@ jobs:
- uses: actions/checkout@v3

- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@v16
uses: mamba-org/setup-micromamba@v1
with:
environment-file: false

- name: Create environment
shell: bash -l {0}
run: >
micromamba create --name TEST python=3 python-build numpy --file requirements-dev.txt --channel conda-forge
&& micromamba activate TEST
environment-name: TEST
init-shell: bash
create-args: >-
python=3 python-build numpy --file requirements-dev.txt --channel conda-forge

- name: Tarball
shell: bash -l {0}
run: >
micromamba activate TEST
&& python -m build --skip-dependency-check --sdist --wheel .
python -m build --skip-dependency-check --sdist --wheel .
&& check-manifest --verbose
&& twine check dist/*
32 changes: 16 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,39 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]
os: [windows-latest, ubuntu-latest, macos-latest]
# Oldest one based on NEP-29 and latest one.
# See https://numpy.org/neps/nep-0029-deprecation_policy.html
numpy-version: ["1.21", "1.23"]
numpy-version: ["1.22", "1.25"]
exclude:
- python-version: "3.11"
numpy-version: "1.21"
numpy-version: "1.22"
fail-fast: false

steps:
- uses: actions/checkout@v3

- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@v16
- name: Setup Micromamba Python ${{ matrix.python-version }} numpy ${{ matrix.numpy-version }}
uses: mamba-org/setup-micromamba@v1
with:
environment-file: false
environment-name: TEST
init-shell: bash
create-args: >-
python=${{ matrix.python-version }} python-build numpy=${{ matrix.numpy-version }} --file requirements-dev.txt --channel conda-forge

- name: Python ${{ matrix.python-version }} numpy ${{ matrix.numpy-version }}
- name: Install gsw
shell: bash -l {0}
run: >
micromamba create --name TEST python=${{ matrix.python-version }} python-build numpy=${{ matrix.numpy-version }} --file requirements-dev.txt --channel conda-forge
&& micromamba activate TEST
&& python -m pip install -e . --no-deps --no-build-isolation --force-reinstall
run: |
python -m pip install -e . --no-deps --force-reinstall

- name: Debug
shell: bash -l {0}
run: >
micromamba activate TEST
&& python -c "import numpy; print(f'Running numpy {numpy.__version__}')"
run: |
python -c "import numpy; print(f'Running numpy {numpy.__version__}')"

- name: Tests
shell: bash -l {0}
run: >
run: |
micromamba activate TEST
&& pytest -s -rxs -v gsw/tests
pytest -s -rxs -v gsw/tests
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: check-added-large-files

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.5
hooks:
- id: codespell
exclude: >
Expand All @@ -19,13 +19,13 @@ repos:
- --ignore-words-list=nin,preformed,wih,

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 0.9.2
rev: 0.12.1
hooks:
- id: pyproject-fmt


- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.260
rev: v0.0.274
hooks:
- id: ruff

Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ global-exclude *.so

exclude *.yml
exclude *.yaml
exclude *.enc
exclude .gitignore
exclude .isort.cfg
exclude .zenodo.json
6 changes: 2 additions & 4 deletions gsw/geostrophy.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,10 @@ def distance(lon, lat, p=0, axis=-1):
earth_radius = 6371e3

if not lon.shape == lat.shape:
raise ValueError('lon, lat shapes must match; found %s, %s'
% (lon.shape, lat.shape))
raise ValueError(f'lon, lat shapes must match; found {lon.shape}, {lat.shape}')
if not (lon.ndim in (1, 2) and lon.shape[axis] > 1):
raise ValueError('lon, lat must be 1-D or 2-D with more than one point'
' along axis; found shape %s and axis %s'
% (lon.shape, axis))
' along axis; found shape {} and axis {}'.format(lon.shape, axis))
if lon.ndim == 1:
one_d = True
# xarray requires expand_dims() rather than [newaxis, :]
Expand Down
46 changes: 23 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ authors = [
]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering",
]
dynamic = [
"readme",
Expand Down Expand Up @@ -58,18 +58,6 @@ write_to = "gsw/_version.py"
write_to_template = "__version__ = '{version}'"
tag_regex = "^(?P<prefix>v)?(?P<version>[^\\+]+)(?P<suffix>.*)?$"

[tool.check-manifest]
ignore = [
"*.yml",
".coveragerc",
"docs",
"docs/*",
"*.enc",
"tools",
"tools/*",
"gsw/_version.py",
]

[tool.ruff]
select = [
"A", # flake8-builtins
Expand Down Expand Up @@ -104,3 +92,15 @@ exclude = [
"gsw/_utilities.py" = [
"B904", # Within an ``except`` clause, raise exceptions with ``raise ... from err``
]

[tool.check-manifest]
ignore = [
"*.yml",
".coveragerc",
"docs",
"docs/*",
"*.enc",
"tools",
"tools/*",
"gsw/_version.py",
]