Skip to content

Commit 42c0f2a

Browse files
authored
Migrating ARC to Python 14 (#867)
Bump the target runtime from 3.12 to 3.14 and modernize the codebase accordingly. - Update Python, Cython (≥3.1), and RDKit (≥2026.03) pins across environment.yml, requirements.txt, Dockerfile, and pyproject.toml - Fix stale check_python() gate that still referenced Python 3.7 / RMG-Py - Remove dead from __future__ import print_function and deprecated assertDictEqual - Replace deprecated typing generics with built-in equivalents (list, dict, X | None, X | Y, collections.abc) across 70+ files RMG's separate Python 3.9 environment for suprocess scripts (e.g. Arkane) is unchanged.
2 parents f30f9cc + 80cd5e7 commit 42c0f2a

101 files changed

Lines changed: 3004 additions & 3002 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ jobs:
9999
env:
100100
ARC_COVERAGE: 1
101101
CYTHON_TRACE: 1
102+
COVERAGE_CORE: ctrace
102103
run: |
103104
echo "Running Unit Tests..."
104105
export PYTHONPATH="${{ github.workspace }}/AutoTST:${{ github.workspace }}/KinBot:$PYTHONPATH"
@@ -110,6 +111,7 @@ jobs:
110111
env:
111112
ARC_COVERAGE: 1
112113
CYTHON_TRACE: 1
114+
COVERAGE_CORE: ctrace
113115
run: |
114116
echo "Running Functional Tests from $(pwd)..."
115117
export PYTHONPATH="${{ github.workspace }}/AutoTST:${{ github.workspace }}/KinBot:$PYTHONPATH"

.github/workflows/docker_build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ jobs:
5050
push: false
5151
load: true
5252
tags: arc:test
53+
build-args: |
54+
ARC_BRANCH=${{ github.head_ref || github.ref_name }}
5355
cache-from: type=gha
5456
cache-to: type=gha,mode=max
5557

.github/workflows/gh-pages.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,19 @@ jobs:
3737
with:
3838
environment-name: arc_env
3939
environment-file: ARC/environment.yml
40+
condarc: |
41+
channels:
42+
- conda-forge
43+
- danagroup
4044
cache-environment: true
45+
cache-environment-key: py314v3-arc-env
4146
cache-downloads: true
47+
generate-run-shell: true
4248

4349
# ── Complie ARC ──────────────────────
4450
- name: Build ARC in arc_env
45-
run: micromamba run -n arc_env make compile -C ARC -j"$(nproc)"
46-
47-
# ── Install pyrdl ──────────────────────
48-
- name: Install pyrdl
49-
run: micromamba run -n arc_env make install-pyrdl -C ARC -j"$(nproc)"
51+
run: make compile -C ARC -j"$(nproc)"
52+
shell: micromamba-shell {0}
5053

5154
# ── minimal TeX for png‑math in Sphinx ──────────────────────
5255
- name: System TeX tools
@@ -57,6 +60,12 @@ jobs:
5760
run: micromamba install -y -n arc_env -c conda-forge libgfortran=3
5861
shell: micromamba-shell {0}
5962

63+
# ── ensure ase is installed (the danagroup channel and/or
64+
# libgfortran install can cause the solver to drop ase)
65+
- name: Ensure ase is installed
66+
run: pip install "ase>=3.22.1" && python -c "import ase; print(f'ase {ase.__version__} OK')"
67+
shell: micromamba-shell {0}
68+
6069
# ── build HTML docs ─────────────────────────────────────────
6170
- name: Set env vars & Build docs
6271
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ examples/
3030

3131
# Unit test files
3232
.coverage
33+
.coverage.*
3334
testing/*
3435
htmlcov/*
3536
arc/testing/gcn_tst/

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ RUN micromamba run -n rmg_env bash -c "\
5555
"
5656

5757
WORKDIR /home/mambauser/Code/ARC
58-
RUN micromamba create -y -v -n arc_env python=3.12 -f environment.yml && \
58+
RUN micromamba create -y -v -n arc_env python=3.14 -c conda-forge -c danagroup -f environment.yml && \
5959
micromamba install -y -v -n arc_env -c conda-forge pytest && \
6060
micromamba clean --all -f -y
6161

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
DEVTOOLS_DIR := devtools
88

99
.PHONY: all help clean test test-unittests test-functional test-all \
10-
install-all install-ci install-pyrdl install-rmg install-rmgdb install-autotst install-gcn \
10+
install-all install-ci install-rmg install-rmgdb install-autotst install-gcn \
1111
install-gcn-cpu install-kinbot install-sella install-xtb install-torchani install-ob \
1212
lite check-env compile
1313

@@ -27,7 +27,6 @@ help:
2727
@echo "Installation:"
2828
@echo " install Install all external dependencies"
2929
@echo " install-ci Install all external dependencies for CI (no clean)"
30-
@echo " install-pyrdl Install PyRDL"
3130
@echo " install-rmg Install RMG (default: packaged, override via RMG_ARGS=...)"
3231
@echo " install-rmgdb Install RMG-database"
3332
@echo " install-autotst Install AutoTST"
@@ -73,9 +72,6 @@ install-lite:
7372
@echo "Installing ARC's lite version (no external dependencies)..."
7473
bash $(DEVTOOLS_DIR)/install_all.sh --no-ext --rmg-rms
7574

76-
install-pyrdl:
77-
bash $(DEVTOOLS_DIR)/install_pyrdl.sh
78-
7975
install-rmg:
8076
bash $(DEVTOOLS_DIR)/install_rmg.sh $(RMG_ARGS)
8177

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![codecov](https://codecov.io/gh/ReactionMechanismGenerator/ARC/branch/main/graph/badge.svg)](https://codecov.io/gh/ReactionMechanismGenerator/ARC)
55
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
66
![Release](https://img.shields.io/badge/version-1.1.0-blue.svg)
7+
![Python](https://img.shields.io/badge/python-3.14-blue.svg)
78
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3356849.svg)](https://doi.org/10.5281/zenodo.3356849)
89

910
<img src="https://github.com/ReactionMechanismGenerator/ARC/blob/main/logo/ARC-logo-small.jpg" alt="ARC logo" width="200"/>

arc/checks/common.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
import datetime
77

8-
from typing import List, Optional
9-
108
CONFORMER_JOB_TYPES = ('conf_opt', 'conf_sp')
119

1210

@@ -23,7 +21,7 @@ def is_conformer_job(job_name: str) -> bool:
2321
return job_name.startswith(CONFORMER_JOB_TYPES)
2422

2523

26-
def sum_time_delta(timedelta_list: List[datetime.timedelta]) -> datetime.timedelta:
24+
def sum_time_delta(timedelta_list: list[datetime.timedelta]) -> datetime.timedelta:
2725
"""
2826
A helper function for summing datetime.timedelta objects.
2927
@@ -40,15 +38,15 @@ def sum_time_delta(timedelta_list: List[datetime.timedelta]) -> datetime.timedel
4038
return result
4139

4240

43-
def get_i_from_job_name(job_name: str) -> Optional[int]:
41+
def get_i_from_job_name(job_name: str) -> int | None:
4442
"""
4543
Get the conformer or tsg index from the job name.
4644
4745
Args:
4846
job_name (str): The job name, e.g., 'conformer12' or 'tsg5'.
4947
5048
Returns:
51-
Optional[int]: The corresponding conformer or tsg index.
49+
int | None: The corresponding conformer or tsg index.
5250
"""
5351
i = None
5452
for prefix in CONFORMER_JOB_TYPES:

0 commit comments

Comments
 (0)