Skip to content

Commit 7ef644f

Browse files
committed
Remove support of py3.9
Includes fix of linter error RUF007 and fixes the pre-commit hook generate-conda-environment that hardcoded the python version when generating the environment.yaml.
1 parent a062fb4 commit 7ef644f

File tree

9 files changed

+161
-1767
lines changed

9 files changed

+161
-1767
lines changed

.github/workflows/ci-code.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
python-version: ['3.9', '3.14']
29+
python-version: ['3.10', '3.14']
3030
database-backend: [psql]
3131

3232
services:
@@ -101,7 +101,7 @@ jobs:
101101
strategy:
102102
fail-fast: false
103103
matrix:
104-
python-version: ['3.9']
104+
python-version: ['3.10']
105105
database-backend: [sqlite]
106106

107107
services:
@@ -213,7 +213,7 @@ jobs:
213213
- name: Install aiida-core
214214
uses: ./.github/actions/install-aiida-core
215215
with:
216-
python-version: '3.9'
216+
python-version: '3.10'
217217
from-lock: 'true'
218218
extras: tests
219219

.github/workflows/docs-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Install aiida-core and docs deps
2424
uses: ./.github/actions/install-aiida-core
2525
with:
26-
python-version: '3.9'
26+
python-version: '3.10'
2727
extras: docs,tests,rest,atomic_tools
2828
from-lock: 'false'
2929

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
- name: Checkout repo
3131
uses: actions/checkout@v6
3232

33-
- name: Set up Python 3.9
33+
- name: Set up Python 3.10
3434
uses: actions/setup-python@v6
3535
with:
36-
python-version: '3.9'
36+
python-version: '3.10'
3737

3838
- name: Check tag
3939
run: python .github/workflows/check_release_tag.py $GITHUB_REF
@@ -95,10 +95,10 @@ jobs:
9595
steps:
9696
- name: Checkout source
9797
uses: actions/checkout@v6
98-
- name: Set up Python 3.9
98+
- name: Set up Python 3.10
9999
uses: actions/setup-python@v6
100100
with:
101-
python-version: '3.9'
101+
python-version: '3.10'
102102
- name: Install flit
103103
run: pip install flit~=3.4
104104
- name: Build
@@ -123,10 +123,10 @@ jobs:
123123
steps:
124124
- name: Checkout source
125125
uses: actions/checkout@v6
126-
- name: Set up Python 3.9
126+
- name: Set up Python 3.10
127127
uses: actions/setup-python@v6
128128
with:
129-
python-version: '3.9'
129+
python-version: '3.10'
130130
- name: Install flit
131131
run: pip install flit~=3.4
132132
- name: Build

.github/workflows/test-install.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ jobs:
8484
steps:
8585
- uses: actions/checkout@v6
8686

87-
- name: Set up Python 3.9
87+
- name: Set up Python 3.10
8888
uses: actions/setup-python@v6
8989
with:
90-
python-version: '3.9'
90+
python-version: '3.10'
9191

9292
- name: Pip install
9393
id: pip_install
@@ -111,7 +111,7 @@ jobs:
111111
fail-fast: false
112112
matrix:
113113

114-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
114+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
115115

116116
# Not being able to install with conda on a specific Python version is
117117
# not sufficient to fail the run, but something we want to be aware of.
@@ -165,7 +165,7 @@ jobs:
165165
strategy:
166166
fail-fast: false
167167
matrix:
168-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
168+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
169169

170170
services:
171171
postgres:

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ channels:
55
- conda-forge
66
- defaults
77
dependencies:
8-
- python~=3.9
8+
- python>=3.10
99
- alembic~=1.8
1010
- archive-path~=0.4.2
1111
- asyncssh~=2.21.0

