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

Update python version to 3.13, other modernisation #166

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
616aa36
Merge branch 'conversion-from-csv-mp' into update-python
mikapfl Oct 23, 2024
3288dd5
Merge remote-tracking branch 'origin/conversion-from-csv' into update…
mikapfl Oct 23, 2024
ca8b2b0
Merge branch 'main' into update-python
mikapfl Oct 23, 2024
e7babfa
feat: add python 3.12, remove python 3.9. Also add liberal minimum ve…
mikapfl Oct 23, 2024
bd15662
test: add python 3.12 to tox testing
mikapfl Oct 23, 2024
22f8222
ci: add python 3.12, modernize setup
mikapfl Oct 23, 2024
a1779f4
ci: add strict minimum version requirements for test dependencies
mikapfl Oct 23, 2024
0b11d75
fix: correct pytest version
mikapfl Oct 23, 2024
e1639a8
fix: update networkx minimum version
mikapfl Oct 23, 2024
dd61010
fix: update networkx minimum version
mikapfl Oct 23, 2024
2088310
refactor: add minimum version for numpy using SPEC0
mikapfl Oct 23, 2024
3f47b5c
fix: update ruamel.yaml minimum version
mikapfl Oct 23, 2024
cb041d6
fix: update numpy minimum version
mikapfl Oct 23, 2024
af4ef8f
fix: update numpy minimum version
mikapfl Oct 23, 2024
4d73273
fix: update strictyaml minimum version
mikapfl Oct 23, 2024
cec48cb
fix: update strictyaml minimum version
mikapfl Oct 23, 2024
6bd0bcf
fix: update strictyaml minimum version
mikapfl Oct 23, 2024
f88e01e
fix: update natsort minimum version
mikapfl Oct 23, 2024
346990d
fix: update pyparsing minimum version
mikapfl Oct 23, 2024
b0fa0f0
fix: make target update-venv
mikapfl Oct 23, 2024
fda9c77
fix: update natsort minimum version for Python 3.12 on windows
mikapfl Oct 23, 2024
7eaa62a
fix: update natsort minimum version for Python 3.12 on windows
mikapfl Oct 23, 2024
e75da1c
feat: add python 3.13 to supported versions
mikapfl Oct 23, 2024
2fbb1ff
Merge branch 'main' into update-python
mikapfl Oct 23, 2024
8e771d5
fix: typo
mikapfl Oct 23, 2024
8be9333
ci: update uv version
mikapfl Oct 23, 2024
f9eaa96
fix: update minimum numpy version for python 3.13
mikapfl Oct 23, 2024
0bc42e0
fix: update minimum pandas version for python 3.13
mikapfl Oct 23, 2024
c8bd2d8
style: reorder requirements
mikapfl Oct 23, 2024
ff53d62
drop Python 3.10 support according to SPEC0
mikapfl Oct 23, 2024
e855536
docs: changelog
mikapfl Oct 23, 2024
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
48 changes: 33 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,55 @@ on:
pull_request:
push:
branches: [main]
workflow_dispatch: # allows you to trigger the workflow run manually

jobs:
test:
runs-on: ${{ matrix.os }}
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 }}
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions changelog_unreleased/166.trivial.rst
Original file line number Diff line number Diff line change
@@ -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.
32 changes: 18 additions & 14 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -63,6 +66,7 @@ dev =
networkx
xdoctest
tox
tox-uv>=1.11.3
unfccc_di_api >= 3.0.1
openscm-units
pycountry
Expand Down
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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