Skip to content

Commit

Permalink
Dependencies: Make installing plugin packages optional
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sphuber committed Feb 26, 2024
1 parent 0743c3a commit 7ada291
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: pip install -U pip wheel

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

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

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

- name: Run pytest
run: pytest -sv tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: pip install -U pip wheel

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

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

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

- name: Run pytest
env:
Expand Down
74 changes: 58 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,9 @@ classifiers = [
'Programming Language :: Python :: 3.12'
]
dependencies = [
'abipy==0.9.6',
'aiida-ase~=3.0',
'aiida-abinit~=0.5.0',
'aiida-bigdft~=0.3.0',
'aiida-castep~=2.0',
'aiida-core[atomic_tools]~=2.1',
'aiida-cp2k~=2.0',
'aiida-fleur~=2.0',
'aiida-gaussian~=2.0',
'aiida-nwchem~=3.0',
'aiida-orca~=0.6.0',
'aiida-pseudo~=1.0',
'aiida-quantumespresso~=4.4',
'aiida-siesta~=2.0',
'aiida-vasp~=3.1',
'aiida-wien2k~=0.2.0',
'ase!=3.20.*',
'click~=8.0',
'masci-tools~=0.9',
'pint~=0.16',
'pymatgen>=2022.1.20'
]
Expand Down Expand Up @@ -65,6 +49,36 @@ requires-python = '>=3.9'
'common_workflows.relax.wien2k' = 'aiida_common_workflows.workflows.relax.wien2k.workchain:Wien2kCommonRelaxWorkChain'

[project.optional-dependencies]
abinit = [
'abipy==0.9.6',
'aiida-abinit~=0.5.0'
]
all_plugins = [
'abipy==0.9.6',
'aiida-abinit~=0.5.0',
'aiida-ase~=3.0',
'aiida-bigdft~=0.3.0',
'aiida-castep~=2.0',
'aiida-cp2k~=2.0',
'aiida-fleur~=2.0',
'aiida-gaussian~=2.0',
'aiida-nwchem~=3.0',
'aiida-orca~=0.6.0',
'aiida-quantumespresso~=4.4',
'aiida-siesta~=2.0',
'aiida-vasp~=3.1',
'aiida-wien2k~=0.2.0',
'masci-tools~=0.9'
]
bigdft = [
'aiida-bigdft~=0.3.0'
]
castep = [
'aiida-castep~=2.0'
]
cp2k = [
'aiida-cp2k~=2.0'
]
docs = [
'docutils~=0.15.2',
'pygments~=2.5',
Expand All @@ -74,14 +88,42 @@ docs = [
'sphinxcontrib-details-directive~=0.1.0',
'sphinx-copybutton~=0.3.0'
]
fleur = [
'aiida-fleur~=2.0',
'masci-tools~=0.9'
]
gaussian = [
'aiida-gaussian~=2.0'
]
gpaw = [
'aiida-ase~=3.0'
]
nwchem = [
'aiida-nwchem~=3.0'
]
orca = [
'aiida-orca~=0.6.0'
]
pre-commit = [
'pre-commit~=3.6'
]
quantumespreso = [
'aiida-quantumespresso~=4.4'
]
siesta = [
'aiida-siesta~=2.0'
]
tests = [
'pytest~=7.2',
'pgtest~=1.3,>=1.3.1',
'pytest-regressions~=1.0'
]
vasp = [
'aiida-vasp~=3.1'
]
wien2k = [
'aiida-wien2k~=0.2.0'
]

[project.scripts]
acwf = 'aiida_common_workflows.cli:cmd_root'
Expand Down

0 comments on commit 7ada291

Please sign in to comment.