diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 2c3115bd..194088a2 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -12,47 +12,32 @@ jobs: strategy: matrix: platform: [windows-latest, macos-latest, ubuntu-latest] - python-version: ["3.12", "3.x"] + python-version: ["3.12", "3.14"] runs-on: ${{ matrix.platform }} steps: - name: Check out repository uses: actions/checkout@v7 - - name: Prepare python ${{ matrix.python-version }} - uses: actions/setup-python@v7 + - name: Install uv and python ${{ matrix.python-version }} + uses: astral-sh/setup-uv@v9.0.0 with: + enable-cache: true python-version: ${{ matrix.python-version }} - - name: Get pip cache directory - id: pip_cache_dir - run: | - echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT - shell: bash - - - name: Cache - uses: actions/cache@v6 - with: - path: ${{ steps.pip_cache_dir.outputs.dir }} - key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/.ci_pip_reqs.txt') }}-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.python-version }}- - - - name: Install dependencies - run: | - python -m pip install --upgrade pip wheel - pip install -r requirements-dev.txt - - name: Quality tests - run: tox -e quality + run: uvx pre-commit run --all-files if: matrix.platform == 'ubuntu-latest' - name: Unit tests - run: tox -e unit + run: | + uv sync --group ci + uv pip install "sympy>=1.12.1" + uv run --no-sync pytest --cov=petab --cov-report=xml --cov-append --durations=10 tests - name: Coverage uses: codecov/codecov-action@v7 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage.xml - if: matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.x' + if: matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.14' diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 71247855..46ea636b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,16 +16,11 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v7 - - name: Set up python - uses: actions/setup-python@v7 - with: - python-version: 3.x + - name: Install uv + uses: astral-sh/setup-uv@v9.0.0 - - name: Install dependencies / build sdist - run: | - python -m pip install --upgrade pip - pip install setuptools wheel build - python -m build -s + - name: Build sdist + run: uv build --sdist - name: Publish a Python distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/README.md b/README.md index 7888714e..455ea046 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ and the easiest way to install it is running pip3 install petab -`petab` requires Python>=3.11. We are following +`petab` requires Python>=3.12. We are following [NumPy's Python support policy](https://numpy.org/neps/nep-0029-deprecation_policy.html). Development versions of the PEtab library can be installed using diff --git a/doc/development.rst b/doc/development.rst index 181505a9..71b44d51 100644 --- a/doc/development.rst +++ b/doc/development.rst @@ -60,7 +60,7 @@ the pre-commit hooks, run: .. code-block:: bash - pip install pre-commit + uv tool install pre-commit pre-commit install To run the pre-commit checks manually on all, not just the modified files, run: @@ -85,6 +85,7 @@ To build the documentation, run: .. code-block:: bash + uv sync --extra doc --extra vis cd doc make html # then open `build/html/index.html` in a browser diff --git a/pyproject.toml b/pyproject.toml index d6dfccc9..981839ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,6 +84,18 @@ petab_visualize = "petab.v1.visualize.cli:_petab_visualize_main" Repository = "https://github.com/PEtab-dev/libpetab-python" Documentation = "https://petab.readthedocs.io/projects/libpetab-python/" +[dependency-groups] +ci = [ + "petab[tests,reports,combine,vis]", + "petabtests @ git+https://github.com/PEtab-dev/petab_test_suite@main", + "benchmark_models_petab @ git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master#subdirectory=src/python", +] + +[tool.uv] +# pysb<1.17 fails to build: its legacy `ez_setup.py` bootstrap downloads +# setuptools from a defunct pypi.python.org URL. +constraint-dependencies = ["pysb>=1.17.0"] + [tool.setuptools.packages.find] include = ["petab", "petab.*"] namespaces = false diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index cd043e47..00000000 --- a/requirements-dev.txt +++ /dev/null @@ -1 +0,0 @@ -tox >= 3.26.0 diff --git a/tox.ini b/tox.ini deleted file mode 100644 index ffeb503c..00000000 --- a/tox.ini +++ /dev/null @@ -1,38 +0,0 @@ -[tox] -envlist = quality,unit,doc -isolated_build = True - -[testenv] - -[testenv:quality] -extras = quality -commands = - pre-commit run --all-files -description = - Quality tests - -[testenv:unit] -extras = tests,reports,combine,vis -deps= - git+https://github.com/PEtab-dev/petab_test_suite@main - -e git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master\#subdirectory=src/python&egg=benchmark_models_petab - -commands = - python -m pip install sympy>=1.12.1 - python -m pytest --cov=petab --cov-report=xml --cov-append --durations=10 \ - tests -description = - Basic tests - -[testenv:doc] -description = Build the documentation -extras = doc,vis -deps= - # workaround for m2r2 issue with py3.13: No module named 'pkg_resources' - # see also: https://github.com/CrossNox/m2r2/issues/72 - setuptools -allowlist_externals = rm -commands = - rm -rf {tox_root}/doc/build - sphinx-build -W -b html . build/html -changedir = {tox_root}/doc