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
15 changes: 8 additions & 7 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,24 @@ jobs:
with:
fetch-depth: 0

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

- name: Build environment

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

- name: Build documentation
shell: bash -l {0}
run: |
set -e
micromamba activate TEST
pushd docs
make clean html linkcheck
popd
Expand Down
28 changes: 13 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,25 @@ jobs:
with:
fetch-depth: 0

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

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

run: |
python -m pip install -e . --no-deps --force-reinstall

- name: Tests
shell: bash -l {0}
run: >
micromamba activate TEST
&& python -m pytest -n 2 -rxs --cov=oceans tests
run: |
python -m pytest -n 2 -rxs --cov=oceans tests

- name: Doctests
shell: bash -l {0}
run: >
micromamba activate TEST
&& python -m pytest -vv oceans --doctest-modules
run: |
python -m pytest -vv oceans --doctest-modules
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
- id: blackdoc

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

Expand All @@ -39,18 +39,18 @@ repos:
language_version: python3

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.5
hooks:
- id: codespell
args:
- --ignore-words-list=pres

- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
rev: v2.5.1
hooks:
- id: add-trailing-comma

- repo: https://github.com/tox-dev/pyproject-fmt
rev: "0.11.2"
rev: "0.12.1"
hooks:
- id: pyproject-fmt
24 changes: 10 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ license = {file = "LICENSE.txt"}
maintainers = [
{name = "André Palóczy"},
{name = "Arnaldo Russo"},
{name = "Filipe Fernandes"},
{name = "Filipe Fernandes", email = "ocefpaf+oceans@gmail.com"},
]
requires-python = ">=3.8"
classifiers = [
Expand All @@ -25,16 +25,9 @@ classifiers = [
"Programming Language :: Python :: 3.11",
]
dynamic = [
"dependencies",
"version",
]
dependencies = [
"contourpy",
"gsw",
"matplotlib>=3.6",
"numpy>=1.20",
"pandas>=1.0.1",
"seawater",
]
[project.optional-dependencies]
extras = [
"cartopy",
Expand All @@ -53,18 +46,16 @@ packages = ["oceans"]
zip-safe = false
include-package-data = true

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

[tool.setuptools.package-data]
oceans = ["colormaps/cmap_data/*.dat"]

[tool.setuptools_scm]
write_to = "oceans/_version.py"
write_to_template = "__version__ = '{version}'"

[tool.pytest.ini_options]
markers = [
"web: marks tests require connection (deselect with '-m \"not web\"')"
]

[tool.ruff]
select = [
"A", # flake8-builtins
Expand All @@ -85,6 +76,11 @@ ignore = [
"docs/source/conf.py" = ["E402", "A001"]
"oceans/plotting.py" = ["T201"] # `print` found

[tool.pytest.ini_options]
markers = [
"web: marks tests require connection (deselect with '-m \"not web\"')"
]

[tool.interrogate]
ignore-init-method = true
ignore-init-module = false
Expand Down