diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1eafd7..dba231d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,7 @@ on: pull_request: push: branches: [main] + workflow_dispatch: # allows you to trigger the workflow run manually jobs: test: @@ -11,30 +12,47 @@ jobs: strategy: matrix: os: [ ubuntu-latest, windows-latest ] - python-version: [ 3.9, "3.10", "3.11"] + python-version: [ "3.11", "3.12", "3.13" ] + resolution: [ "highest", "lowest-direct" ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + - name: Set up uv and caching + uses: astral-sh/setup-uv@v2 with: - python-version: ${{ matrix.python-version }} + enable-cache: true + cache-suffix: "${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.resolution }}" + cache-dependency-glob: "setup.cfg" + version: "0.4.25" - - uses: actions/cache@v2 - with: - path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }} + - name: Create venv + run: | + uv venv --seed --python ${{ matrix.python-version }} + + - name: Install ${{ matrix.resolution }} dependencies + run: | + uv pip install --resolution ${{ matrix.resolution }} .[test] - - name: Install dependencies + - name: Test with pytest (linux) + if: startsWith(matrix.os, 'ubuntu') run: | - python -m pip install --upgrade pip wheel - pip install --upgrade --upgrade-strategy eager .[test] + source .venv/bin/activate + pytest --xdoc --cov=climate_categories --cov-report=xml --junitxml=junit.xml -o junit_family=legacy - - name: Test with pytest + - name: Test with pytest (windows) + if: startsWith(matrix.os, 'windows') run: | - pytest --xdoc --cov=climate_categories --cov-report=xml + .venv\Scripts\activate + pytest --xdoc --cov=climate_categories --cov-report=xml --junitxml=junit.xml -o junit_family=legacy - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v4 with: files: ./coverage.xml + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/Makefile b/Makefile index 20774dc..5ea53ae 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,6 @@ venv: setup.py pyproject.toml setup.cfg update-venv: ## update all packages in the development environment [ -d venv ] || python3 -m venv venv - venv/bin/python .check_python_version.py venv/bin/python -m pip install --upgrade wheel uv . venv/bin/activate ; venv/bin/uv pip install --upgrade --resolution highest -e .[dev] touch venv diff --git a/changelog_unreleased/166.trivial.rst b/changelog_unreleased/166.trivial.rst new file mode 100644 index 0000000..8a77ed3 --- /dev/null +++ b/changelog_unreleased/166.trivial.rst @@ -0,0 +1,3 @@ +* Dropped support for Python 3.9 and 3.10. +* Added support for Python 3.12 and 3.13. +* Introduced minimum supported versions of dependencies. diff --git a/setup.cfg b/setup.cfg index 4c7f3dd..6bf31f8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,9 +16,9 @@ classifiers = License :: OSI Approved :: Apache Software License Natural Language :: English Programming Language :: Python :: 3 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 + Programming Language :: Python :: 3.13 license = Apache Software License 2.0 license_files = LICENSE @@ -28,24 +28,27 @@ packages = climate_categories.data climate_categories.tests climate_categories.tests.data -python_requires = >=3.9 +python_requires = >=3.11, <3.14 setup_requires = setuptools_scm install_requires = - networkx - pandas - strictyaml - natsort - ruamel.yaml - pyparsing - immutables - black + networkx>=3 + pandas>=2 + pandas>=2.2.2;python_version>="3.13" + strictyaml>=1.6 + natsort>=8 + ruamel.yaml>=0.17.2 + pyparsing>=3.1 + immutables>=0.20 + black>=22.1 + numpy>=1.26 + numpy>=2.1;python_version>="3.13" [options.extras_require] test = - pytest - pytest-cov - xdoctest + pytest>=8.3.3 + pytest-cov>=5 + xdoctest>=1.2 dev = pip tbump @@ -63,6 +66,7 @@ dev = networkx xdoctest tox + tox-uv>=1.11.3 unfccc_di_api >= 3.0.1 openscm-units pycountry diff --git a/tox.ini b/tox.ini index 902b646..301af87 100644 --- a/tox.ini +++ b/tox.ini @@ -4,12 +4,11 @@ # and then run "tox" from this directory. [tox] -envlist = py39, py310, py311 +envlist = py311, py312, py313 [testenv] deps = pytest xdoctest commands = - pip install -e . - pytest --xdoc -rx + pytest --xdoc -rx