solidfunc 0.1.0a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- solidfunc-0.1.0a1/.cargo/config.toml +2 -0
- solidfunc-0.1.0a1/.github/workflows/build.yml +87 -0
- solidfunc-0.1.0a1/.github/workflows/ci.yml +45 -0
- solidfunc-0.1.0a1/.github/workflows/publish.yml +57 -0
- solidfunc-0.1.0a1/.gitignore +12 -0
- solidfunc-0.1.0a1/.python-version +1 -0
- solidfunc-0.1.0a1/Cargo.lock +264 -0
- solidfunc-0.1.0a1/Cargo.toml +31 -0
- solidfunc-0.1.0a1/LICENSE +21 -0
- solidfunc-0.1.0a1/PKG-INFO +138 -0
- solidfunc-0.1.0a1/README.md +112 -0
- solidfunc-0.1.0a1/examples/hello_world.py +13 -0
- solidfunc-0.1.0a1/licenses/SolidCore-ATTRIBUTION.md +101 -0
- solidfunc-0.1.0a1/licenses/SolidCore-LICENSE +203 -0
- solidfunc-0.1.0a1/licenses/SolidCore-NOTICE +30 -0
- solidfunc-0.1.0a1/pyproject.toml +73 -0
- solidfunc-0.1.0a1/python/solidfunc/__init__.py +25 -0
- solidfunc-0.1.0a1/python/solidfunc/_api.py +64 -0
- solidfunc-0.1.0a1/python/solidfunc/_core.pyi +17 -0
- solidfunc-0.1.0a1/python/solidfunc/py.typed +0 -0
- solidfunc-0.1.0a1/rust-toolchain.toml +4 -0
- solidfunc-0.1.0a1/src/lib.rs +82 -0
- solidfunc-0.1.0a1/tests/test_geometry.py +41 -0
- solidfunc-0.1.0a1/tests/test_step_export.py +45 -0
- solidfunc-0.1.0a1/uv.lock +932 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
name: Build distributions
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
wheels:
|
|
12
|
+
name: Wheel / ${{ matrix.platform }}
|
|
13
|
+
runs-on: ${{ matrix.runner }}
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
include:
|
|
18
|
+
- platform: linux-x86_64
|
|
19
|
+
runner: ubuntu-24.04
|
|
20
|
+
target: x86_64
|
|
21
|
+
manylinux: "2_28"
|
|
22
|
+
- platform: linux-aarch64
|
|
23
|
+
runner: ubuntu-24.04-arm
|
|
24
|
+
target: aarch64
|
|
25
|
+
manylinux: "2_28"
|
|
26
|
+
- platform: windows-x86_64
|
|
27
|
+
runner: windows-latest
|
|
28
|
+
target: x86_64
|
|
29
|
+
manylinux: auto
|
|
30
|
+
- platform: macos-aarch64
|
|
31
|
+
runner: macos-15
|
|
32
|
+
target: aarch64
|
|
33
|
+
manylinux: auto
|
|
34
|
+
- platform: macos-x86_64
|
|
35
|
+
runner: macos-15-intel
|
|
36
|
+
target: x86_64
|
|
37
|
+
manylinux: auto
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v7.0.1
|
|
40
|
+
- uses: actions/setup-python@v7.1.0
|
|
41
|
+
with:
|
|
42
|
+
python-version: "3.11"
|
|
43
|
+
- name: Build stable ABI wheel
|
|
44
|
+
uses: PyO3/maturin-action@v1.51.0
|
|
45
|
+
with:
|
|
46
|
+
command: build
|
|
47
|
+
target: ${{ matrix.target }}
|
|
48
|
+
manylinux: ${{ matrix.manylinux }}
|
|
49
|
+
args: --release --locked --out dist
|
|
50
|
+
rust-toolchain: "1.96.0"
|
|
51
|
+
- name: Install and test built wheel
|
|
52
|
+
shell: bash
|
|
53
|
+
run: |
|
|
54
|
+
python -m pip install --pre --only-binary=solidfunc --no-index --find-links dist solidfunc
|
|
55
|
+
python -m pip install pytest
|
|
56
|
+
python -m pytest
|
|
57
|
+
python examples/hello_world.py
|
|
58
|
+
- uses: actions/upload-artifact@v7.0.2
|
|
59
|
+
with:
|
|
60
|
+
name: wheels-${{ matrix.platform }}
|
|
61
|
+
path: dist/*.whl
|
|
62
|
+
if-no-files-found: error
|
|
63
|
+
|
|
64
|
+
sdist:
|
|
65
|
+
name: Source distribution
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
steps:
|
|
68
|
+
- uses: actions/checkout@v7.0.1
|
|
69
|
+
- uses: astral-sh/setup-uv@v10.3.3
|
|
70
|
+
- name: Build sdist and rebuild a wheel from it
|
|
71
|
+
run: uv build
|
|
72
|
+
- name: Check distribution metadata
|
|
73
|
+
run: uvx twine check dist/*
|
|
74
|
+
- uses: actions/setup-python@v7.1.0
|
|
75
|
+
with:
|
|
76
|
+
python-version: "3.11"
|
|
77
|
+
- name: Test wheel rebuilt from sdist
|
|
78
|
+
run: |
|
|
79
|
+
python -m pip install --pre --only-binary=solidfunc --no-index --find-links dist solidfunc
|
|
80
|
+
python -m pip install pytest
|
|
81
|
+
python -m pytest
|
|
82
|
+
python examples/hello_world.py
|
|
83
|
+
- uses: actions/upload-artifact@v7.0.2
|
|
84
|
+
with:
|
|
85
|
+
name: sdist
|
|
86
|
+
path: dist/*.tar.gz
|
|
87
|
+
if-no-files-found: error
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ci-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
checks:
|
|
18
|
+
name: Python ${{ matrix.python }}
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
strategy:
|
|
21
|
+
fail-fast: false
|
|
22
|
+
matrix:
|
|
23
|
+
python: ["3.11", "3.14"]
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v7.0.1
|
|
26
|
+
- uses: astral-sh/setup-uv@v10.3.3
|
|
27
|
+
with:
|
|
28
|
+
enable-cache: true
|
|
29
|
+
- name: Install Rust toolchain
|
|
30
|
+
run: rustup show active-toolchain
|
|
31
|
+
- name: Install package and development tools
|
|
32
|
+
run: uv sync --locked --python ${{ matrix.python }} --config-setting build-args=--profile=dev
|
|
33
|
+
- run: uv run --no-sync ruff check .
|
|
34
|
+
- run: uv run --no-sync ruff format --check .
|
|
35
|
+
- run: uv run --no-sync mypy
|
|
36
|
+
- run: cargo fmt --all --check
|
|
37
|
+
- run: cargo clippy --locked --all-targets -- -D warnings
|
|
38
|
+
- run: uv run --no-sync pytest
|
|
39
|
+
- name: Check STEP exchange with CadQuery
|
|
40
|
+
if: matrix.python == '3.11'
|
|
41
|
+
run: uv run --no-sync --with 'cadquery>=2.8,<3' pytest tests/test_step_export.py
|
|
42
|
+
- run: uv run --no-sync python examples/hello_world.py
|
|
43
|
+
|
|
44
|
+
distributions:
|
|
45
|
+
uses: ./.github/workflows/build.yml
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
version:
|
|
12
|
+
name: Check release tag
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v7.0.1
|
|
16
|
+
- uses: astral-sh/setup-uv@v10.3.3
|
|
17
|
+
- name: Verify tag matches package metadata
|
|
18
|
+
env:
|
|
19
|
+
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
|
20
|
+
run: |
|
|
21
|
+
uv run --no-project --with packaging python -c '
|
|
22
|
+
import os, tomllib
|
|
23
|
+
from packaging.version import Version
|
|
24
|
+
with open("Cargo.toml", "rb") as stream:
|
|
25
|
+
version = Version(tomllib.load(stream)["package"]["version"])
|
|
26
|
+
tag = os.environ["RELEASE_TAG"]
|
|
27
|
+
expected = f"v{version}"
|
|
28
|
+
if tag != expected:
|
|
29
|
+
raise SystemExit(f"Release tag {tag!r} must be {expected!r}")
|
|
30
|
+
'
|
|
31
|
+
|
|
32
|
+
build:
|
|
33
|
+
needs: version
|
|
34
|
+
uses: ./.github/workflows/build.yml
|
|
35
|
+
|
|
36
|
+
publish:
|
|
37
|
+
name: Publish verified distributions
|
|
38
|
+
needs: build
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
environment:
|
|
41
|
+
name: pypi
|
|
42
|
+
url: https://pypi.org/p/solidfunc
|
|
43
|
+
permissions:
|
|
44
|
+
id-token: write
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/download-artifact@v8.0.2
|
|
47
|
+
with:
|
|
48
|
+
pattern: wheels-*
|
|
49
|
+
merge-multiple: true
|
|
50
|
+
path: dist
|
|
51
|
+
- uses: actions/download-artifact@v8.0.2
|
|
52
|
+
with:
|
|
53
|
+
name: sdist
|
|
54
|
+
path: dist
|
|
55
|
+
- uses: astral-sh/setup-uv@v10.3.3
|
|
56
|
+
- name: Publish using PyPI trusted publishing
|
|
57
|
+
run: uv publish --trusted-publishing always dist/*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.14
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "heck"
|
|
7
|
+
version = "0.5.0"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "itoa"
|
|
13
|
+
version = "1.0.19"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4"
|
|
16
|
+
|
|
17
|
+
[[package]]
|
|
18
|
+
name = "libc"
|
|
19
|
+
version = "0.2.191"
|
|
20
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
21
|
+
checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
|
|
22
|
+
|
|
23
|
+
[[package]]
|
|
24
|
+
name = "memchr"
|
|
25
|
+
version = "2.8.3"
|
|
26
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
27
|
+
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
28
|
+
|
|
29
|
+
[[package]]
|
|
30
|
+
name = "once_cell"
|
|
31
|
+
version = "1.21.4"
|
|
32
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
33
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
34
|
+
|
|
35
|
+
[[package]]
|
|
36
|
+
name = "portable-atomic"
|
|
37
|
+
version = "1.15.0"
|
|
38
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
39
|
+
checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
|
|
40
|
+
|
|
41
|
+
[[package]]
|
|
42
|
+
name = "proc-macro2"
|
|
43
|
+
version = "1.0.107"
|
|
44
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
45
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
46
|
+
dependencies = [
|
|
47
|
+
"unicode-ident",
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
[[package]]
|
|
51
|
+
name = "pyo3"
|
|
52
|
+
version = "0.30.1"
|
|
53
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
54
|
+
checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
|
|
55
|
+
dependencies = [
|
|
56
|
+
"libc",
|
|
57
|
+
"once_cell",
|
|
58
|
+
"portable-atomic",
|
|
59
|
+
"pyo3-build-config",
|
|
60
|
+
"pyo3-ffi",
|
|
61
|
+
"pyo3-macros",
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
[[package]]
|
|
65
|
+
name = "pyo3-build-config"
|
|
66
|
+
version = "0.30.1"
|
|
67
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
68
|
+
checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
|
|
69
|
+
dependencies = [
|
|
70
|
+
"target-lexicon",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
[[package]]
|
|
74
|
+
name = "pyo3-ffi"
|
|
75
|
+
version = "0.30.1"
|
|
76
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
77
|
+
checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
|
|
78
|
+
dependencies = [
|
|
79
|
+
"libc",
|
|
80
|
+
"pyo3-build-config",
|
|
81
|
+
]
|
|
82
|
+
|
|
83
|
+
[[package]]
|
|
84
|
+
name = "pyo3-macros"
|
|
85
|
+
version = "0.30.1"
|
|
86
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
87
|
+
checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
|
|
88
|
+
dependencies = [
|
|
89
|
+
"proc-macro2",
|
|
90
|
+
"pyo3-macros-backend",
|
|
91
|
+
"quote",
|
|
92
|
+
"syn",
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
[[package]]
|
|
96
|
+
name = "pyo3-macros-backend"
|
|
97
|
+
version = "0.30.1"
|
|
98
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
99
|
+
checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
|
|
100
|
+
dependencies = [
|
|
101
|
+
"heck",
|
|
102
|
+
"proc-macro2",
|
|
103
|
+
"quote",
|
|
104
|
+
"syn",
|
|
105
|
+
]
|
|
106
|
+
|
|
107
|
+
[[package]]
|
|
108
|
+
name = "quote"
|
|
109
|
+
version = "1.0.47"
|
|
110
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
111
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
112
|
+
dependencies = [
|
|
113
|
+
"proc-macro2",
|
|
114
|
+
]
|
|
115
|
+
|
|
116
|
+
[[package]]
|
|
117
|
+
name = "serde"
|
|
118
|
+
version = "1.0.229"
|
|
119
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
120
|
+
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
|
|
121
|
+
dependencies = [
|
|
122
|
+
"serde_core",
|
|
123
|
+
"serde_derive",
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
[[package]]
|
|
127
|
+
name = "serde_core"
|
|
128
|
+
version = "1.0.229"
|
|
129
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
130
|
+
checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
|
|
131
|
+
dependencies = [
|
|
132
|
+
"serde_derive",
|
|
133
|
+
]
|
|
134
|
+
|
|
135
|
+
[[package]]
|
|
136
|
+
name = "serde_derive"
|
|
137
|
+
version = "1.0.229"
|
|
138
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
139
|
+
checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
|
|
140
|
+
dependencies = [
|
|
141
|
+
"proc-macro2",
|
|
142
|
+
"quote",
|
|
143
|
+
"syn",
|
|
144
|
+
]
|
|
145
|
+
|
|
146
|
+
[[package]]
|
|
147
|
+
name = "serde_json"
|
|
148
|
+
version = "1.0.154"
|
|
149
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
150
|
+
checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
|
|
151
|
+
dependencies = [
|
|
152
|
+
"itoa",
|
|
153
|
+
"memchr",
|
|
154
|
+
"serde",
|
|
155
|
+
"serde_core",
|
|
156
|
+
"zmij",
|
|
157
|
+
]
|
|
158
|
+
|
|
159
|
+
[[package]]
|
|
160
|
+
name = "solidcore"
|
|
161
|
+
version = "1.0.1"
|
|
162
|
+
source = "git+https://github.com/tangency-labs/solidcore?rev=cb9bee4bb9f56880c9973a9f8e99c83fdec24ad3#cb9bee4bb9f56880c9973a9f8e99c83fdec24ad3"
|
|
163
|
+
dependencies = [
|
|
164
|
+
"serde",
|
|
165
|
+
"thiserror",
|
|
166
|
+
]
|
|
167
|
+
|
|
168
|
+
[[package]]
|
|
169
|
+
name = "solidcore-convert"
|
|
170
|
+
version = "0.1.0"
|
|
171
|
+
source = "git+https://github.com/tangency-labs/solidcore?rev=cb9bee4bb9f56880c9973a9f8e99c83fdec24ad3#cb9bee4bb9f56880c9973a9f8e99c83fdec24ad3"
|
|
172
|
+
dependencies = [
|
|
173
|
+
"solidcore",
|
|
174
|
+
"solidcore-record",
|
|
175
|
+
]
|
|
176
|
+
|
|
177
|
+
[[package]]
|
|
178
|
+
name = "solidcore-ops"
|
|
179
|
+
version = "0.1.0"
|
|
180
|
+
source = "git+https://github.com/tangency-labs/solidcore?rev=cb9bee4bb9f56880c9973a9f8e99c83fdec24ad3#cb9bee4bb9f56880c9973a9f8e99c83fdec24ad3"
|
|
181
|
+
dependencies = [
|
|
182
|
+
"solidcore",
|
|
183
|
+
"solidcore-convert",
|
|
184
|
+
"solidcore-record",
|
|
185
|
+
]
|
|
186
|
+
|
|
187
|
+
[[package]]
|
|
188
|
+
name = "solidcore-record"
|
|
189
|
+
version = "0.1.0"
|
|
190
|
+
source = "git+https://github.com/tangency-labs/solidcore?rev=cb9bee4bb9f56880c9973a9f8e99c83fdec24ad3#cb9bee4bb9f56880c9973a9f8e99c83fdec24ad3"
|
|
191
|
+
dependencies = [
|
|
192
|
+
"serde",
|
|
193
|
+
"serde_json",
|
|
194
|
+
"thiserror",
|
|
195
|
+
]
|
|
196
|
+
|
|
197
|
+
[[package]]
|
|
198
|
+
name = "solidcore-step"
|
|
199
|
+
version = "0.1.0"
|
|
200
|
+
source = "git+https://github.com/tangency-labs/solidcore?rev=cb9bee4bb9f56880c9973a9f8e99c83fdec24ad3#cb9bee4bb9f56880c9973a9f8e99c83fdec24ad3"
|
|
201
|
+
dependencies = [
|
|
202
|
+
"solidcore",
|
|
203
|
+
"solidcore-convert",
|
|
204
|
+
"solidcore-ops",
|
|
205
|
+
"solidcore-record",
|
|
206
|
+
]
|
|
207
|
+
|
|
208
|
+
[[package]]
|
|
209
|
+
name = "solidfunc"
|
|
210
|
+
version = "0.1.0-alpha.1"
|
|
211
|
+
dependencies = [
|
|
212
|
+
"pyo3",
|
|
213
|
+
"solidcore-ops",
|
|
214
|
+
"solidcore-step",
|
|
215
|
+
]
|
|
216
|
+
|
|
217
|
+
[[package]]
|
|
218
|
+
name = "syn"
|
|
219
|
+
version = "3.0.10"
|
|
220
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
221
|
+
checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
|
|
222
|
+
dependencies = [
|
|
223
|
+
"proc-macro2",
|
|
224
|
+
"quote",
|
|
225
|
+
"unicode-ident",
|
|
226
|
+
]
|
|
227
|
+
|
|
228
|
+
[[package]]
|
|
229
|
+
name = "target-lexicon"
|
|
230
|
+
version = "0.13.6"
|
|
231
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
232
|
+
checksum = "8c447be3a2abfa84b2d91680c56600bd6b2873866de27b36ec911be705e291da"
|
|
233
|
+
|
|
234
|
+
[[package]]
|
|
235
|
+
name = "thiserror"
|
|
236
|
+
version = "2.0.21"
|
|
237
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
238
|
+
checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"
|
|
239
|
+
dependencies = [
|
|
240
|
+
"thiserror-impl",
|
|
241
|
+
]
|
|
242
|
+
|
|
243
|
+
[[package]]
|
|
244
|
+
name = "thiserror-impl"
|
|
245
|
+
version = "2.0.21"
|
|
246
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
247
|
+
checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
|
|
248
|
+
dependencies = [
|
|
249
|
+
"proc-macro2",
|
|
250
|
+
"quote",
|
|
251
|
+
"syn",
|
|
252
|
+
]
|
|
253
|
+
|
|
254
|
+
[[package]]
|
|
255
|
+
name = "unicode-ident"
|
|
256
|
+
version = "1.0.27"
|
|
257
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
258
|
+
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
|
259
|
+
|
|
260
|
+
[[package]]
|
|
261
|
+
name = "zmij"
|
|
262
|
+
version = "1.0.23"
|
|
263
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
264
|
+
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "solidfunc"
|
|
3
|
+
version = "0.1.0-alpha.1"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
rust-version = "1.96"
|
|
6
|
+
description = "An experimental functional Python API for SolidCore."
|
|
7
|
+
license = "MIT"
|
|
8
|
+
repository = "https://github.com/DavidMStraub/solidfunc"
|
|
9
|
+
publish = false
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
|
|
12
|
+
[lib]
|
|
13
|
+
name = "_core"
|
|
14
|
+
crate-type = ["cdylib"]
|
|
15
|
+
|
|
16
|
+
[dependencies]
|
|
17
|
+
pyo3 = { version = "0.30.1", features = ["abi3-py311"] }
|
|
18
|
+
solidcore-ops = { git = "https://github.com/tangency-labs/solidcore", rev = "cb9bee4bb9f56880c9973a9f8e99c83fdec24ad3" }
|
|
19
|
+
solidcore-step = { git = "https://github.com/tangency-labs/solidcore", rev = "cb9bee4bb9f56880c9973a9f8e99c83fdec24ad3" }
|
|
20
|
+
|
|
21
|
+
[lints.rust]
|
|
22
|
+
unsafe_code = "forbid"
|
|
23
|
+
|
|
24
|
+
[lints.clippy]
|
|
25
|
+
unwrap_used = "deny"
|
|
26
|
+
expect_used = "deny"
|
|
27
|
+
panic = "deny"
|
|
28
|
+
|
|
29
|
+
[profile.release]
|
|
30
|
+
debug = 0
|
|
31
|
+
strip = "debuginfo"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 David Straub
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: solidfunc
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
5
|
+
Classifier: Intended Audience :: Science/Research
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
11
|
+
Classifier: Programming Language :: Rust
|
|
12
|
+
Classifier: Typing :: Typed
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
License-File: licenses/SolidCore-ATTRIBUTION.md
|
|
15
|
+
License-File: licenses/SolidCore-LICENSE
|
|
16
|
+
License-File: licenses/SolidCore-NOTICE
|
|
17
|
+
Summary: An experimental functional Python API for SolidCore.
|
|
18
|
+
Keywords: cad,geometry,solidcore,functional
|
|
19
|
+
Author: David Straub
|
|
20
|
+
License-Expression: MIT
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
23
|
+
Project-URL: Issues, https://github.com/DavidMStraub/solidfunc/issues
|
|
24
|
+
Project-URL: Repository, https://github.com/DavidMStraub/solidfunc
|
|
25
|
+
|
|
26
|
+
# solidfunc
|
|
27
|
+
|
|
28
|
+
An experimental functional Python API for [SolidCore](https://github.com/tangency-labs/solidcore).
|
|
29
|
+
|
|
30
|
+
This is a small academic exploration of typed, functional CAD as code, informed
|
|
31
|
+
by [CadQuery](https://github.com/CadQuery/cadquery),
|
|
32
|
+
[build123d](https://github.com/gumyr/build123d), and
|
|
33
|
+
[CAD as Code](https://github.com/DavidMStraub/cad-as-code-book). Its scope is a
|
|
34
|
+
limited set of examples for investigating API design and kernel behavior.
|
|
35
|
+
|
|
36
|
+
## Hello world
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
import solidfunc as sf
|
|
40
|
+
|
|
41
|
+
block = sf.box(length=10, width=20, height=30)
|
|
42
|
+
moved = sf.translate(block, x=100)
|
|
43
|
+
|
|
44
|
+
print(sf.volume(block)) # 6000.0 mm³
|
|
45
|
+
print(sf.bounds(block)) # ((0.0, 0.0, 0.0), (10.0, 20.0, 30.0))
|
|
46
|
+
print(sf.bounds(moved)) # ((100.0, 0.0, 0.0), (110.0, 20.0, 30.0))
|
|
47
|
+
|
|
48
|
+
sf.export_step(block, "hello.step")
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Geometry is opaque. Functions return new geometry and preserve their inputs.
|
|
52
|
+
Lengths are millimetres, volumes are cubic millimetres, and a box's `origin`
|
|
53
|
+
is its lower corner. Currently implemented: `box`, `translate`, `volume`,
|
|
54
|
+
`bounds`, and `export_step`. This initial example exercises SolidCore itself.
|
|
55
|
+
|
|
56
|
+
The example writes a STEP AP242 file that can be opened in other CAD tools.
|
|
57
|
+
With CadQuery and OCP CAD Viewer installed, view it using:
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
import cadquery as cq
|
|
61
|
+
from ocp_vscode import show
|
|
62
|
+
|
|
63
|
+
show(cq.importers.importStep("hello.step"))
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
CadQuery and the viewer are optional tools for inspecting exported geometry.
|
|
67
|
+
|
|
68
|
+
## Development
|
|
69
|
+
|
|
70
|
+
Install [uv](https://docs.astral.sh/uv/) and [Rust](https://rustup.rs/), then:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
git clone https://github.com/DavidMStraub/solidfunc.git
|
|
74
|
+
cd solidfunc
|
|
75
|
+
uv sync --locked --config-setting build-args=--profile=dev
|
|
76
|
+
uv run --no-sync python examples/hello_world.py
|
|
77
|
+
uv run --no-sync pytest
|
|
78
|
+
uv run --no-sync ruff check .
|
|
79
|
+
uv run --no-sync ruff format --check .
|
|
80
|
+
uv run --no-sync mypy
|
|
81
|
+
cargo fmt --all --check
|
|
82
|
+
cargo clippy --locked --all-targets -- -D warnings
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The project uses a mixed Python/Rust layout: the public typed API lives in
|
|
86
|
+
`python/solidfunc`, and the private PyO3 extension in `src/lib.rs` calls
|
|
87
|
+
`solidcore-ops` and `solidcore-step`. Maturin builds and installs the extension
|
|
88
|
+
during `uv sync`; the development command above uses the faster debug profile.
|
|
89
|
+
Python 3.11+ is supported using the CPython stable ABI (`abi3`).
|
|
90
|
+
|
|
91
|
+
SolidCore is pinned to commit `cb9bee4bb9f56880c9973a9f8e99c83fdec24ad3`
|
|
92
|
+
in `Cargo.toml`; `Cargo.lock` and `uv.lock` pin the resolved dependencies.
|
|
93
|
+
Updating the kernel is an explicit change to that revision followed by a
|
|
94
|
+
lockfile update and the geometry checks.
|
|
95
|
+
|
|
96
|
+
To check STEP exchange against CadQuery's independent kernel:
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
uv run --no-sync --with 'cadquery>=2.8,<3' pytest tests/test_step_export.py
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The CadQuery round-trip tests are skipped when that optional dependency is absent.
|
|
103
|
+
|
|
104
|
+
## Builds and publishing
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
uv build
|
|
108
|
+
uv run twine check dist/*
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
CI checks Python formatting, lint, typing, and geometry behavior, plus Rust
|
|
112
|
+
formatting and clippy. The reusable wheel workflow builds and tests native
|
|
113
|
+
wheels for Linux, Windows, and macOS, and builds a source distribution.
|
|
114
|
+
The **Build distributions** workflow can also be run manually.
|
|
115
|
+
|
|
116
|
+
Publishing is a separate **Publish to PyPI** workflow triggered by a published
|
|
117
|
+
GitHub release. It checks that the tag matches the package version, builds and
|
|
118
|
+
tests the distributions, and publishes with OIDC trusted publishing.
|
|
119
|
+
|
|
120
|
+
Before the first release, register a pending trusted publisher on PyPI:
|
|
121
|
+
|
|
122
|
+
| Setting | Value |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| PyPI project | `solidfunc` |
|
|
125
|
+
| GitHub owner | `DavidMStraub` |
|
|
126
|
+
| Repository | `solidfunc` |
|
|
127
|
+
| Workflow filename | `publish.yml` |
|
|
128
|
+
| Environment | `pypi` |
|
|
129
|
+
|
|
130
|
+
The initial Cargo version `0.1.0-alpha.1` maps to Python version `0.1.0a1`.
|
|
131
|
+
Publish a GitHub release tagged `v0.1.0a1` to release it. No PyPI API token is
|
|
132
|
+
needed. Creating the repository or pushing a commit does not publish a package.
|
|
133
|
+
|
|
134
|
+
## License
|
|
135
|
+
|
|
136
|
+
solidfunc is MIT licensed. SolidCore and its SMLib-derived code are Apache-2.0
|
|
137
|
+
licensed; the distribution includes the corresponding upstream notices.
|
|
138
|
+
|