Skip to content

Commit 57d6934

Browse files
authored
Merge pull request #345 from FAIRmat-NFDI/check-nomad-requirements
Add workflow for checking against NOMAD dependencies
2 parents bfed74f + 65714b2 commit 57d6934

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: NOMAD dependencies compatibility
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
# Run workflow only when there are changes in pyproject.toml or dev-requirements.txt
11+
paths:
12+
- 'pyproject.toml'
13+
- 'dev-requirements.txt'
14+
15+
jobs:
16+
validate_dependencies:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout pynxtools
21+
uses: actions/checkout@v2
22+
23+
- name: Checkout NOMAD from GitLab
24+
run: |
25+
git clone --depth 1 --branch develop --recurse-submodules https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-FAIR.git nomad
26+
git submodule update --init --recursive --depth 1
27+
28+
- name: Replace pynxtools dependency in NOMAD pyproject.toml
29+
working-directory: ./nomad
30+
run: |
31+
sed -i 's|pynxtools\[convert\]==[0-9]\+\(\.[0-9]\+\)\{0,2\}|pynxtools\[convert\]@git+https://github.com/FAIRmat-NFDI/pynxtools.git@${{ github.head_ref }}|' pyproject.toml
32+
33+
- name: Set up Python
34+
uses: actions/setup-python@v2
35+
with:
36+
python-version: '3.9'
37+
38+
- name: Install uv
39+
run: |
40+
curl -LsSf https://astral.sh/uv/install.sh | sh
41+
42+
- name: Generate (dev-)requirements.txt from modified pyproject.toml
43+
working-directory: ./nomad
44+
run: |
45+
uv pip compile -p 3.9 --annotation-style=line --extra=infrastructure --extra=parsing --output-file=requirements.txt dependencies/nomad-dos-fingerprints/pyproject.toml dependencies/parsers/eelsdb/pyproject.toml pyproject.toml
46+
uv pip compile -p 3.9 --annotation-style=line --extra=dev --extra=infrastructure --extra=parsing --output-file=requirements-dev.txt requirements.txt pyproject.toml
47+
48+
- name: Install NOMAD dependencies with pynxtools from current branch
49+
working-directory: ./nomad
50+
run: |
51+
uv pip install --system -r requirements.txt
52+
uv pip install --system -r requirements-dev.txt
53+
env:
54+
PYTHONPATH: "" # Ensure no pre-installed packages interfere with the test

0 commit comments

Comments
 (0)