Skip to content

Commit 2037d14

Browse files
authored
Merge pull request #139 from ocefpaf/update_umamba_GHA
Update umamba gha
2 parents 31615d7 + 850e85a commit 2037d14

7 files changed

Lines changed: 63 additions & 70 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,28 @@ jobs:
1414
- uses: actions/checkout@v3
1515

1616
- name: Setup Micromamba
17-
uses: mamba-org/provision-with-micromamba@v16
17+
uses: mamba-org/setup-micromamba@v1
1818
with:
19-
environment-file: false
19+
environment-name: TEST
20+
init-shell: bash
21+
create-args: >-
22+
python=3 numpy --file requirements-dev.txt --channel conda-forge
2023
21-
- name: Create environment
24+
- name: Install gsw
2225
shell: bash -l {0}
23-
run: >
24-
micromamba create --name TEST python=3 numpy --file requirements-dev.txt --channel conda-forge
25-
&& micromamba activate TEST
26-
&& pip install -e . --no-deps --force-reinstall
26+
run: |
27+
python -m pip install -e . --no-deps --force-reinstall
2728
2829
- name: Build documentation
2930
shell: bash -l {0}
30-
run: |
31-
micromamba activate TEST
31+
run: >
3232
set -e
33-
pushd docs
34-
make clean html linkcheck
35-
popd
33+
&& pushd docs
34+
&& make clean html linkcheck
35+
&& popd
3636
3737
- name: GitHub Pages action
38-
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
38+
if: success() && github.event_name == 'release'
3939
uses: peaceiris/actions-gh-pages@v3
4040
with:
4141
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tarball-tests.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,16 @@ jobs:
1212
- uses: actions/checkout@v3
1313

