From f6ba2ddfa455e766e84c360d944f42c9e739a5f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Fri, 14 Feb 2025 08:49:31 +0100 Subject: [PATCH 1/7] fix pip check for optional dependencies --- .ci_support/check.py | 16 ++++++++++++++++ .github/workflows/pipeline.yml | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .ci_support/check.py diff --git a/.ci_support/check.py b/.ci_support/check.py new file mode 100644 index 00000000..b4a36c54 --- /dev/null +++ b/.ci_support/check.py @@ -0,0 +1,16 @@ +import tomlkit + + +if __name__ == "__main__": + with open("pyproject.toml", "r") as f: + data = tomlkit.load(f) + + lst = [] + for sub_lst in data["project"]["optional-dependencies"].values(): + for el in sub_lst: + lst.append(el) + + data["project"]["dependencies"] += list(set(lst)) + + with open("pyproject.toml", "w") as f: + f.writelines(tomlkit.dumps(data)) \ No newline at end of file diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 11685cc0..7bcbf5aa 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -145,7 +145,9 @@ jobs: - name: Pip check shell: bash -l {0} run: | - pip install versioneer[toml]==0.29 + pip install versioneer[toml]==0.29 tomlkit + python .ci_support/check.py + cat pyproject.toml pip install . --no-deps --no-build-isolation pip check From be106cac6a093677b83211a9829cbfaab9a62085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Fri, 14 Feb 2025 09:11:05 +0100 Subject: [PATCH 2/7] install optional dependencies --- .github/workflows/pipeline.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 7bcbf5aa..b34c1047 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -134,7 +134,12 @@ jobs: steps: - uses: actions/checkout@v4 - name: Conda config - run: echo -e "channels:\n - conda-forge\n" > .condarc + run: | + cp .ci_support/environment.yml environment.yml + tail --lines=+4 .ci_support/environment-lammps.yml >> environment.yml + tail --lines=+4 .ci_support/environment-qe.yml >> environment.yml + tail --lines=+4 .ci_support/environment-gpaw.yml >> environment.yml + echo -e "channels:\n - conda-forge\n" > .condarc - name: Setup Mambaforge uses: conda-incubator/setup-miniconda@v3 with: From 38934541b3bddefdb0e50fb6f35ed8b7e02191ca Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Fri, 14 Feb 2025 09:17:55 +0100 Subject: [PATCH 3/7] Update pipeline.yml --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index b34c1047..dbdf519e 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -146,7 +146,7 @@ jobs: python-version: '3.12' miniforge-version: latest condarc-file: .condarc - environment-file: .ci_support/environment.yml + environment-file: environment.yml - name: Pip check shell: bash -l {0} run: | From 49bb62ed9f6239637df8bcef672948fb9f802bbf Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Fri, 14 Feb 2025 09:24:48 +0100 Subject: [PATCH 4/7] add new line --- .ci_support/environment-qe.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci_support/environment-qe.yml b/.ci_support/environment-qe.yml index cda819f3..34241dc9 100644 --- a/.ci_support/environment-qe.yml +++ b/.ci_support/environment-qe.yml @@ -2,4 +2,4 @@ channels: - conda-forge dependencies: - qe =7.2 -- pwtools =1.2.3 \ No newline at end of file +- pwtools =1.2.3 From 5850d4a5b22dc407b7d25c874f4baa9ee6c4dcf7 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Fri, 14 Feb 2025 09:35:36 +0100 Subject: [PATCH 5/7] Update check.py --- .ci_support/check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci_support/check.py b/.ci_support/check.py index b4a36c54..f0d0e4cc 100644 --- a/.ci_support/check.py +++ b/.ci_support/check.py @@ -10,7 +10,7 @@ for el in sub_lst: lst.append(el) - data["project"]["dependencies"] += list(set(lst)) + data["project"]["dependencies"] += [el for el in set(lst) if not el.startswith("pwtools")] with open("pyproject.toml", "w") as f: - f.writelines(tomlkit.dumps(data)) \ No newline at end of file + f.writelines(tomlkit.dumps(data)) From 256ecfc80e01c64484ad553c70243938d63bb89a Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Fri, 14 Feb 2025 09:36:08 +0100 Subject: [PATCH 6/7] Update pipeline.yml --- .github/workflows/pipeline.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index dbdf519e..d6151605 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -137,7 +137,6 @@ jobs: run: | cp .ci_support/environment.yml environment.yml tail --lines=+4 .ci_support/environment-lammps.yml >> environment.yml - tail --lines=+4 .ci_support/environment-qe.yml >> environment.yml tail --lines=+4 .ci_support/environment-gpaw.yml >> environment.yml echo -e "channels:\n - conda-forge\n" > .condarc - name: Setup Mambaforge From 8485643bddea11f40c83ab0b3a91ce2a53854c6a Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Fri, 14 Feb 2025 10:35:56 +0100 Subject: [PATCH 7/7] Update environment-mace.yml --- .ci_support/environment-mace.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.ci_support/environment-mace.yml b/.ci_support/environment-mace.yml index 958a77a0..3d9abecf 100644 --- a/.ci_support/environment-mace.yml +++ b/.ci_support/environment-mace.yml @@ -2,3 +2,4 @@ channels: - conda-forge dependencies: - pymace =0.3.6 +- pytorch =2.5.1