nc-gcode-interpreter 0.1.9__tar.gz → 0.1.10__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.
Files changed (60) hide show
  1. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/.github/workflows/build-and-release.yml +79 -63
  2. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/Cargo.lock +2 -2
  3. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/Cargo.toml +1 -1
  4. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/PKG-INFO +8 -8
  5. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/pyproject.toml +2 -2
  6. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/.gitignore +0 -0
  7. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/CONTRIBUTING.md +0 -0
  8. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/Development.md +0 -0
  9. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/LICENSE +0 -0
  10. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/README.md +0 -0
  11. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/TODO.md +0 -0
  12. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/arrays.csv +0 -0
  13. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/arrays.mpf +0 -0
  14. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/basic_math.csv +0 -0
  15. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/basic_math.mpf +0 -0
  16. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/custom_vars.csv +0 -0
  17. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/custom_vars.mpf +0 -0
  18. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/defaults.csv +0 -0
  19. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/defaults.mpf +0 -0
  20. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/for_loop.csv +0 -0
  21. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/for_loop.mpf +0 -0
  22. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/function_calls.csv +0 -0
  23. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/function_calls.mpf +0 -0
  24. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/if_statement.csv +0 -0
  25. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/if_statement.mpf +0 -0
  26. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/increment.csv +0 -0
  27. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/increment.mpf +0 -0
  28. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/loop.csv +0 -0
  29. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/loop.mpf +0 -0
  30. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/multiple_m_codes.csv +0 -0
  31. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/multiple_m_codes.mpf +0 -0
  32. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/simple.csv +0 -0
  33. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/simple.mpf +0 -0
  34. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/tool.csv +0 -0
  35. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/tool.mpf +0 -0
  36. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/trans.csv +0 -0
  37. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/trans.mpf +0 -0
  38. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/variables.csv +0 -0
  39. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/examples/variables.mpf +0 -0
  40. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/ggroups/generate_modal_ggroups.py +0 -0
  41. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/ggroups/generate_pest.py +0 -0
  42. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/ggroups/ggroups.pest +0 -0
  43. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/python/example/minimal.py +0 -0
  44. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/python/nc_gcode_interpreter/__init__.py +0 -0
  45. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/python/nc_gcode_interpreter/_internal.pyi +0 -0
  46. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/python/nc_gcode_interpreter/ggroups.json +0 -0
  47. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/python/nc_gcode_interpreter/py.typed +0 -0
  48. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/python/tests/test_expected_output.py +0 -0
  49. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/python/tests/test_g_groups.py +0 -0
  50. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/rustfmt.toml +0 -0
  51. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/src/errors.rs +0 -0
  52. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/src/grammar.pest +0 -0
  53. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/src/interpret_rules.rs +0 -0
  54. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/src/interpreter.rs +0 -0
  55. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/src/lib.rs +0 -0
  56. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/src/main.rs +0 -0
  57. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/src/modal_groups.rs +0 -0
  58. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/src/state.rs +0 -0
  59. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/src/types.rs +0 -0
  60. {nc_gcode_interpreter-0.1.9 → nc_gcode_interpreter-0.1.10}/uv.lock +0 -0
@@ -7,7 +7,7 @@
7
7
  # - build using binary bindings
8
8
  # - extract the binaries from the wheel
9
9
  # - upload both the wheel and the binary to the release
10
- # - disable some platforms
10
+ # - disable some platforms
11
11
 
12
12
  name: Build and Release
13
13
 
@@ -33,7 +33,7 @@ jobs:
33
33
  - uses: actions/checkout@v4
34
34
  - uses: actions/setup-python@v5
35
35
  with:
36
- python-version: 3.12
36
+ python-version: 3.13
37
37
  - name: Install Python linter
38
38
  run: pip install ruff
39
39
  - name: Lint Python code with ruff
@@ -47,11 +47,12 @@ jobs:
47
47
  platform:
48
48
  - runner: ubuntu-latest
49
49
  target: x86_64
50
+ python-version: ["3.12", "3.13"]
50
51
  steps:
51
52
  - uses: actions/checkout@v4
52
53
  - uses: actions/setup-python@v5
53
54
  with:
54
- python-version: 3.12
55
+ python-version: ${{ matrix.python-version }}
55
56
  - name: Update Cargo.toml Version
56
57
  if: startsWith(github.ref, 'refs/tags/')
57
58
  run: |
