Skip to content

Commit 7ada291

Browse files
committed
Dependencies: Make installing plugin packages optional
Installing all plugin packages is quite costly and most users are not likely to want to use all codes. Therefore, an optional requirement is created for each code that implements the common workflow interface. To make it easy to still install all plugin packages, the `all_plugins` optional requirement group adds the union of all the plugin optional requirements. The downside is that this requires duplicating the requirements and risks getting out of sync. Built in `[all]` support was proposed in PEP 426 but this was rejected: https://peps.python.org/pep-0426
1 parent 0743c3a commit 7ada291

File tree

3 files changed

+62
-20
lines changed

3 files changed

+62
-20
lines changed

.github/workflows/cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: pip install -U pip wheel
4444

4545
- name: Install Python package and dependencies
46-
run: pip install -e .[docs,pre-commit,tests]
46+
run: pip install -e .[all_plugins,docs,pre-commit,tests]
4747

4848
- name: Run pre-commit
4949
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
@@ -78,7 +78,7 @@ jobs:
7878
run: pip install -U pip wheel
7979

8080
- name: Install Python package and dependencies
81-
run: pip install -e .[tests]
81+
run: pip install -e .[all_plugins,tests]
8282

8383
- name: Run pytest
8484
run: pytest -sv tests

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: pip install -U pip wheel
2323

2424
- name: Install Python package and dependencies
25-
run: pip install -e .[docs,pre-commit,tests]
25+
run: pip install -e .[all_plugins,docs,pre-commit,tests]
2626

2727
- name: Run pre-commit
2828
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
@@ -56,7 +56,7 @@ jobs:
5656
run: pip install -U pip wheel
5757

5858
- name: Install Python package and dependencies
59-
run: pip install -e .[tests]
59+
run: pip install -e .[all_plugins,tests]
6060

6161
- name: Run pytest
6262
env:

pyproject.toml

Lines changed: 58 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,9 @@ classifiers = [
1717
'Programming Language :: Python :: 3.12'
1818
]
1919
dependencies = [
20-
'abipy==0.9.6',
21-
'aiida-ase~=3.0',
22-
'aiida-abinit~=0.5.0',
23-
'aiida-bigdft~=0.3.0',
24-
'aiida-castep~=2.0',
2520
'aiida-core[atomic_tools]~=2.1',
26-
'aiida-cp2k~=2.0',
27-
'aiida-fleur~=2.0',
28-
'aiida-gaussian~=2.0',
29-
'aiida-nwchem~=3.0',
30-
'aiida-orca~=0.6.0',
31-
'aiida-pseudo~=1.0',
32-
'aiida-quantumespresso~=4.4',
33-
'aiida-siesta~=2.0',
34-
'aiida-vasp~=3.1',
35-
'aiida-wien2k~=0.2.0',
3621
'ase!=3.20.*',
3722
'click~=8.0',
38-
'masci-tools~=0.9',
3923
'pint~=0.16',
4024
'pymatgen>=2022.1.20'
4125
]
@@ -65,6 +49,36 @@ requires-python = '>=3.9'
6549
'common_workflows.relax.wien2k' = 'aiida_common_workflows.workflows.relax.wien2k.workchain:Wien2kCommonRelaxWorkChain'
6650

6751
[project.optional-dependencies]
52+
abinit = [
53+
'abipy==0.9.6',
54+
'aiida-abinit~=0.5.0'
55+
]
56+
all_plugins = [
57+
'abipy==0.9.6',
58+
'aiida-abinit~=0.5.0',
59+
'aiida-ase~=3.0',
60+
'aiida-bigdft~=0.3.0',
61+
'aiida-castep~=2.0',
62+
'aiida-cp2k~=2.0',
63+
'aiida-fleur~=2.0',
64+
'aiida-gaussian~=2.0',
65+
'aiida-nwchem~=3.0',
66+
'aiida-orca~=0.6.0',
67+
'aiida-quantumespresso~=4.4',
68+
'aiida-siesta~=2.0',
69+
'aiida-vasp~=3.1',
70+
'aiida-wien2k~=0.2.0',
71+
'masci-tools~=0.9'
72+
]
73+
bigdft = [
74+
'aiida-bigdft~=0.3.0'
75+
]
76+
castep = [
77+
'aiida-castep~=2.0'
78+
]
79+
cp2k = [
80+
'aiida-cp2k~=2.0'
81+
]
6882
docs = [
6983
'docutils~=0.15.2',
7084
'pygments~=2.5',
@@ -74,14 +88,42 @@ docs = [
7488
'sphinxcontrib-details-directive~=0.1.0',
7589
'sphinx-copybutton~=0.3.0'
7690
]
91+
fleur = [
92+
'aiida-fleur~=2.0',
93+
'masci-tools~=0.9'
94+
]
95+
gaussian = [
96+
'aiida-gaussian~=2.0'
97+
]
98+
gpaw = [
99+
'aiida-ase~=3.0'
100+
]
101+
nwchem = [
102+
'aiida-nwchem~=3.0'
103+
]
104+
orca = [
105+
'aiida-orca~=0.6.0'
106+
]
77107
pre-commit = [
78108
'pre-commit~=3.6'
79109
]
110+
quantumespreso = [
111+
'aiida-quantumespresso~=4.4'
112+
]
113+
siesta = [
114+
'aiida-siesta~=2.0'
115+
]
80116
tests = [
81117
'pytest~=7.2',
82118
'pgtest~=1.3,>=1.3.1',
83119
'pytest-regressions~=1.0'
84120
]
121+
vasp = [
122+
'aiida-vasp~=3.1'
123+
]
124+
wien2k = [
125+
'aiida-wien2k~=0.2.0'
126+
]
85127

86128
[project.scripts]
87129
acwf = 'aiida_common_workflows.cli:cmd_root'

0 commit comments

Comments
 (0)