Skip to content

Commit 7713896

Browse files
authored
Update Python in CI (#147)
1 parent 62dcd20 commit 7713896

5 files changed

Lines changed: 19 additions & 21 deletions

File tree

.github/workflows/flake8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
python-version: ["3.9", "3.10", "3.11", "3.12"]
16+
python-version: ["3.11", "3.12", "3.13", "3.14"]
1717

1818
steps:
1919
- uses: actions/checkout@v4

.github/workflows/mypy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
python-version: ["3.9", "3.10", "3.11", "3.12"]
16+
python-version: ["3.11", "3.12", "3.13", "3.14"]
1717

1818
steps:
1919
- uses: actions/checkout@v4

.github/workflows/pytest.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ jobs:
2323
runs-on: ${{ matrix.os }}
2424
strategy:
2525
matrix:
26-
os: [macOS-latest, ubuntu-latest, windows-latest]
27-
python-version: ["3.9", "3.10", "3.11", "3.12"]
26+
os: [macos-latest, ubuntu-latest, windows-latest]
27+
python-version: ["3.11", "3.12", "3.13", "3.14"]
2828
chemlib: [obabel, rdkit]
2929
graphlib: [nogt, all]
3030
exclude:
3131
# graph-tool does not work on Windows
3232
- {os: "windows-latest", graphlib: "all"}
3333
# Don't run without graph-tool on Ubuntu and macOS
3434
- {os: "ubuntu-latest", graphlib: "nogt"}
35-
- {os: "macOS-latest", graphlib: "nogt"}
36-
include:
37-
- {os: "macOS-14", graphlib: "all", chemlib: "obabel", python-version: "3.12"}
38-
- {os: "macOS-14", graphlib: "all", chemlib: "rdkit", python-version: "3.12"}
35+
- {os: "macos-latest", graphlib: "nogt"}
36+
# Open Babel has not been updated for Python 3.13 and 3.14
37+
- {chemlib: "obabel", python-version: "3.13"}
38+
- {chemlib: "obabel", python-version: "3.14"}
3939

4040
steps:
4141
- uses: actions/checkout@v4

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exclude: |
44
)$
55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.6.0
7+
rev: v6.0.0
88
hooks:
99
- id: check-json
1010
- id: check-merge-conflict
@@ -14,20 +14,20 @@ repos:
1414
- id: end-of-file-fixer
1515
- id: trailing-whitespace
1616
- repo: https://github.com/psf/black
17-
rev: 24.8.0
17+
rev: 25.12.0
1818
hooks:
1919
- id: black
2020
- repo: https://github.com/PyCQA/flake8
21-
rev: 7.1.1
21+
rev: 7.3.0
2222
hooks:
2323
- id: flake8
2424
- repo: https://github.com/PyCQA/isort
25-
rev: 5.13.2
25+
rev: 7.0.0
2626
hooks:
2727
- id: isort
2828
args: ["--profile", "black"]
2929
- repo: https://github.com/pre-commit/mirrors-mypy
30-
rev: v1.11.1
30+
rev: v1.19.1
3131
hooks:
3232
- id: mypy
3333
additional_dependencies: [types-requests]

spyrmsd/graphs/gt.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
# TODO: Implement all graph-tool supported types
17-
def _c_type(numpy_dtype):
17+
def _c_type(numpy_dtype: np.dtype) -> str:
1818
"""
1919
Get C type compatible with graph-tool from numpy dtype
2020
@@ -89,19 +89,17 @@ def graph_from_adjacency_matrix(
8989
warnings.warn(warn_disconnected_graph)
9090

9191
if aprops is not None:
92-
if not isinstance(aprops, np.ndarray):
93-
aprops = np.array(aprops)
92+
aprops_ = np.asarray(aprops)
93+
assert aprops_.shape[0] == num_vertices
9494

95-
assert aprops.shape[0] == num_vertices
96-
97-
ptype: str = _c_type(aprops.dtype) # Get C type
98-
vprop = G.new_vertex_property(ptype, vals=aprops) # Create property map
95+
ptype: str = _c_type(aprops_.dtype) # Get C type
96+
vprop = G.new_vertex_property(ptype, vals=aprops_) # Create property map
9997
G.vertex_properties["aprops"] = vprop # Set property map
10098

10199
return G
102100

103101

104-
def match_graphs(G1, G2) -> List[Tuple[List[int], List[int]]]:
102+
def match_graphs(G1, G2) -> List[Tuple[np.ndarray, np.ndarray]]:
105103
"""
106104
Compute graph isomorphisms.
107105

0 commit comments

Comments
 (0)