1414
- name: Setup Micromamba
15-
uses: mamba-org/provision-with-micromamba@v16
15+
uses: mamba-org/setup-micromamba@v1
1616
with:
17-
environment-file: false
18-
19-
- name: Create environment
20-
shell: bash -l {0}
21-
run: >
22-
micromamba create --name TEST python=3 python-build numpy --file requirements-dev.txt --channel conda-forge
23-
&& micromamba activate TEST
17+
environment-name: TEST
18+
init-shell: bash
19+
create-args: >-
20+
python=3 python-build numpy --file requirements-dev.txt --channel conda-forge
2421
2522
- name: Tarball
2623
shell: bash -l {0}
2724
run: >
28-
micromamba activate TEST
29-
&& python -m build --skip-dependency-check --sdist --wheel .
25+
python -m build --skip-dependency-check --sdist --wheel .
3026
&& check-manifest --verbose
3127
&& twine check dist/*

.github/workflows/tests.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,39 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
python-version: ["3.8", "3.9", "3.10", "3.11"]
13+
python-version: ["3.9", "3.10", "3.11"]
1414
os: [windows-latest, ubuntu-latest, macos-latest]
1515
# Oldest one based on NEP-29 and latest one.
1616
# See https://numpy.org/neps/nep-0029-deprecation_policy.html
17-
numpy-version: ["1.21", "1.23"]
17+
numpy-version: ["1.22", "1.25"]
1818
exclude:
1919
- python-version: "3.11"
20-
numpy-version: "1.21"
20+
numpy-version: "1.22"
2121
fail-fast: false
2222

2323
steps:
2424
- uses: actions/checkout@v3
2525

26-
- name: Setup Micromamba
27-
uses: mamba-org/provision-with-micromamba@v16
26+
- name: Setup Micromamba Python ${{ matrix.python-version }} numpy ${{ matrix.numpy-version }}
27+
uses: mamba-org/setup-micromamba@v1
2828
with:
29-
environment-file: false
29+
environment-name: TEST
30+
init-shell: bash
31+
create-args: >-
32+
python=${{ matrix.python-version }} python-build numpy=${{ matrix.numpy-version }} --file requirements-dev.txt --channel conda-forge
3033
31-
- name: Python ${{ matrix.python-version }} numpy ${{ matrix.numpy-version }}
34+
- name: Install gsw
3235
shell: bash -l {0}
33-
run: >
34-
micromamba create --name TEST python=${{ matrix.python-version }} python-build numpy=${{ matrix.numpy-version }} --file requirements-dev.txt --channel conda-forge
35-
&& micromamba activate TEST
36-
&& python -m pip install -e . --no-deps --no-build-isolation --force-reinstall
36+
run: |
37+
python -m pip install -e . --no-deps --force-reinstall
3738
3839
- name: Debug
3940
shell: bash -l {0}
40-
run: >
41-
micromamba activate TEST
42-
&& python -c "import numpy; print(f'Running numpy {numpy.__version__}')"
41+
run: |
42+
python -c "import numpy; print(f'Running numpy {numpy.__version__}')"
4343
4444
- name: Tests
4545
shell: bash -l {0}
46-
run: >
46+
run: |
4747
micromamba activate TEST
48-
&& pytest -s -rxs -v gsw/tests
48+
pytest -s -rxs -v gsw/tests

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repos:
77
- id: check-added-large-files
88

99
- repo: https://github.com/codespell-project/codespell
10-
rev: v2.2.4
10+
rev: v2.2.5
1111
hooks:
1212
- id: codespell
1313
exclude: >
@@ -19,13 +19,13 @@ repos:
1919
- --ignore-words-list=nin,preformed,wih,
2020

2121
- repo: https://github.com/tox-dev/pyproject-fmt
22-
rev: 0.9.2
22+
rev: 0.12.1
2323
hooks:
2424
- id: pyproject-fmt
2525

2626

2727
- repo: https://github.com/charliermarsh/ruff-pre-commit
28-
rev: v0.0.260
28+
rev: v0.0.274
2929
hooks:
3030
- id: ruff
3131

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ global-exclude *.so
1515

1616
exclude *.yml
1717
exclude *.yaml
18-
exclude *.enc
1918
exclude .gitignore
2019
exclude .isort.cfg
2120
exclude .zenodo.json

gsw/geostrophy.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,10 @@ def distance(lon, lat, p=0, axis=-1):
176176
earth_radius = 6371e3
177177

178178
if not lon.shape == lat.shape:
179-
raise ValueError('lon, lat shapes must match; found %s, %s'
180-
% (lon.shape, lat.shape))
179+
raise ValueError(f'lon, lat shapes must match; found {lon.shape}, {lat.shape}')
181180
if not (lon.ndim in (1, 2) and lon.shape[axis] > 1):
182181
raise ValueError('lon, lat must be 1-D or 2-D with more than one point'
183-
' along axis; found shape %s and axis %s'
184-
% (lon.shape, axis))
182+
' along axis; found shape {} and axis {}'.format(lon.shape, axis))
185183
if lon.ndim == 1:
186184
one_d = True
187185
# xarray requires expand_dims() rather than [newaxis, :]

pyproject.toml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ authors = [
1818
]
1919
requires-python = ">=3.8"
2020
classifiers = [
21-
"Development Status :: 5 - Production/Stable",
22-
"Intended Audience :: Science/Research",
23-
"Operating System :: OS Independent",
24-
"License :: OSI Approved :: BSD License",
25-
"Programming Language :: Python",
26-
"Programming Language :: Python :: 3",
27-
"Programming Language :: Python :: 3.8",
28-
"Programming Language :: Python :: 3.9",
29-
"Programming Language :: Python :: 3.10",
30-
"Programming Language :: Python :: 3.11",
31-
"Topic :: Scientific/Engineering",
21+
"Development Status :: 5 - Production/Stable",
22+
"Intended Audience :: Science/Research",
23+
"License :: OSI Approved :: BSD License",
24+
"Operating System :: OS Independent",
25+
"Programming Language :: Python",
26+
"Programming Language :: Python :: 3 :: Only",
27+
"Programming Language :: Python :: 3.8",
28+
"Programming Language :: Python :: 3.9",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
"Topic :: Scientific/Engineering",
3232
]
3333
dynamic = [
3434
"readme",
@@ -58,18 +58,6 @@ write_to = "gsw/_version.py"
5858
write_to_template = "__version__ = '{version}'"
5959
tag_regex = "^(?P<prefix>v)?(?P<version>[^\\+]+)(?P<suffix>.*)?$"
6060

61-
[tool.check-manifest]
62-
ignore = [
63-
"*.yml",
64-
".coveragerc",
65-
"docs",
66-
"docs/*",
67-
"*.enc",
68-
"tools",
69-
"tools/*",
70-
"gsw/_version.py",
71-
]
72-
7361
[tool.ruff]
7462
select = [
7563
"A", # flake8-builtins
@@ -104,3 +92,15 @@ exclude = [
10492
"gsw/_utilities.py" = [
10593
"B904", # Within an ``except`` clause, raise exceptions with ``raise ... from err``
10694
]
95+
96+
[tool.check-manifest]
97+
ignore = [
98+
"*.yml",
99+
".coveragerc",
100+
"docs",
101+
"docs/*",
102+
"*.enc",
103+
"tools",
104+
"tools/*",
105+
"gsw/_version.py",
106+
]

0 commit comments

Comments
 (0)