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