Skip to content

Commit

Permalink
ci: support python 3.12 and test min dependencies on ci (#244)
Browse files Browse the repository at this point in the history
* ci: add 3.12 and test min reqs

* bump xsdata min

* bump min pydantic

* skip mypy on minreqs

* change env var test

* don't cover on min-reqs
  • Loading branch information
tlambert03 authored Feb 19, 2024
1 parent be6d8b3 commit 511c0e1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
platform: [ubuntu-latest, macos-latest, windows-latest]
include:
- python-version: "3.7"
Expand Down Expand Up @@ -82,6 +82,19 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

test-min-reqs:
name: Test min reqs
uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@main
with:
os: ubuntu-latest
python-version: ${{ matrix.python-version }}
pip-install-min-reqs: true
pytest-cov-flags: ""
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

test-widget:
name: test-widget
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_dependents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install .[test,dev]
python -m pip install .[test]
python -m pip install paquo
- name: Restore qupath cache
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install .[test,dev]
python -m pip install .[test]
python -m pip install omero-cli-transfer --no-deps
- name: Test
Expand Down
16 changes: 7 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dynamic = ["version"]
dependencies = [
"pydantic >=1.9.0",
"pydantic-compat >=0.1.0",
"xsdata >=23.5, <25", # >=23.6 necessary for codegen, but not for runtime
"xsdata >=23.6, <25",
"importlib_metadata; python_version < '3.8'",
]

Expand All @@ -48,24 +49,21 @@ ome-types = "ome_types:napari.yaml"
[project.optional-dependencies]
pint = ["Pint >=0.15"]
lxml = ["lxml >=4.8.0"]
dev = [
"black",
"ruff",
"xsdata[cli]>=23.6",
"mypy",
"pre-commit",
"types-lxml; python_version >= '3.8'",
]
dev = ["pre-commit", "types-lxml; python_version >= '3.8'"]
docs = ["mkdocs-material", "mkdocstrings-python"]
test = [
"black",
"lxml",
"mypy",
"numpy",
"pint",
"pytest-codspeed",
"pytest-cov",
"pytest-mypy-plugins",
"pytest",
"ruff",
"xmlschema <2.5", # FIXME: determine why
"xsdata[cli]",
]
test-qt = ["qtpy", "pytest-qt"]

Expand Down
4 changes: 3 additions & 1 deletion tests/test_autogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def test_autogen(tmp_path: Path, monkeypatch: MonkeyPatch) -> None:
"""
import ome_autogen.main

ome_autogen.main.build_model(output_dir=tmp_path, do_formatting=True, do_mypy=True)
# use this env-var skip mypy tests
mypy = os.getenv("MIN_REQS_TEST") not in {"1", "true", "True"}
ome_autogen.main.build_model(output_dir=tmp_path, do_formatting=True, do_mypy=mypy)

monkeypatch.delitem(sys.modules, "ome_types")
monkeypatch.delitem(sys.modules, "ome_types._autogenerated")
Expand Down

0 comments on commit 511c0e1

Please sign in to comment.