Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Python 3.12 and clean up ini files #114

Merged
merged 9 commits into from
Jun 26, 2024
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
23 changes: 20 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]",
Expand All @@ -56,6 +56,13 @@ jobs:
"git+https://github.com/pastas/[email protected]",
"git+https://github.com/pastas/pastas.git@dev",
]
exclude:
- python-version: "3.12"
pastas-version: "git+https://github.com/pastas/[email protected]"
- python-version: "3.12"
pastas-version: "git+https://github.com/pastas/[email protected]"
- python-version: "3.12"
pastas-version: "git+https://github.com/pastas/[email protected]"

steps:
- uses: actions/checkout@v4
Expand All @@ -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"

Expand Down
31 changes: 0 additions & 31 deletions mypy.ini

This file was deleted.

40 changes: 37 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand All @@ -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 = [
Expand Down Expand Up @@ -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
4 changes: 0 additions & 4 deletions pytest.ini

This file was deleted.

7 changes: 5 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down