Skip to content

Commit 9ccaa0f

Browse files
committed
Making NumPy reqs less restrictive
1 parent 0a0f034 commit 9ccaa0f

File tree

22 files changed

+994
-1765
lines changed

22 files changed

+994
-1765
lines changed

.github/workflows/python-release.yml

Lines changed: 35 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Python Artifacts
22

33
env:
4-
TRIGGER_ON_PR_PUSH: false # Set to true to enable triggers on PR pushes
4+
TRIGGER_ON_PR_PUSH: true # Set to true to enable triggers on PR pushes
55
PYTHON_VERSION: '3.10'
66

77
on:
@@ -66,20 +66,13 @@ jobs:
6666
with:
6767
python-version: ${{ env.PYTHON_VERSION }}
6868

69-
- name: Install the latest version of uv
70-
uses: astral-sh/setup-uv@v4
71-
with:
72-
enable-cache: true
73-
ignore-nothing-to-cache: true
74-
cache-dependency-glob: |
75-
**/pyproject.toml
76-
**/requirements*.txt
77-
**/uv.lock
78-
7969
- name: Remove conflicting README.md
8070
run: |
8171
if [ -f crates/pecos-python/README.md ]; then
8272
mv crates/pecos-python/README.md crates/pecos-python/README.md.bak
73+
echo "Moved conflicting README.md to README.md.bak"
74+
else
75+
echo "No conflicting README.md found"
8376
fi
8477
8578
- name: Build pecos-rslib SDist
@@ -94,13 +87,15 @@ jobs:
9487
run: |
9588
if [ -f crates/pecos-python/README.md.bak ]; then
9689
mv crates/pecos-python/README.md.bak crates/pecos-python/README.md
90+
echo "Restored README.md from backup"
91+
else
92+
echo "No README.md backup found"
9793
fi
9894
99-
- name: Install and test pecos-rslib SDist
95+
- name: Test pecos-rslib SDist
10096
run: |
101-
uv sync --project .
102-
uv pip install --force-reinstall python/pecos-rslib/dist/*.tar.gz
103-
uv run python -c 'import pecos_rslib; print(pecos_rslib.__version__)'
97+
pip install --force-reinstall --verbose python/pecos-rslib/dist/*.tar.gz
98+
python -c 'import pecos_rslib; print(pecos_rslib.__version__)'
10499
105100
- name: Upload pecos-rslib SDist
106101
uses: actions/upload-artifact@v4
@@ -135,20 +130,13 @@ jobs:
135130
with:
136131
python-version: ${{ matrix.python-version }}
137132

138-
- name: Install the latest version of uv
139-
uses: astral-sh/setup-uv@v4
140-
with:
141-
enable-cache: true
142-
ignore-nothing-to-cache: true
143-
cache-dependency-glob: |
144-
**/pyproject.toml
145-
**/requirements*.txt
146-
**/uv.lock
147-
148133
- name: Remove conflicting README.md
149134
run: |
150135
if [ -f crates/pecos-python/README.md ]; then
151136
mv crates/pecos-python/README.md crates/pecos-python/README.md.bak
137+
echo "Moved conflicting README.md to README.md.bak"
138+
else
139+
echo "No conflicting README.md found"
152140
fi
153141
154142
- name: Build wheel
@@ -165,14 +153,16 @@ jobs:
165153
run: |
166154
if [ -f crates/pecos-python/README.md.bak ]; then
167155
mv crates/pecos-python/README.md.bak crates/pecos-python/README.md
156+
echo "Restored README.md from backup"
157+
else
158+
echo "No README.md backup found"
168159
fi
169160
170161
- name: Test wheel
171162
if: ${{ !(matrix.architecture == 'x86_64' && matrix.os == 'macos-latest') && matrix.architecture != 'aarch64' }}
172163
run: |
173-
uv sync --project .
174-
uv pip install --force-reinstall python/pecos-rslib/dist/*.whl
175-
uv run python -c 'import pecos_rslib; print(pecos_rslib.__version__)'
164+
pip install --force-reinstall --verbose python/pecos-rslib/dist/*.whl
165+
python -c 'import pecos_rslib; print(pecos_rslib.__version__)'
176166
177167
- name: Upload wheel
178168
uses: actions/upload-artifact@v4
@@ -197,38 +187,29 @@ jobs:
197187
with:
198188
python-version: ${{ env.PYTHON_VERSION }}
199189

200-
- name: Install the latest version of uv
201-
uses: astral-sh/setup-uv@v4
202-
with:
203-
enable-cache: true
204-
ignore-nothing-to-cache: true
205-
cache-dependency-glob: |
206-
**/pyproject.toml
207-
**/requirements*.txt
208-
**/uv.lock
209-
210190
- name: Download pecos-rslib wheel
211191
uses: actions/download-artifact@v4
212192
with:
213193
name: wheel-pecos-rslib-ubuntu-latest-x86_64-py${{ env.PYTHON_VERSION }}
214194
path: ./pecos-rslib-wheel
215195

