Skip to content

Commit bef44fa

Browse files
jameskermodeclaude
andcommitted
Add pyproject.toml and update CI for reproducible Python environment
- Add export/pyproject.toml with numpy, ase, pytest dependencies - Update export-ci.yml to use uv for Python dependency management - Include liblammps.so* in LAMMPS artifact for runtime linking - Set LD_LIBRARY_PATH for LAMMPS shared library in CI - Add export/.gitignore for venv and build artifacts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent e529f67 commit bef44fa

File tree

3 files changed

+47
-2
lines changed

3 files changed

+47
-2
lines changed

.github/workflows/export-ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
name: lammps-build
7272
path: |
7373
lammps/build/lmp
74+
lammps/build/liblammps.so*
7475
lammps/src/*.h
7576
retention-days: 1
7677

@@ -128,10 +129,14 @@ jobs:
128129
uses: actions/setup-python@v5
129130
with:
130131
python-version: '3.11'
131-
cache: 'pip'
132+
133+
- name: Install uv
134+
uses: astral-sh/setup-uv@v4
132135

133136
- name: Install Python dependencies
134-
run: pip install numpy ase pytest
137+
run: |
138+
cd export
139+
uv sync
135140
136141
- name: Cache Julia packages
137142
uses: actions/cache@v4
@@ -157,6 +162,7 @@ jobs:
157162
158163
- name: Run Python tests
159164
run: |
165+
source export/.venv/bin/activate
160166
julia --project=export export/test/runtests.jl python
161167
162168
test-lammps-serial:
@@ -181,6 +187,7 @@ jobs:
181187
run: |
182188
chmod +x lammps/build/lmp
183189
echo "$GITHUB_WORKSPACE/lammps/build" >> $GITHUB_PATH
190+
echo "LD_LIBRARY_PATH=$GITHUB_WORKSPACE/lammps/build:$LD_LIBRARY_PATH" >> $GITHUB_ENV
184191
185192
- name: Cache Julia packages
186193
uses: actions/cache@v4
@@ -284,6 +291,7 @@ jobs:
284291
run: |
285292
chmod +x lammps/build/lmp
286293
echo "$GITHUB_WORKSPACE/lammps/build" >> $GITHUB_PATH
294+
echo "LD_LIBRARY_PATH=$GITHUB_WORKSPACE/lammps/build:$LD_LIBRARY_PATH" >> $GITHUB_ENV
287295
288296
- name: Cache Julia packages
289297
uses: actions/cache@v4

export/.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Python virtual environment
2+
.venv/
3+
__pycache__/
4+
*.pyc
5+
6+
# uv lock file (generated)
7+
uv.lock
8+
9+
# Test artifacts
10+
test/build/
11+
test/lammps/*.dump
12+
test/lammps/*.log
13+
test/lammps/log.lammps
14+
15+
# LAMMPS plugin build
16+
lammps/plugin/build/

export/pyproject.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[project]
2+
name = "ace-export-tests"
3+
version = "0.1.0"
4+
description = "Python dependencies for ACE export testing"
5+
requires-python = ">=3.9"
6+
dependencies = [
7+
"numpy>=1.20",
8+
"ase>=3.22",
9+
"pytest>=7.0",
10+
]
11+
12+
[project.optional-dependencies]
13+
dev = [
14+
"pytest-cov",
15+
]
16+
17+
[tool.pytest.ini_options]
18+
testpaths = ["test/python"]
19+
python_files = ["test_*.py"]
20+
python_classes = ["Test*"]
21+
python_functions = ["test_*"]

0 commit comments

Comments
 (0)