Skip to content

Commit

Permalink
fix pip check for optional dependencies (#405)
Browse files Browse the repository at this point in the history
* fix pip check for optional dependencies

* install optional dependencies

* Update pipeline.yml

* add new line

* Update check.py

* Update pipeline.yml

* Update environment-mace.yml
  • Loading branch information
jan-janssen authored Feb 14, 2025
1 parent 39a63ac commit 091eb1b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
16 changes: 16 additions & 0 deletions .ci_support/check.py
Original file line number Diff line number Diff line change
@@ -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"] += [el for el in set(lst) if not el.startswith("pwtools")]

with open("pyproject.toml", "w") as f:
f.writelines(tomlkit.dumps(data))
1 change: 1 addition & 0 deletions .ci_support/environment-mace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ channels:
- conda-forge
dependencies:
- pymace =0.3.6
- pytorch =2.5.1
2 changes: 1 addition & 1 deletion .ci_support/environment-qe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ channels:
- conda-forge
dependencies:
- qe =7.2
- pwtools =1.2.3
- pwtools =1.2.3
12 changes: 9 additions & 3 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,24 @@ 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-gpaw.yml >> environment.yml
echo -e "channels:\n - conda-forge\n" > .condarc
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
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: |
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
Expand Down

0 comments on commit 091eb1b

Please sign in to comment.