Skip to content

Commit

Permalink
[QMI-111] Remove support for Python 3.9 and add support for 3.12. (#112)
Browse files Browse the repository at this point in the history
* [QMI-111] Remove support for Python 3.9 and add support for 3.12.

* [QMI-111] CHANGELOG.md.

* [QMI-111] Updated Python versions also in `installation.rst` and `TESTING.md` and a couple of other updates on e.g. installation text and CI configuration files.

---------

Co-authored-by: Henri Ervasti <[email protected]>
  • Loading branch information
heevasti and Henri Ervasti authored Oct 17, 2024
1 parent 1713718 commit 6f19d2a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pull-request-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
max-parallel: 3
matrix:
python-version: ["3.9", "3.10"]
python-version: ["3.10", "3.11", "3.12"]

uses: ./.github/workflows/reusable-ci-workflows.yml
with:
Expand All @@ -37,7 +37,7 @@ jobs:
ref: ${{ inputs.ref }}

- name: Generate and push badges
if: ${{ matrix.python-version == '3.10' }}
if: ${{ matrix.python-version == '3.11' }}
run: |
pip install anybadge
anybadge -o -l pylint -v $(tail -n 2 pylint.log | grep -o '[0-9]\{1,2\}\.[0-9]\{2\}' | head -n 1) -f $BADGES_DIR/pylint.svg 2=red 4=orange 8=yellow 10=green
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scheduled-full-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
max-parallel: 1
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

uses: ./.github/workflows/reusable-ci-workflows.yml
with:
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sphinx:
build:
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.10"

python:
install:
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## \[x.y.z] - Unreleased

### Added
- Python 3.12 support

### Changed

### Fixed

### Removed
- Python 3.8 support, numpy and scipy version restrictions in dependencies.
- Python 3.8 and 3.9 support, numpy and scipy version restrictions in dependencies.


## [0.46.0] - 2024-10-14
Expand Down
15 changes: 8 additions & 7 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ In any case, both tools can be run from the command line:
Unit tests
----------

Unit tests are executed in the CI environment against different Python versions: 3.9 and 3.10. Code coverage of
Unit tests are executed in the CI environment against different Python versions: 3.10, 3.11 and 3.12. Code coverage of
the tests is computed using [Coverage.py](https://coverage.readthedocs.io/en/coverage-5.3.1/). To run the tests
locally, use:
```zsh
Expand All @@ -44,16 +44,18 @@ to the repository.

The pipelines are configured in `.github\workflows` and consists of four files:

1. github-ci.yml
2. pull_request.yml
3. schedule-full-ci-test-main.yml
4. python_publish.yml
1. push-ci.yml
2. pull_request-ci.yml
3. scheduled-full-ci.yml
4. pypi_publish.yml

with a support file `reusable-ci-workflows.yml`.

In the first three workflows, the following tests are performed:
- The code quality and maintainability analyses and unit-test coverage are performed, as these metrics are considered as quality indicators for the code base (which includes
tests).
- Unit-tests are performed and the coverage is calculated.
- On push to a branch, tests are executing only with Python 3.11. When changes are pushed to a pull request, the tests are rerun parallel also with Python 3.9 and 3.10. With the 3.10 version, the quality badges are created.
- On push to a branch, tests are executing only with Python 3.11. When changes are pushed to a pull request, the tests are rerun parallel also with Python 3.10, 3.11 and 3.12. With the 3.11 version, the quality badges are created.

The fourth workflow packages the source code into an installable Python package.

Expand All @@ -64,7 +66,6 @@ The following limits are defined for code quality and maintainability metrics:

- Pylint score: at least 9.0
- Mypy: 0 errors
- Cyclomatic complexity: at most 30
- Code coverage: at least 90%

If any of the metrics does not comply to the set thresholds, the corresponding job fails.
6 changes: 2 additions & 4 deletions documentation/sphinx/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@ While it is possible to install QMI by checking out the repository, for normal u

.. code-block:: shell
pip install git+https://github.com/QuTech-Delft/[email protected]#egg=qmi
Read the ``README.md`` of the project for more detailed installation procedure.
pip install qmi
------------
Dependencies
------------

.. rubric:: Python version

QMI depends on Python 3.9 or newer.
QMI depends on Python 3.10 or newer.

.. rubric:: Python packages

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def read(*names, **kwargs):
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"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 :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Scientific/Engineering :: Physics",
Expand All @@ -49,7 +49,7 @@ def read(*names, **kwargs):
keywords=[
# eg: 'keyword1', 'keyword2', 'keyword3',
],
python_requires=">=3.9, <4",
python_requires=">=3.10, <4",
install_requires=[
# For generating an installable package and deploying
"setuptools",
Expand Down

0 comments on commit 6f19d2a

Please sign in to comment.