Skip to content

Commit

Permalink
Merge pull request #46 from felixriese/prep-python312
Browse files Browse the repository at this point in the history
Prepare for Python 3.12 support
  • Loading branch information
felixriese committed Mar 23, 2024
2 parents a16f748 + 6fabb06 commit 4a913da
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 31 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/tests_and_linting.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
# Python versions need to be strings (otherwise: 3.10 -> 3.1)
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand All @@ -32,31 +32,31 @@ jobs:
run: |
pip list
- name: Lint with flake8 (with stopping)
if: ${{ matrix.python-version == '3.10' }}
if: ${{ matrix.python-version == '3.12' }}
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Lint with flake8 (without stopping)
if: ${{ matrix.python-version == '3.10' }}
if: ${{ matrix.python-version == '3.12' }}
run: |
# 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: Check formatting (black, isort)
if: ${{ matrix.python-version == '3.10' }}
if: ${{ matrix.python-version == '3.12' }}
run: |
black --check .
isort --check .
- name: Test with pytest
if: ${{ matrix.python-version != '3.10' }}
if: ${{ matrix.python-version != '3.12' }}
run: |
pytest --nbval
- name: Test with pytest and Codecov
if: ${{ matrix.python-version == '3.10' }}
if: ${{ matrix.python-version == '3.12' }}
run: |
pip install pytest-cov
pytest --nbval --cov=susi --cov-report=xml --cov-config .coveragerc
- name: Upload coverage to Codecov
if: ${{ matrix.python-version == '3.10' }}
if: ${{ matrix.python-version == '3.12' }}
uses: codecov/codecov-action@v1
with:
verbose: true
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Expand Up @@ -5,7 +5,7 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: no-commit-to-branch
args: ['--branch', 'main']
Expand All @@ -14,17 +14,17 @@ repos:
- id: detect-private-key
- id: check-merge-conflict
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 24.3.0
hooks:
- id: black
language_version: python3.10
language_version: python3.11
args: [--config=pyproject.toml]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
args: ["--ignore=E501,W503"]
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Expand Up @@ -3,7 +3,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.12"

sphinx:
configuration: docs/conf.py
6 changes: 6 additions & 0 deletions CHANGELOG.rst
@@ -1,6 +1,12 @@
Change Log
==========

[1.4.0] - 2024-XX-XX
--------------------
- [ADDED] Official support for Python 3.12.
- [REMOVED] Official support for Python 3.8 (will be deprecated in 10/2024). It might
still work, but will not be maintained on this version.

[1.3.0] - 2023-07-08
--------------------
- [ADDED] Official support for Python 3.11.
Expand Down
12 changes: 6 additions & 6 deletions dev-requirements.txt
Expand Up @@ -2,11 +2,11 @@
-r test-requirements.txt

# for the documentation
sphinx==7.0.1
sphinx-autobuild>=0.7.1
numpydoc==1.5.0
sphinx_rtd_theme==1.2.2
sphinx==7.2.6
sphinx-autobuild>=2024.2.4
numpydoc==1.6.0
sphinx_rtd_theme==2.0.0

# for linting
mypy==1.4.1
pre-commit==3.3.3
mypy==1.9.0
pre-commit==3.6.2
4 changes: 2 additions & 2 deletions meta.yaml
Expand Up @@ -18,11 +18,11 @@ build:
requirements:
host:
- pip
- python >=3.8
- python >=3.9
run:
- joblib >=0.13.0
- numpy >=1.18.5
- python >=3.8
- python >=3.9
- scikit-learn >=0.21.1
- scipy >=1.3.1
- tqdm >=4.45.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -40,10 +40,10 @@
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Education",
Expand Down
1 change: 1 addition & 0 deletions susi/SOMClassifier.py
@@ -1,4 +1,5 @@
"""SOMClassifier class."""

from typing import Optional, Sequence, Tuple, Union

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions susi/SOMUtils.py
@@ -1,4 +1,5 @@
"""SOMUtils functions."""

from typing import Sequence, Tuple

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions susi/__init__.py
Expand Up @@ -4,6 +4,7 @@
self-organizing maps (SOM).
"""

__version__ = "1.3.0"

from .SOMClassifier import SOMClassifier
Expand Down
18 changes: 9 additions & 9 deletions test-requirements.txt
@@ -1,9 +1,9 @@
black==23.7.0
codecov>=2.1.10
coverage>=5.3
flake8==6.0.0
isort==5.12.0
nbval>=0.9.5
pytest>=7.2.0
pytest-cov>=2.10.1
pytest_mock==3.11.1
black==24.3.0
codecov>=2.1.13
coverage>=7.4.4
flake8==7.0.0
isort==5.13.2
nbval>=0.11.0
pytest>=8.1.1
pytest-cov>=4.1.0
pytest_mock==3.14.0
1 change: 1 addition & 0 deletions tests/test_MultiOutput.py
Expand Up @@ -4,6 +4,7 @@
python -m pytest tests/test_MultiOutput.py
"""

import os
import sys

Expand Down
1 change: 1 addition & 0 deletions tests/test_SOMClassifier.py
Expand Up @@ -4,6 +4,7 @@
python -m pytest tests/test_SOMClassifier.py
"""

import itertools
import os
import sys
Expand Down
1 change: 1 addition & 0 deletions tests/test_SOMClustering.py
Expand Up @@ -4,6 +4,7 @@
python -m pytest tests/test_SOMClustering.py
"""

import os
import sys

Expand Down
1 change: 1 addition & 0 deletions tests/test_SOMEstimator.py
Expand Up @@ -4,6 +4,7 @@
python -m pytest tests/test_SOMEstimator.py
"""

import os
import sys

Expand Down
1 change: 1 addition & 0 deletions tests/test_SOMRegressor.py
Expand Up @@ -4,6 +4,7 @@
python -m pytest tests/test_SOMRegressor.py
"""

import itertools
import os
import sys
Expand Down

0 comments on commit 4a913da

Please sign in to comment.