Skip to content

Commit

Permalink
Update to support Pkg version spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n committed Dec 19, 2024
1 parent 5fe4977 commit f9d32de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/aiida_dftk/calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
from pymatgen.core import units


_AIIDA_DFTK_MIN_VERSION = "0.1.9" # inclusive
_AIIDA_DFTK_MAX_VERSION = "0.2" # exclusive
_AIIDA_DFTK_VERSION_SPEC = "0.1.9"


class DftkCalculation(CalcJob):
Expand Down Expand Up @@ -241,8 +240,10 @@ def prepare_for_submission(self, folder):
cmdline_params = [
# Precompilation under MPI generally deadlocks. Make sure everything is already precompiled.
'--compiled-modules=strict',
'-e', f'using AiidaDFTK; AiidaDFTK.run(; min_version=v"{_AIIDA_DFTK_MIN_VERSION}", max_version=v"{_AIIDA_DFTK_MAX_VERSION}")',
self.metadata.options.input_filename
'-e', 'using AiidaDFTK; AiidaDFTK.run("{}"; allowed_versions="{}")'.format(
self.metadata.options.input_filename,
_AIIDA_DFTK_VERSION_SPEC,
),
]

# prepare retrieve list
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def pytest_sessionstart():
AiidaDFTK = "26386dbc-b74b-4d9a-b75a-41d28ada84fc"
[compat]
AiidaDFTK = "{aiida_dftk.calculations._AIIDA_DFTK_MIN_VERSION}"
AiidaDFTK = "{aiida_dftk.calculations._AIIDA_DFTK_VERSION_SPEC}"
""")

# Pkg.Registry.add() seems necessary for GitHub Actions
Expand Down

0 comments on commit f9d32de

Please sign in to comment.