Skip to content

Commit

Permalink
Support aiida<2.6 (#84)
Browse files Browse the repository at this point in the history
mock_code tests were failing since aiida 2.3.0,
caused by just a whitespace change
in the core.direct scheduler submission script.

Concretely, there was an extra space at the end of the last
line of the script (the executable line) before 2.3.
As a short term solution to preserve the existing hashes,
we append a space if the script doesn't end with one.

This change is purely for backwards compatibility and should be
reverted right after 0.0.1 release.
  • Loading branch information
danielhollas authored Nov 30, 2024
1 parent 801cbb9 commit 7caebdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions aiida_test_cache/mock_code/_hasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def __call__(self, cwd: Path) -> str:
file_content_bytes = file_obj.read()
if path.name == self.SUBMIT_FILE:
file_content_bytes = self._strip_submit_content(file_content_bytes)
# TODO: This is a temporary ugly hack for backward compatibility with aiida-core<2.3
# REVERT THIS after 0.0.1 release!
if not file_content_bytes.endswith(b" "):
file_content_bytes += b" "
file_content_bytes = self.modify_content(path, file_content_bytes)
if file_content_bytes is not None:
md5sum.update(path.name.encode())
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ urls = {Homepage = "https://aiida-testing.readthedocs.io/"}
requires-python = ">=3.7"
# Note the dependency on setuptools due to pkg_resources
dependencies = [
"aiida-core>=1.0.0,<2.3",
"aiida-core>=1.0.0,<2.6",
"pytest>=7.0",
"voluptuous~=0.12",
"setuptools",
Expand Down

0 comments on commit 7caebdb

Please sign in to comment.