Skip to content

Commit c029aa6

Browse files
authored
Add support for python 3.12 (#135)
1 parent ee8cb75 commit c029aa6

File tree

8 files changed

+27
-16
lines changed

8 files changed

+27
-16
lines changed

.github/workflows/deploy-pypi.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python-version: ["3.8", "3.9", "3.10", "3.11"]
15+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1616
os: [ubuntu-latest, macOS-latest, windows-latest]
1717
steps:
1818
- uses: actions/checkout@v2
@@ -26,7 +26,9 @@ jobs:
2626
python -m pip install -e ".[dev]"
2727
- name: Test with pytest
2828
run: |
29-
pytest -v --flake8 --pydocstyle --cov=hiclass --cov-fail-under=90 --cov-report html
29+
flake8
30+
pydocstyle hiclass tests
31+
pytest -v --cov=hiclass --cov-fail-under=90 --cov-report html
3032
coverage xml
3133
- name: Upload Coverage to Codecov
3234
if: matrix.os == 'ubuntu-latest'

.github/workflows/test-pr.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
python-version: ["3.8", "3.9", "3.10", "3.11"]
16+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1717
os: [ubuntu-latest, macOS-latest, windows-latest]
1818
steps:
1919
- uses: actions/checkout@v2
@@ -27,7 +27,9 @@ jobs:
2727
python -m pip install -e ".[dev]"
2828
- name: Test with pytest
2929
run: |
30-
pytest -v --flake8 --pydocstyle --cov=hiclass --cov-fail-under=90 --cov-report html
30+
flake8
31+
pydocstyle hiclass tests
32+
pytest -v --cov=hiclass --cov-fail-under=90 --cov-report html
3133
coverage xml
3234
- name: Upload Coverage to Codecov
3335
uses: codecov/codecov-action@v2

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,12 @@ repos:
99
rev: 24.2.0
1010
hooks:
1111
- id: black
12+
- repo: https://github.com/pycqa/flake8
13+
rev: 7.1.1
14+
hooks:
15+
- id: flake8
16+
- repo: https://github.com/pycqa/pydocstyle
17+
rev: 6.3.0
18+
hooks:
19+
- id: pydocstyle
20+
files: ^hiclass/

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pip install -e ".[dev]"
1919
To run the tests simply execute:
2020

2121
```
22-
pytest -v --flake8 --pydocstyle --cov=hiclass --cov-fail-under=90 --cov-report html
22+
pytest -v --cov=hiclass --cov-fail-under=90 --cov-report html
2323
```
2424

2525
Lastly, you can set up the git hooks scripts to fix formatting errors locally during commits:

hiclass/HierarchicalClassifier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ def _fit_node_classifier(
443443
self, nodes, local_mode: bool = False, use_joblib: bool = False
444444
):
445445
def logging_wrapper(func, idx, node, node_length):
446-
self.logger_.info(f"fitting node {idx+1}/{node_length}: {str(node)}")
446+
self.logger_.info(f"fitting node {idx + 1}/{node_length}: {str(node)}")
447447
return func(self, node)
448448

449449
if self.n_jobs > 1:
@@ -481,7 +481,7 @@ def _fit_node_calibrator(
481481
self, nodes, local_mode: bool = False, use_joblib: bool = False
482482
):
483483
def logging_wrapper(func, idx, node, node_length):
484-
self.logger_.info(f"calibrating node {idx+1}/{node_length}: {str(node)}")
484+
self.logger_.info(f"calibrating node {idx + 1}/{node_length}: {str(node)}")
485485
return func(self, node)
486486

487487
if self.n_jobs > 1:

hiclass/LocalClassifierPerLevel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def _fit_digraph(self, local_mode: bool = False, use_joblib: bool = False):
350350
self.logger_.info("Fitting local classifiers")
351351

352352
def logging_wrapper(func, level, separator, max_level):
353-
self.logger_.info(f"fitting level {level+1}/{max_level}")
353+
self.logger_.info(f"fitting level {level + 1}/{max_level}")
354354
return func(self, level, separator)
355355

356356
if self.n_jobs > 1:
@@ -395,7 +395,7 @@ def _calibrate_digraph(self, local_mode: bool = False, use_joblib: bool = False)
395395
self.logger_.info("Fitting local calibrators")
396396

397397
def logging_wrapper(func, level, separator, max_level):
398-
self.logger_.info(f"calibrating level {level+1}/{max_level}")
398+
self.logger_.info(f"calibrating level {level + 1}/{max_level}")
399399
return func(self, level, separator)
400400

401401
if self.n_jobs > 1:

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ exclude = **/__init__.py, docs/source/conf.py
1414
;file.py: error
1515

1616
[requires]
17-
python_version = ">=3.8,<3.12"
17+
python_version = ">=3.8,<3.13"
1818

1919
# See the docstring in versioneer.py for instructions. Note that you must
2020
# re-run 'versioneer.py setup' after changing this section, and commit the

setup.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
URL_ISSUES = "https://github.com/scikit-learn-contrib/hiclass/issues"
2424
2525
AUTHOR = "Fabio Malcher Miranda, Niklas Koehnecke"
26-
REQUIRES_PYTHON = ">=3.8,<3.12"
26+
REQUIRES_PYTHON = ">=3.8,<3.13"
2727
KEYWORDS = ["hierarchical classification"]
2828
DACS_SOFTWARE = "https://gitlab.com/dacs-hpi"
2929
# What packages are required for this module to be executed?
@@ -35,11 +35,9 @@
3535
"ray": ["ray>=1.11.0"],
3636
"xai": ["shap==0.44.1", "xarray==2023.1.0"],
3737
"dev": [
38-
"flake8==4.0.1",
39-
"pytest==7.1.2",
40-
"pytest-flake8==1.1.1",
41-
"pydocstyle==6.1.1",
42-
"pytest-pydocstyle==2.3.0",
38+
"flake8",
39+
"pytest",
40+
"pydocstyle",
4341
"pytest-cov==3.0.0",
4442
"pyfakefs==5.3.5",
4543
"black==24.2.0",

0 commit comments

Comments
 (0)