@@ -68,25 +69,40 @@ jobs:
68
69
  - name: Upload wheels
69
70
  uses: actions/upload-artifact@v4
70
71
  with:
71
- name: wheels-linux-${{ matrix.platform.target }}
72
+ name: wheels-linux-${{ matrix.platform.target }}-py${{ matrix.python-version }}
72
73
  path: dist
73
74
 
74
75
  test:
75
76
  needs: [linux-x64]
76
77
  runs-on: ubuntu-latest
78
+ strategy:
79
+ matrix:
80
+ python-version: ["3.12", "3.13"]
77
81
  steps:
78
82
  - uses: actions/checkout@v4
79
83
  - uses: actions/download-artifact@v4
80
84
  with:
81
- name: wheels-linux-x86_64
85
+ name: wheels-linux-x86_64-py${{ matrix.python-version }}
82
86
  path: dist
83
87
  - uses: actions/setup-python@v5
84
88
  with:
85
- python-version: 3.12
89
+ python-version: ${{ matrix.python-version }}
86
90
  - name: Install py_opw_kinematics
91
+ shell: bash
87
92
  run: |
88
- WHL_FILE=$(ls dist/*cp312*.whl)
89
- pip install "${WHL_FILE}[test]"
93
+ set -e # Exit on error
94
+ PY_VERSION="${{ matrix.python-version }}"
95
+ PY_VERSION_NO_DOT="${PY_VERSION//./}"
96
+ WHL_FILES=(dist/*cp${PY_VERSION_NO_DOT}*.whl)
97
+ if [ ${#WHL_FILES[@]} -eq 0 ]; then
98
+ echo "No matching wheel files found!"
99
+ exit 1
100
+ fi
101
+ if [ ${#WHL_FILES[@]} -gt 1 ]; then
102
+ echo "Multiple wheel files found: ${WHL_FILES[*]}"
103
+ exit 1
104
+ fi
105
+ pip install "${WHL_FILES[0]}[test]"
90
106
  - name: Run tests with pytest
91
107
  run: pytest
92
108
  - name: Type checking with mypy
@@ -102,23 +118,23 @@ jobs:
102
118
  # target: x86
103
119
  - runner: ubuntu-latest
104
120
  target: aarch64
105
- # - runner: ubuntu-latest
106
- # target: armv7
107
- # - runner: ubuntu-latest
108
- # target: s390x
109
- # - runner: ubuntu-latest
110
- # target: ppc64le
121
+ python-version: ["3.12", "3.13"]
111
122
  steps:
112
123
  - uses: actions/checkout@v4
113
124
  - uses: actions/setup-python@v5
114
125
  with:
115
- python-version: 3.12
126
+ python-version: ${{ matrix.python-version }}
116
127
  - name: Update Cargo.toml Version
117
128
  if: startsWith(github.ref, 'refs/tags/')
129
+ shell: bash
118
130
  run: |
131
+ set -e # Exit on error
119
132
  VERSION=${GITHUB_REF#refs/tags/v}
120
133
  echo "Setting version to $VERSION"
121
- sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
134
+ if ! sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml; then
135
+ echo "Failed to update version in Cargo.toml"
136
+ exit 1
137
+ fi
122
138
  - name: Build wheels
123
139
  uses: PyO3/maturin-action@v1
124
140
  with:
@@ -129,42 +145,9 @@ jobs:
129
145
  - name: Upload wheels
130
146
  uses: actions/upload-artifact@v4
131
147
  with:
132
- name: wheels-linux-${{ matrix.platform.target }}
148
+ name: wheels-linux-${{ matrix.platform.target }}-py${{ matrix.python-version }}
133
149
  path: dist
134
150
 
135
-
136
- # musllinux:
137
- # needs: [lint, test]
138
- # runs-on: ${{ matrix.platform.runner }}
139
- # strategy:
140
- # matrix:
141
- # platform:
142
- # - runner: ubuntu-latest
143
- # target: x86_64
144
- # # - runner: ubuntu-latest
145
- # # target: x86
146
- # # - runner: ubuntu-latest
147
- # # target: aarch64
148
- # # - runner: ubuntu-latest
149
- # # target: armv7
150
- # steps:
151
- # - uses: actions/checkout@v4
152
- # - uses: actions/setup-python@v5
153
- # with:
154
- # python-version: '>=3.12'
155
- # - name: Build wheels
156
- # uses: PyO3/maturin-action@v1
157
- # with:
158
- # target: ${{ matrix.platform.target }}
159
- # args: --release --out dist --find-interpreter
160
- # sccache: 'true'
161
- # manylinux: musllinux_1_2
162
- # - name: Upload wheels
163
- # uses: actions/upload-artifact@v4
164
- # with:
165
- # name: wheels-musllinux-${{ matrix.platform.target }}
166
- # path: dist
167
-
168
151
  windows:
169
152
  if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
170
153
  needs: [lint, test]
@@ -174,21 +157,42 @@ jobs:
174
157
  platform:
175
158
  - runner: windows-latest
176
159
  target: x64
177
- # - runner: windows-latest
178
- # target: x86
160
+ python-version: ["3.12", "3.13"]
179
161
  steps:
180
162
  - uses: actions/checkout@v4
181
163
  - uses: actions/setup-python@v5
182
164
  with:
183
- python-version: 3.12
165
+ python-version: ${{ matrix.python-version }}
184
166
  architecture: ${{ matrix.platform.target }}
185
167
  - name: Update Cargo.toml Version
186
168
  if: startsWith(github.ref, 'refs/tags/')
187
169
  shell: pwsh
188
170
  run: |
189
- $VERSION = $env:GITHUB_REF -replace 'refs/tags/v',''
190
- Write-Host "Setting version to $VERSION"
191
- (Get-Content Cargo.toml) -replace '^version = ".*"', ('version = "' + $VERSION + '"') | Set-Content Cargo.toml
171
+ $ErrorActionPreference = "Stop"
172
+ try {
173
+ $VERSION = $env:GITHUB_REF -replace 'refs/tags/v',''
174
+ Write-Host "Setting version to $VERSION"
175
+
176
+ # Read Cargo.toml as UTF-8
177
+ $path = Resolve-Path Cargo.toml
178
+ $content = [System.IO.File]::ReadAllText($path, [System.Text.Encoding]::UTF8)
179
+
180
+ # Update version using multiline regex to match "version ="
181
+ $newContent = $content -replace '(?m)^\s*version\s*=\s*".*"', "version = `"$VERSION`""
182
+
183
+ if ($newContent -eq $content) {
184
+ throw "Version pattern not found in Cargo.toml"
185
+ }
186
+
187
+ # Write back with UTF-8 encoding
188
+ [System.IO.File]::WriteAllText($path, $newContent, [System.Text.Encoding]::UTF8)
189
+ Write-Host "Cargo.toml version updated successfully."
190
+ }
191
+ catch {
192
+ Write-Error "Failed to update version in Cargo.toml: $_"
193
+ exit 1
194
+ }
195
+
192
196
  - name: Build wheels
193
197
  uses: PyO3/maturin-action@v1
194
198
  with:
@@ -198,7 +202,7 @@ jobs:
198
202
  - name: Upload wheels
199
203
  uses: actions/upload-artifact@v4
200
204
  with:
201
- name: wheels-windows-${{ matrix.platform.target }}
205
+ name: wheels-windows-${{ matrix.platform.target }}-py${{ matrix.python-version }}
202
206
  path: dist
203
207
 
204
208
  macos:
@@ -208,20 +212,27 @@ jobs:
208
212
  strategy:
209
213
  matrix:
210
214
  platform:
211
- - runner: macos-12
215
+ - runner: macos-latest
212
216
  target: x86_64
213
- - runner: macos-14
217
+ - runner: macos-latest
214
218
  target: aarch64
219
+ python-version: ["3.12", "3.13"]
215
220
  steps:
216
221
  - uses: actions/checkout@v4
217
222
  - uses: actions/setup-python@v5
218
223
  with:
219
- python-version: 3.12
224
+ python-version: ${{ matrix.python-version }}
220
225
  - name: Update Cargo.toml Version
226
+ if: startsWith(github.ref, 'refs/tags/')
227
+ shell: bash
221
228
  run: |
229
+ set -e # Exit on error
222
230
  VERSION=${GITHUB_REF#refs/tags/v}
223
231
  echo "Setting version to $VERSION"
224
- sed -i '' "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
232
+ if ! sed -i '' "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml; then
233
+ echo "Failed to update version in Cargo.toml"
234
+ exit 1
235
+ fi
225
236
  - name: Build wheels
226
237
  uses: PyO3/maturin-action@v1
227
238
  with:
@@ -231,7 +242,7 @@ jobs:
231
242
  - name: Upload wheels
232
243
  uses: actions/upload-artifact@v4
233
244
  with:
234
- name: wheels-macos-${{ matrix.platform.target }}
245
+ name: wheels-macos-${{ matrix.platform.target }}-py${{ matrix.python-version }}
235
246
  path: dist
236
247
 
237
248
  sdist:
@@ -245,10 +256,15 @@ jobs:
245
256
  python-version: 3.12
246
257
  - name: Update Cargo.toml Version
247
258
  if: startsWith(github.ref, 'refs/tags/')
259
+ shell: bash
248
260
  run: |
261
+ set -e # Exit on error
249
262
  VERSION=${GITHUB_REF#refs/tags/v}
250
263
  echo "Setting version to $VERSION"
251
- sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
264
+ if ! sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml; then
265
+ echo "Failed to update version in Cargo.toml"
266
+ exit 1
267
+ fi
252
268
  - name: Build sdist
253
269
  uses: PyO3/maturin-action@v1
254
270
  with:
@@ -1,6 +1,6 @@
1
1
  # This file is automatically @generated by Cargo.
2
2
  # It is not intended for manual editing.
3
- version = 3
3
+ version = 4
4
4
 
5
5
  [[package]]
6
6
  name = "ahash"
@@ -724,7 +724,7 @@ dependencies = [
724
724
 
725
725
  [[package]]
726
726
  name = "nc-gcode-interpreter"
727
- version = "0.1.9"
727
+ version = "0.1.10"
728
728
  dependencies = [
729
729
  "clap",
730
730
  "csv",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "nc-gcode-interpreter"
3
- version = "0.1.9"
3
+ version = "0.1.10"
4
4
  edition = "2021"
5
5
 
6
6
  [lib]
@@ -1,24 +1,24 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: nc-gcode-interpreter
3
- Version: 0.1.9
3
+ Version: 0.1.10
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
- Classifier: Programming Language :: Python :: 3.11
7
6
  Classifier: Programming Language :: Python :: 3.12
7
+ Classifier: Programming Language :: Python :: 3.13
8
8
  Classifier: License :: OSI Approved :: MIT License
9
9
  Classifier: Operating System :: OS Independent
10
10
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
11
- Requires-Dist: maturin >=1.7.4
12
- Requires-Dist: polars[pyarrow] >=1.9.0
13
- Requires-Dist: jupyter >=1.1.1 ; extra == 'dev'
14
- Requires-Dist: pytest >=8.3.3 ; extra == 'test'
11
+ Requires-Dist: maturin>=1.7.4
12
+ Requires-Dist: polars[pyarrow]>=1.9.0
13
+ Requires-Dist: jupyter>=1.1.1 ; extra == 'dev'
14
+ Requires-Dist: pytest>=8.3.3 ; extra == 'test'
15
15
  Requires-Dist: mypy ; extra == 'test'
16
16
  Provides-Extra: dev
17
17
  Provides-Extra: test
18
18
  License-File: LICENSE
19
19
  Summary: A interpreter for NC (Numerical Control) GCode
20
20
  Author-email: CEAD Group <software@ceadgroup.com>
21
- Requires-Python: >=3.11
21
+ Requires-Python: >=3.12
22
22
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
23
23
  Project-URL: Homepage, https://github.com/CEAD-group/nc-gcode-interpreter
24
24
  Project-URL: Repository, https://github.com/CEAD-group/nc-gcode-interpreter.git
@@ -7,12 +7,12 @@ name = "nc-gcode-interpreter"
7
7
  dynamic = ["version"]
8
8
  description = "A interpreter for NC (Numerical Control) GCode"
9
9
  authors = [{ name = "CEAD Group", email = "software@ceadgroup.com" }]
10
- requires-python = ">=3.11"
10
+ requires-python = ">=3.12"
11
11
  classifiers = [
12
12
  "Programming Language :: Rust",
13
13
  "Programming Language :: Python :: Implementation :: CPython",
14
- "Programming Language :: Python :: 3.11",
15
14
  "Programming Language :: Python :: 3.12",
15
+ "Programming Language :: Python :: 3.13",
16
16
  "License :: OSI Approved :: MIT License",
17
17
  "Operating System :: OS Independent",
18
18
  "Topic :: Software Development :: Libraries :: Python Modules",