Skip to content

Commit

Permalink
Merge pull request #33 from seareport/fix-deps
Browse files Browse the repository at this point in the history
[ci] fix deps
  • Loading branch information
tomsail authored May 20, 2024
2 parents 458f565 + 27464ed commit 08556cd
Show file tree
Hide file tree
Showing 9 changed files with 467 additions and 1,242 deletions.
31 changes: 7 additions & 24 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,63 +12,46 @@ on:
- "pyproject.toml"
- "poetry.lock"
- "requirements/requirements*.txt"
- "requirements/requirements-dask.txt"
pull_request:
paths:
- "**.py"
- ".github/workflows/*test*.yml"
- "pyproject.toml"
- "poetry.lock"
- "requirements/requirements*.txt"
- "requirements/requirements-dask.txt"

jobs:
test:
name: "test Python ${{ matrix.python }} on ${{ matrix.os }} with Dask ${{ matrix.dask }}"
name: "test Python ${{ matrix.python }} on ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python: ["3.9", "3.10", "3.11"]
dask: [true, false]
include:
- os: "macos-latest"
python-version: "3.10"
dask: false
python: "3.10"
defaults:
run:
shell: "bash -eo pipefail {0}"

steps:
- uses: "actions/checkout@main"
- uses: "actions/setup-python@main"
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python }}"
- uses: "actions/cache@main"
- uses: "actions/cache@v2"
id: "cache"
with:
path: "${{ env.pythonLocation }}"
key: "test-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements/*') }}"
- run: "python --version"
- run: "python -mpip install -U pip"
- run: "python -mpip --version"
- run: "python -mpip install -r requirements/requirements.txt"
- name: "Install Dask requirements"
if: matrix.dask
run: "python -mpip install -r requirements/requirements-dask.txt"
- run: "python -mpip install -r requirements/requirements-dev.txt"
- run: "python -mpip install ./"
- run: "python -mpip cache info"
- run: "python -mpip freeze"
- run: "pytest --version"
if: "(matrix.os == 'ubuntu-latest') && (matrix.python == '3.11' )"
- name: "Run tests with Dask"
if: matrix.dask
run: "pytest tests/"
env:
PYTHONPATH: ${{ github.workspace }}/tests
- name: "Run tests without Dask"
if: "!matrix.dask"
- name: "Run tests"
run: "pytest tests/"
env:
PYTHONPATH: ${{ github.workspace }}/tests
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ repos:
"requirements/requirements.txt",
]
- id: "poetry-export"
name: "poetry export dask"
name: "poetry export dev"
args:
[
"--with",
"dask",
"dev",
"-f",
"requirements.txt",
"-o",
"requirements/requirements-dask.txt",
"requirements/requirements-dev.txt",
]
905 changes: 129 additions & 776 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,16 @@ include = [
[tool.poetry.dependencies]
python = ">=3.9"
numpy = "*"
pytest = "*"
scipy = "*"
shapely = "*"
xarray = "*"
netcdf4 = "*"

[tool.poetry.group.dask.dependencies]
dask = "*"

[tool.poetry.plugins."xarray.backends"]
selafin = "xarray_selafin.xarray_backend:SelafinBackendEntrypoint"

[tool.poetry.group.dev.dependencies]
matplotlib = "*"
pytest = "*"

[build-system]
requires = ["poetry-core"]
Expand Down
302 changes: 0 additions & 302 deletions requirements/requirements-dask.txt

This file was deleted.

221 changes: 221 additions & 0 deletions requirements/requirements-dev.txt

Large diffs are not rendered by default.

229 changes: 104 additions & 125 deletions requirements/requirements.txt

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ license_files = LICENSE
python_requires = >=3.9
install_requires =
numpy
pytest
scipy
shapely
xarray
Expand All @@ -24,10 +23,8 @@ packages = find:
xarray_selafin = data/*, variable/*

[options.extras_require]
dask =
dask
dev =
matplotlib
pytest

[options.entry_points]
xarray.backends =
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@
},
install_requires=[
"numpy",
"pytest",
"scipy",
"shapely",
"xarray",
"netcdf4",
],
extras_require={
"dask": ["dask"],
"dev": [
"matplotlib"
"pytest"
], # Assuming netcdf4 is listed intentionally in both main and dev dependencies
},
entry_points={
Expand Down

0 comments on commit 08556cd

Please sign in to comment.