diff --git a/.github/workflows/python-package.yml b/.github/workflows/ci_tests.yml similarity index 72% rename from .github/workflows/python-package.yml rename to .github/workflows/ci_tests.yml index 2dd9427..ebce481 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/ci_tests.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: Python package +name: Tests for Aragog on: push: @@ -17,32 +17,41 @@ on: - ready_for_review workflow_dispatch: +permissions: + actions: write + contents: write + jobs: build: - runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12","3.13"] + python-version: ["3.11", "3.12","3.13"] + os: [ubuntu-latest, macos-latest] + + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 pytest + python -m pip install flake8 pytest pytest-cov pytest-dependency if [ -f pyproject.toml ]; then pip install .; fi + - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest - run: | - pytest + run: pytest --cov-report term --cov-report markdown-append:$GITHUB_STEP_SUMMARY --cov=aragog tests/ diff --git a/aragog/__init__.py b/aragog/__init__.py index ce8cccf..71a66cf 100644 --- a/aragog/__init__.py +++ b/aragog/__init__.py @@ -18,12 +18,12 @@ from __future__ import annotations -__version__: str = "25.10.27" +__version__: str = "26.01.06" import importlib.resources import logging import os -from importlib.abc import Traversable +from importlib.resources.abc import Traversable CFG_DATA: Traversable = importlib.resources.files(f"{__package__}.cfg") diff --git a/aragog/output.py b/aragog/output.py index 9563529..d61d8a7 100644 --- a/aragog/output.py +++ b/aragog/output.py @@ -181,7 +181,7 @@ def rheological_front(self) -> float: rf = self.evaluator.mesh.basic.radii[idx] # Return dimensionless rheological front - return (self.evaluator.mesh.basic.radii[-1] - rf) / self.evaluator.mesh.basic.radii[-1] + return ((self.evaluator.mesh.basic.radii[-1] - rf) / self.evaluator.mesh.basic.radii[-1]).item() @property def melt_fraction_global(self) -> float: diff --git a/pyproject.toml b/pyproject.toml index 49b6a6a..56e21fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,25 @@ -[tool.poetry] +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" + +[project] name = "fwl-aragog" -version = "25.10.27" +version = "26.01.06" +authors = [ + {name="Dan J. Bower", email="dbower@ethz.ch"}, + {name="Mariana Sastre", email="m.c.villamil.sastre@rug.nl"}, + {name="Laurent Soucasse", email="l.soucasse@esciencecenter.nl"}, + {name="Tim Lichtenberg", email="tim.lichtenberg@rug.nl"}, + {name="Harrison Nicholls", email="harrison.nicholls@physics.ox.ac.uk"}, + {name="Hanno Spreeuw", email="h.spreeuw@esciencecenter.nl"}, + {name="Robb Calder", email="rdc49@cam.ac.uk"}, +] description = "1-D interior dynamics of rocky mantles that are solid, liquid, or mixed phase" -authors = ["Dan J Bower "] license = "GPL-3.0-or-later" readme = "README.md" + + +[tool.poetry] packages = [ { include = "aragog" }, { include = "notebooks", to = "aragog" }, @@ -29,7 +44,10 @@ osfclient = "^0.0.5" zenodo_get = ">=1.6.0" [tool.poetry.group.test.dependencies] -pytest = "^7.4.4" +pytest = ">=8.1" +pytest-cov = ">=1.0.0" +pytest-dependency = ">=1.0.0" + [tool.poetry.extras] docs = [ @@ -42,6 +60,3 @@ docs = [ [tool.poetry.scripts] aragog = "aragog.cli:cli" -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" diff --git a/tests/conftest.py b/tests/conftest.py index b5b1eb5..eb32089 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -18,7 +18,7 @@ import importlib.resources from contextlib import AbstractContextManager -from importlib.abc import Traversable +from importlib.resources.abc import Traversable from pathlib import Path import pytest diff --git a/tests/test_phase.py b/tests/test_phase.py index 79d4bb5..fbdd8af 100644 --- a/tests/test_phase.py +++ b/tests/test_phase.py @@ -37,7 +37,7 @@ def test_version(): """Test version.""" - assert __version__ == "25.10.27" + assert __version__ == "26.01.06" def test_liquid_constant_properties(helper):