Skip to content

Commit c563846

Browse files
committed
feat(python): Implemented initial bindings for RRT
1 parent e081aef commit c563846

File tree

10 files changed

+582
-20
lines changed

10 files changed

+582
-20
lines changed

.github/workflows/CI.yml renamed to .github/workflows/pypi.yml

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# This file is autogenerated by maturin v1.8.6
22
# To update, run
33
#
4-
# maturin generate-ci github
4+
# maturin generate-ci github
55
#
6-
name: CI
6+
name: pypi
77

88
on:
99
# push:
@@ -19,6 +19,23 @@ permissions:
1919
contents: read
2020

2121
jobs:
22+
develop:
23+
name: Run maturin develop
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: 3.x
30+
- name: Create venv and run maturin develop
31+
working-directory: ./oxmpl-py
32+
run: |
33+
python -m venv venv
34+
source venv/bin/activate
35+
pip install maturin
36+
maturin develop
37+
shell: bash
38+
2239
linux:
2340
runs-on: ${{ matrix.platform.runner }}
2441
strategy:
@@ -48,11 +65,12 @@ jobs:
4865
args: --release --out dist --find-interpreter
4966
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
5067
manylinux: auto
68+
working-directory: ./oxmpl-py # Added working directory for build
5169
- name: Upload wheels
5270
uses: actions/upload-artifact@v4
5371
with:
5472
name: wheels-linux-${{ matrix.platform.target }}
55-
path: dist
73+
path: oxmpl-py/dist
5674

5775
musllinux:
5876
runs-on: ${{ matrix.platform.runner }}
@@ -79,11 +97,12 @@ jobs:
7997
args: --release --out dist --find-interpreter
8098
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
8199
manylinux: musllinux_1_2
100+
working-directory: ./oxmpl-py # Added working directory for build
82101
- name: Upload wheels
83102
uses: actions/upload-artifact@v4
84103
with:
85104
name: wheels-musllinux-${{ matrix.platform.target }}
86-
path: dist
105+
path: oxmpl-py/dist
87106

88107
windows:
89108
runs-on: ${{ matrix.platform.runner }}
@@ -106,11 +125,12 @@ jobs:
106125
target: ${{ matrix.platform.target }}
107126
args: --release --out dist --find-interpreter
108127
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
128+
working-directory: ./oxmpl-py # Added working directory for build
109129
- name: Upload wheels
110130
uses: actions/upload-artifact@v4
111131
with:
112132
name: wheels-windows-${{ matrix.platform.target }}
113-
path: dist
133+
path: oxmpl-py/dist
114134

115135
macos:
116136
runs-on: ${{ matrix.platform.runner }}
@@ -132,11 +152,12 @@ jobs:
132152
target: ${{ matrix.platform.target }}
133153
args: --release --out dist --find-interpreter
134154
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
155+
working-directory: ./oxmpl-py # Added working directory for build
135156
- name: Upload wheels
136157
uses: actions/upload-artifact@v4
137158
with:
138159
name: wheels-macos-${{ matrix.platform.target }}
139-
path: dist
160+
path: oxmpl-py/dist
140161

141162
sdist:
142163
runs-on: ubuntu-latest
@@ -147,11 +168,12 @@ jobs:
147168
with:
148169
command: sdist
149170
args: --out dist
171+
working-directory: ./oxmpl-py # Added working directory for build
150172
- name: Upload sdist
151173
uses: actions/upload-artifact@v4
152174
with:
153175
name: wheels-sdist
154-
path: dist
176+
path: oxmpl-py/dist
155177

156178
release:
157179
name: Release
@@ -167,15 +189,25 @@ jobs:
167189
attestations: write
168190
steps:
169191
- uses: actions/download-artifact@v4
192+
with:
193+
# The '*' downloads all artifacts.
194+
# We need to specify a directory to avoid conflicts.
195+
path: artifacts
196+
- name: Move artifacts
197+
run: |
198+
# The artifacts are downloaded into subdirectories named after them.
199+
# We need to move the wheel and sdist files to a common directory for upload.
200+
mkdir -p dist
201+
find artifacts -type f -name "*.whl" -o -name "*.tar.gz" | xargs -I {} mv {} dist/
170202
- name: Generate artifact attestation
171203
uses: actions/attest-build-provenance@v2
172204
with:
173-
subject-path: 'wheels-*/*'
205+
subject-path: 'dist/*'
174206
- name: Publish to PyPI
175207
if: ${{ startsWith(github.ref, 'refs/tags/') }}
176208
uses: PyO3/maturin-action@v1
177209
env:
178210
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
179211
with:
180212
command: upload
181-
args: --non-interactive --skip-existing wheels-*/*
213+
args: --non-interactive --skip-existing dist/*

oxmpl-py/Cargo.lock

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

oxmpl-py/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name = "oxmpl-py"
33
version = "0.1.0"
44
edition = "2021"
55
authors = ["Junior Sundar <[email protected]>"]
6-
description = "Python bindings for the oxmpl library"
7-
license = "MIT"
6+
description = "Python Bindings for the OxMPL Library"
7+
license = "BSD-3"
88

99
[lib]
1010
name = "oxmpl_py"
@@ -13,3 +13,4 @@ crate-type = ["cdylib"]
1313
[dependencies]
1414
pyo3 = { version = "0.24.0", features = ["extension-module"] }
1515
oxmpl = { path = "../oxmpl" }
16+
rand = "0.9.1"

oxmpl-py/pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,11 @@ classifiers = [
1111
"Programming Language :: Python :: Implementation :: PyPy",
1212
]
1313
dynamic = ["version"]
14+
15+
[dependency-groups]
16+
dev = [
17+
"pytest>=8.4.0",
18+
]
19+
1420
[tool.maturin]
1521
features = ["pyo3/extension-module"]

0 commit comments

Comments
 (0)