Skip to content

Commit 8ab18ab

Browse files
committed
Merge branch 'feat/minimal-pcg-wrapper' into refactor-n-memory
2 parents e1d9398 + 2942c70 commit 8ab18ab

File tree

30 files changed

+1226
-84
lines changed

30 files changed

+1226
-84
lines changed

.github/workflows/python-release.yml

Lines changed: 20 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -51,59 +51,6 @@ jobs:
5151
echo "run=false" >> $GITHUB_OUTPUT
5252
fi
5353
54-
build_sdist_pecos_rslib:
55-
needs: check_pr_push
56-
if: |
57-
always() &&
58-
(needs.check_pr_push.result == 'success' && needs.check_pr_push.outputs.run == 'true' || needs.check_pr_push.result == 'skipped') &&
59-
(github.event_name != 'pull_request' || github.event.pull_request.merged == true || github.event.action == 'opened' || github.event.action == 'synchronize')
60-
runs-on: ubuntu-latest
61-
steps:
62-
- uses: actions/checkout@v4
63-
with:
64-
ref: ${{ inputs.sha || github.sha }}
65-
66-
- name: Set up Python
67-
uses: actions/setup-python@v5
68-
with:
69-
python-version: ${{ env.PYTHON_VERSION }}
70-
71-
- name: Remove conflicting README.md
72-
run: |
73-
if [ -f crates/pecos-python/README.md ]; then
74-
mv crates/pecos-python/README.md crates/pecos-python/README.md.bak
75-
echo "Moved conflicting README.md to README.md.bak"
76-
else
77-
echo "No conflicting README.md found"
78-
fi
79-
80-
- name: Build pecos-rslib SDist
81-
uses: PyO3/maturin-action@v1
82-
with:
83-
command: sdist
84-
args: --out dist
85-
working-directory: python/pecos-rslib
86-
87-
- name: Restore README.md
88-
if: always()
89-
run: |
90-
if [ -f crates/pecos-python/README.md.bak ]; then
91-
mv crates/pecos-python/README.md.bak crates/pecos-python/README.md
92-
echo "Restored README.md from backup"
93-
else
94-
echo "No README.md backup found"
95-
fi
96-
97-
- name: Test pecos-rslib SDist
98-
run: |
99-
pip install --force-reinstall --verbose python/pecos-rslib/dist/*.tar.gz
100-
python -c 'import pecos_rslib; print(pecos_rslib.__version__)'
101-
102-
- name: Upload pecos-rslib SDist
103-
uses: actions/upload-artifact@v4
104-
with:
105-
name: sdist-pecos-rslib
106-
path: python/pecos-rslib/dist/*.tar.gz
10754
10855
build_wheels_pecos_rslib:
10956
needs: check_pr_push
@@ -173,7 +120,7 @@ jobs:
173120
path: python/pecos-rslib/dist/*.whl
174121

175122
build_sdist_quantum_pecos:
176-
needs: [check_pr_push, build_sdist_pecos_rslib, build_wheels_pecos_rslib]
123+
needs: [check_pr_push, build_wheels_pecos_rslib]
177124
if: |
178125
always() &&
179126
(needs.check_pr_push.result == 'success' && needs.check_pr_push.outputs.run == 'true' || needs.check_pr_push.result == 'skipped') &&
@@ -198,10 +145,16 @@ jobs:
198145
- name: Install pecos-rslib
199146
run: pip install ./pecos-rslib-wheel/*.whl
200147

201-
- name: Install build dependencies
148+
- name: Install pecos RNG build dependencies
149+
run: |
150+
pip install build nanobind
151+
152+
- name: Build PECOS RNG
202153
run: |
203-
python -m pip install --upgrade pip
204-
pip install build
154+
cd clib/pecos-rng && mkdir build && cd build/ && cmake ..
155+
make && cd .. && pip install .
156+
env:
157+
NANOBIND_DIR: python -m nanobind --include_dir
205158

206159
- name: Build quantum-pecos SDist
207160
run: |
@@ -220,7 +173,7 @@ jobs:
220173
path: python/quantum-pecos/dist/*.tar.gz
221174

222175
build_wheels_quantum_pecos:
223-
needs: [check_pr_push, build_wheels_pecos_rslib, build_sdist_quantum_pecos]
176+
needs: [check_pr_push, build_wheels_pecos_rslib]
224177
if: |
225178
always() &&
226179
(needs.check_pr_push.result == 'success' && needs.check_pr_push.outputs.run == 'true' || needs.check_pr_push.result == 'skipped') &&
@@ -249,10 +202,16 @@ jobs:
249202
- name: Install pecos-rslib
250203
run: pip install ./pecos-rslib-wheel/*.whl
251204

252-
- name: Install build dependencies
205+
- name: Install pecos rng build dependencies
206+
run: |
207+
pip install build nanobind
208+
209+
- name: Build PECOS RNG
253210
run: |
254-
python -m pip install --upgrade pip
255-
pip install build
211+
cd clib/pecos-rng && mkdir build && cd build/ && cmake ..
212+
make && cd .. && pip install .
213+
env:
214+
NANOBIND_DIR: python -m nanobind --include_dir
256215

257216
- name: Build quantum-pecos wheel
258217
run: |

.github/workflows/python-test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ jobs:
6969
uv lock --project .
7070
uv sync --project .
7171
72+
- name: Install pecos rng build dependencies
73+
run: |
74+
uv pip install build nanobind scikit-build-core cmake ninja
75+
76+
- name: Build PECOS RNG
77+
run: |
78+
export NANOBIND_CMAKE_DIR=$(uv run -- python -m nanobind --cmake_dir)
79+
export NANOBIND_DIR=$(uv run -- python -m nanobind --include_dir)
80+
cd clib/pecos-rng && mkdir build && cd build/ && cmake .. -DCMAKE_PREFIX_PATH=$NANOBIND_CMAKE_DIR
81+
cmake --build . && cd ..
82+
uv pip install .
83+
7284
- name: Install pecos-rslib with maturin
7385
run: |
7486
cd python/pecos-rslib

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ dist/
3232
downloads/
3333
eggs/
3434
.eggs/
35-
lib/
3635
lib64/
3736
parts/
3837
sdist/
@@ -177,3 +176,7 @@ cython_debug/
177176
# and can be added to the global gitignore or merged into this file. For a more nuclear
178177
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
179178
.idea/
179+
180+
# Prevent subdirectory virtual environments
181+
clib/*/.venv/
182+
clib/*/uv.lock

0 commit comments

Comments
 (0)