diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af5effd..3ecd45c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12"] pastas-version: [ "git+https://github.com/pastas/pastas.git@v0.22.0", @@ -56,6 +56,13 @@ jobs: "git+https://github.com/pastas/pastas.git@v1.5.0", "git+https://github.com/pastas/pastas.git@dev", ] + exclude: + - python-version: "3.12" + pastas-version: "git+https://github.com/pastas/pastas.git@v0.22.0" + - python-version: "3.12" + pastas-version: "git+https://github.com/pastas/pastas.git@v0.23.1" + - python-version: "3.12" + pastas-version: "git+https://github.com/pastas/pastas.git@v1.0.1" steps: - uses: actions/checkout@v4 @@ -67,18 +74,28 @@ jobs: cache: "pip" cache-dependency-path: pyproject.toml - - name: Install dependencies + - name: Install dependencies < PY312 + if: ${{ matrix.python-version != '3.12'}} run: | pip install --upgrade pip + pip install numpy pip install ${{ matrix.pastas-version }} pip install -e .[test] + - name: Install dependencies == PY312 + if: ${{ matrix.python-version == '3.12'}} + run: | + pip install --upgrade pip + pip install numpy + pip install ${{ matrix.pastas-version }} + pip install -e .[test_py312] + - name: Run pytest run: | pytest -m "not bgmap" - name: Test backgroundmap once - if: ${{ matrix.python-version == '3.9' && matrix.pastas-version == 'git+https://github.com/pastas/pastas.git@dev' }} + if: ${{ matrix.python-version == '3.11' && matrix.pastas-version == 'git+https://github.com/pastas/pastas.git@dev' }} run: | pytest -m "bgmap" diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index 5de3530..0000000 --- a/mypy.ini +++ /dev/null @@ -1,31 +0,0 @@ -[mypy] -python_version = 3.8 -warn_return_any = True -warn_unused_configs = True - -[mypy-setuptools.*] -ignore_missing_imports = True - -[mypy-pypandoc.*] -ignore_missing_imports = True - -[mypy-numpy.*] -ignore_missing_imports = True - -[mypy-pandas.*] -ignore_missing_imports = True - -[mypy-pystore.*] -ignore_missing_imports = True - -[mypy-arctic.*] -ignore_missing_imports = True - -[mypy-art_tools.*] -ignore_missing_imports = True - -[mypy-tqdm.*] -ignore_missing_imports = True - -[mypy-pastas.*] -ignore_missing_imports = True diff --git a/pyproject.toml b/pyproject.toml index 9bc50cb..48c7a70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,11 +30,10 @@ classifiers = [ "Operating System :: MacOS", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering :: Hydrology", ] @@ -58,7 +57,17 @@ test = [ "pytest-dependency", "pytest-benchmark", "codacy-coverage", - "lxml", +] +test_py312 = [ + "pastastore[lint,optional]", + "hydropandas[full]", + "coverage", + "codecov", + "pytest", + "pytest-cov", + "pytest-dependency", + "pytest-benchmark", + "codacy-coverage", ] arcticdb = ["arcticdb"] docs = [ @@ -97,3 +106,28 @@ select = [ [tool.ruff.lint.pydocstyle] convention = "numpy" + +[tool.pytest.ini_options] +addopts = "--durations=0 --cov-report xml:coverage.xml --cov pastastore -v" +markers = ["bgmap: test tile download for background map"] + +[tool.mypy] +python_version = "3.9" +warn_return_any = true +warn_unused_configs = true + +[[tool.mypy.overrides]] +module = [ + 'matplotlib.*', + 'scipy.stats.*', + 'mypy-setuptools.*', + 'mypy-pypandoc.*', + 'mypy-numpy.*', + 'mypy-pandas.*', + 'mypy-pystore.*', + 'mypy-arctic.*', + 'mypy-art_tools.*', + 'mypy-tqdm.*', + 'mypy-pastas.*', +] +ignore_missing_imports = true diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 159c6be..0000000 --- a/pytest.ini +++ /dev/null @@ -1,4 +0,0 @@ -[pytest] -addopts=--durations=0 --cov-report xml:coverage.xml --cov pastastore -v -markers = - bgmap: test tile download for background map diff --git a/tests/conftest.py b/tests/conftest.py index d7cd2b8..92f0eb3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,16 +1,19 @@ # ruff: noqa: D100 D103 import importlib from importlib import metadata +from platform import python_version -# import arcticdb_ext import pandas as pd import pastas as ps import pytest +from packaging.version import parse as parse_version import pastastore as pst +IS_PY312 = parse_version(python_version()) >= parse_version("3.12.0") + # "arctic" and "pystore" removed for CI, can be tested locally -params = ["dict", "pas", "arcticdb"] +params = ["dict", "pas", "arcticdb"] if not IS_PY312 else ["dict", "pas"] def initialize_project(conn):