pyproject.toml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ classifiers = [
1818
'Operating System :: POSIX :: Linux',
1919
'Operating System :: MacOS :: MacOS X',
2020
'Programming Language :: Python',
21-
'Programming Language :: Python :: 3.9',
2221
'Programming Language :: Python :: 3.10',
2322
'Programming Language :: Python :: 3.11',
2423
'Programming Language :: Python :: 3.12',
@@ -69,7 +68,7 @@ keywords = ['aiida', 'workflows']
6968
license = {file = 'LICENSE.txt'}
7069
name = 'aiida-core'
7170
readme = 'README.md'
72-
requires-python = '>=3.9'
71+
requires-python = '>=3.10'
7372

7473
[project.entry-points.'aiida.brokers']
7574
'core.rabbitmq' = 'aiida.brokers.rabbitmq.broker:RabbitmqBroker'
@@ -496,33 +495,32 @@ envlist = py39
496495
[testenv]
497496
usedevelop=True
498497
deps =
499-
py39: -rrequirements/requirements-py-3.9.txt
500498
py310: -rrequirements/requirements-py-3.10.txt
501499
py311: -rrequirements/requirements-py-3.11.txt
502500
py312: -rrequirements/requirements-py-3.12.txt
503501
504-
[testenv:py{39,310,311,312}-presto]
502+
[testenv:py{310,311,312}-presto]
505503
passenv =
506504
PYTHONASYNCIODEBUG
507505
setenv =
508506
AIIDA_WARN_v3 =
509507
commands = pytest -m 'presto' {posargs}
510508
511-
[testenv:py{39,310,311,312}]
509+
[testenv:py{310,311,312}]
512510
passenv =
513511
PYTHONASYNCIODEBUG
514512
setenv =
515513
AIIDA_WARN_v3 =
516514
commands = pytest {posargs}
517515
518-
[testenv:py{39,310,311,312}-verdi]
516+
[testenv:py{310,311,312}-verdi]
519517
passenv =
520518
AIIDA_TEST_BACKEND
521519
setenv =
522520
AIIDA_PATH = {toxinidir}/.tox/.aiida
523521
commands = verdi {posargs}
524522
525-
[testenv:py{39,310,311,312}-docs-{clean,update}]
523+
[testenv:py{310,311,312}-docs-{clean,update}]
526524
description =
527525
clean: Build the documentation (remove any existing build)
528526
update: Build the documentation (modify any existing build)
@@ -535,11 +533,10 @@ commands =
535533
clean: make clean
536534
make debug
537535
538-
[testenv:py{39,310,311,312}-docs-live]
536+
[testenv:py{310,311,312}-docs-live]
539537
# tip: remove apidocs before using this feature (`cd docs; make clean`)
540538
description = Build the documentation and launch browser (with live updates)
541539
deps =
542-
py39: -rrequirements/requirements-py-3.9.txt
543540
py310: -rrequirements/requirements-py-3.10.txt
544541
py311: -rrequirements/requirements-py-3.11.txt
545542
py312: -rrequirements/requirements-py-3.12.txt

src/aiida/orm/nodes/data/array/bands.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
in a Brillouin zone, and how to operate on them.
1111
"""
1212

13+
import itertools
1314
import json
1415
import typing as t
1516
from string import Template
@@ -493,7 +494,7 @@ def _get_bandplot_data(self, cartesian, prettify_format=None, join_symbol=None,
493494
# I add an empty label that points to the last band if the last label does not do it
494495
if labels[-1][0] != len(bands) - 1:
495496
labels.append((len(bands) - 1, ''))
496-
for (position_from, label_from), (position_to, label_to) in zip(labels[:-1], labels[1:]):
497+
for (position_from, label_from), (position_to, label_to) in itertools.pairwise(labels):
497498
if position_to - position_from > 1:
498499
# Create a new path line only if there are at least two points,
499500
# otherwise it is probably just a discontinuity point in the band

utils/dependency_management.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ def generate_environment_yml():
131131
# python version cannot be overriden from outside environment.yml
132132
# (even if it is not specified at all in environment.yml)
133133
# https://github.com/conda/conda/issues/9506
134-
conda_requires = ['python~=3.9']
134+
python_requires = pyproject['project']['requires-python']
135+
conda_requires = [f'python{python_requires}']
135136
for req in install_requirements:
136137
if req.name == 'python' or any(re.match(ignore, str(req)) for ignore in CONDA_IGNORE):
137138
continue

0 commit comments

Comments
 (0)