216-
- name: Setup environment and install dependencies
196+
- name: Install pecos-rslib
197+
run: pip install ./pecos-rslib-wheel/*.whl
198+
199+
- name: Install build dependencies
217200
run: |
218-
uv sync --project .
219-
uv pip install ./pecos-rslib-wheel/*.whl
220-
uv pip install build
201+
python -m pip install --upgrade pip
202+
pip install build
221203
222204
- name: Build quantum-pecos SDist
223205
run: |
224206
cd python/quantum-pecos
225-
uv pip install --system build
226207
python -m build --sdist --outdir dist
227208
228209
- name: Test quantum-pecos SDist
229210
run: |
230-
uv pip install python/quantum-pecos/dist/*.tar.gz
231-
uv run python -c 'import pecos; print(pecos.__version__)'
211+
pip install python/quantum-pecos/dist/*.tar.gz
212+
python -c 'import pecos; print(pecos.__version__)'
232213
233214
- name: Upload quantum-pecos SDist
234215
uses: actions/upload-artifact@v4
@@ -252,30 +233,24 @@ jobs:
252233
with:
253234
ref: ${{ inputs.sha || github.sha }}
254235

255-
- name: Set up Python
236+
- name: Set up Python ${{ matrix.python-version }}
256237
uses: actions/setup-python@v5
257238
with:
258239
python-version: ${{ matrix.python-version }}
259240

260-
- name: Install the latest version of uv
261-
uses: astral-sh/setup-uv@v4
262-
with:
263-
enable-cache: true
264-
ignore-nothing-to-cache: true
265-
cache-dependency-glob: |
266-
**/pyproject.toml
267-
**/requirements*.txt
268-
**/uv.lock
269-
270241
- name: Download pecos-rslib wheel
271242
uses: actions/download-artifact@v4
272243
with:
273244
name: wheel-pecos-rslib-ubuntu-latest-x86_64-py${{ matrix.python-version }}
274245
path: ./pecos-rslib-wheel
275246

276-
- name: Setup environment and install dependencies
247+
- name: Install pecos-rslib
248+
run: pip install ./pecos-rslib-wheel/*.whl
249+
250+
- name: Install build dependencies
277251
run: |
278-
uv pip install --system ./pecos-rslib-wheel/*.whl build
252+
python -m pip install --upgrade pip
253+
pip install build
279254
280255
- name: Build quantum-pecos wheel
281256
run: |
@@ -284,9 +259,8 @@ jobs:
284259
285260
- name: Test quantum-pecos wheel
286261
run: |
287-
uv sync # This will use the workspace config correctly
288-
uv pip install python/quantum-pecos/dist/*.whl
289-
uv run python -c 'import pecos; print(pecos.__version__)'
262+
pip install python/quantum-pecos/dist/*.whl
263+
python -c 'import pecos; print(pecos.__version__)'
290264
291265
- name: Upload quantum-pecos wheel
292266
uses: actions/upload-artifact@v4

.github/workflows/python-test.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
name: Python test / linting
2+
3+
env:
4+
TRIGGER_ON_PR_PUSH: true # Set to true to enable triggers on PR pushes
5+
RUSTFLAGS: -C debuginfo=0
6+
RUST_BACKTRACE: 1
7+
PYTHONUTF8: 1
8+
29
on:
310
push:
411
branches: [ "master", "development" ]
@@ -21,11 +28,6 @@ concurrency:
2128
group: ${{ github.workflow }}-${{ github.ref }}
2229
cancel-in-progress: true
2330

24-
env:
25-
RUSTFLAGS: -C debuginfo=0
26-
RUST_BACKTRACE: 1
27-
PYTHONUTF8: 1
28-
2931
defaults:
3032
run:
3133
shell: bash

Cargo.lock

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python/pecos-rslib/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ authors = [
88
maintainers =[
99
{name = "Ciaran Ryan-Anderson", email = "[email protected]"},
1010
]
11-
dependencies = []
11+
dependencies = [
12+
]
1213
readme = "README.md"
1314
requires-python = ">= 3.8"
1415

python/pecos-rslib/rust/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@ publish = false
1515
[lib]
1616
name = "pecos_rslib"
1717
crate-type = ["cdylib", "rlib"]
18+
# Skip doc tests as they won't work properly in this setup
19+
doctest = false
20+
# Skip unit tests as well - all testing should be done through Python
21+
test = false
1822

1923
[dependencies]
20-
pyo3 = { workspace=true, features = ["extension-module", "auto-initialize"] }
24+
pyo3 = { workspace=true, features = ["extension-module", "abi3-py310", "generate-import-lib"] }
2125
pecos = { workspace = true }
2226
parking_lot = { workspace = true}
2327
serde_json = { workspace = true }
2428

25-
[features]
26-
python-tests = [] # Empty feature just for enabling tests
27-
2829
[lints]
2930
workspace = true
3031

python/pecos-rslib/rust/src/sparse_sim.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
// or implied. See the License for the specific language governing permissions and limitations under
1111
// the License.
1212

13+
#![allow(clippy::useless_conversion)]
14+
1315
use pecos::prelude::*;
1416
use pyo3::prelude::*;
1517
use pyo3::types::{PyDict, PyTuple};

python/pecos-rslib/rust/src/sparse_stab_bindings.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
// or implied. See the License for the specific language governing permissions and limitations under
1111
// the License.
1212

13-
// PECOS/python/pecos-rslib/rust/src/sparse_sim.rs
14-
1513
use pecos::prelude::*;
1614
use pyo3::prelude::*;
1715
use pyo3::types::{PyDict, PyTuple};

0 commit comments

Comments
 (0)