zacro 0.1.1__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.
zacro-0.1.1/.flake8 ADDED
@@ -0,0 +1,3 @@
1
+ [flake8]
2
+ # Only check E128 (continuation line indentation) that ruff doesn't handle well
3
+ select = E128
@@ -0,0 +1,48 @@
1
+ name: Bump Version and Create PR
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ bump_type:
7
+ description: 'Version bump type'
8
+ type: choice
9
+ required: true
10
+ default: 'patch'
11
+ options:
12
+ - major
13
+ - minor
14
+ - patch
15
+
16
+ permissions:
17
+ contents: write
18
+ pull-requests: write
19
+ actions: write
20
+
21
+ jobs:
22
+ bump-version:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - name: Checkout repository
26
+ uses: actions/checkout@v4
27
+ with:
28
+ fetch-depth: 0
29
+ token: ${{ secrets.AUTO_MERGE_PAT || secrets.GITHUB_TOKEN }}
30
+
31
+ - name: Set up Git
32
+ run: |
33
+ git config --global user.name "github-actions[bot]"
34
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
35
+
36
+ - name: Bump Version
37
+ id: bump
38
+ uses: iory/github-action-bump-version@v1.1.0
39
+ with:
40
+ bump_type: ${{ github.event.inputs.bump_type }}
41
+ github_token: ${{ secrets.AUTO_MERGE_PAT || secrets.GITHUB_TOKEN }}
42
+ base_branch: 'main'
43
+ labels: 'auto-merge-ok,release'
44
+
45
+ - name: Print Versions
46
+ run: |
47
+ echo "Current Version: ${{ steps.bump.outputs.current_version }}"
48
+ echo "New Version: ${{ steps.bump.outputs.new_version }}"
@@ -0,0 +1,189 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_run:
5
+ workflows: ["Run Tests"]
6
+ types:
7
+ - completed
8
+
9
+ jobs:
10
+ auto-merge:
11
+ runs-on: ubuntu-latest
12
+ outputs:
13
+ mergeResult: ${{ steps.merge.outputs.mergeResult }}
14
+ prLabels: ${{ steps.get_labels.outputs.labels }}
15
+ steps:
16
+ - name: Checkout repository
17
+ uses: actions/checkout@v4
18
+
19
+ - name: Get PR labels
20
+ id: get_labels
21
+ uses: actions/github-script@v6
22
+ with:
23
+ script: |
24
+ const prs = context.payload.workflow_run.pull_requests;
25
+ if (!prs || prs.length === 0) {
26
+ core.info("Could not find any pull requests in the workflow run.");
27
+ core.setOutput("labels", "[]");
28
+ return;
29
+ }
30
+ const prNumber = prs[0].number;
31
+ core.info(`Found PR number: ${prNumber}`);
32
+ const { data: pr } = await github.rest.pulls.get({
33
+ owner: context.repo.owner,
34
+ repo: context.repo.repo,
35
+ pull_number: prNumber,
36
+ });
37
+ const labels = pr.labels.map(label => label.name);
38
+ core.info(`Retrieved labels: ${labels}`);
39
+ core.setOutput("labels", JSON.stringify(labels));
40
+
41
+ - name: Debug labels output
42
+ run: |
43
+ echo "Labels output: ${{ steps.get_labels.outputs.labels }}"
44
+
45
+ - name: Auto merge if auto-merge-ok label exists
46
+ id: merge
47
+ if: contains(fromJson(steps.get_labels.outputs.labels), 'auto-merge-ok')
48
+ uses: pascalgn/automerge-action@v0.16.3
49
+ env:
50
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
51
+ MERGE_LABELS: "auto-merge-ok"
52
+ MERGE_METHOD: squash
53
+ MERGE_DELETE_BRANCH: true
54
+
55
+ tag-release:
56
+ runs-on: ubuntu-latest
57
+ needs: auto-merge
58
+ if: ${{ needs.auto-merge.outputs.mergeResult == 'merged' && contains(fromJson(needs.auto-merge.outputs.prLabels || '[]'), 'release') }}
59
+ steps:
60
+ - uses: actions/checkout@v4
61
+ with:
62
+ ref: main
63
+ fetch-depth: 0
64
+ submodules: true
65
+ token: ${{ secrets.GITHUB_TOKEN }}
66
+
67
+ - name: Debug outputs from auto-merge
68
+ run: |
69
+ echo "Merge Result: ${{ needs.auto-merge.outputs.mergeResult }}"
70
+ echo "PR Labels: ${{ needs.auto-merge.outputs.prLabels }}"
71
+
72
+ - name: Set up Python
73
+ uses: actions/setup-python@v4
74
+ with:
75
+ python-version: '3.10'
76
+
77
+ - name: Install Rust
78
+ uses: dtolnay/rust-toolchain@stable
79
+
80
+ - name: Install dependencies and build package
81
+ run: |
82
+ python -m pip install --upgrade pip
83
+ pip install maturin pytest
84
+ maturin build
85
+ pip install --find-links target/wheels zacro
86
+
87
+ - name: Get version from package
88
+ id: get_version
89
+ run: |
90
+ VERSION=$(python -c "import zacro; print(zacro.__version__)")
91
+ echo "Detected version: $VERSION"
92
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
93
+
94
+ - name: Tag and push release
95
+ run: |
96
+ git tag "v${{ steps.get_version.outputs.version }}"
97
+ git push origin "v${{ steps.get_version.outputs.version }}"
98
+
99
+ build_sdist:
100
+ runs-on: ubuntu-latest
101
+ needs: auto-merge
102
+ steps:
103
+ - name: Checkout repository
104
+ uses: actions/checkout@v4
105
+ with:
106
+ ref: main
107
+ submodules: true
108
+ - name: Set up Python
109
+ uses: actions/setup-python@v4
110
+ with:
111
+ python-version: '3.10'
112
+ - name: Install Rust
113
+ uses: dtolnay/rust-toolchain@stable
114
+ - name: Install build tool
115
+ run: python -m pip install maturin
116
+ - name: Build source distribution
117
+ run: maturin sdist -o dist
118
+ - name: Upload sdist artifact
119
+ uses: actions/upload-artifact@v4
120
+ with:
121
+ name: sdist-artifact
122
+ path: dist/*.tar.gz
123
+
124
+ build_wheels:
125
+ name: Build wheels on ${{ matrix.os }}
126
+ needs: auto-merge
127
+ runs-on: ${{ matrix.os }}
128
+ strategy:
129
+ matrix:
130
+ # https://github.com/actions/runner-images
131
+ # Note: To test macOS-x with Intel architecture,
132
+ # you need to use the paid macOS-x-large runner, as macOS-x is grouped with ARM-based runners.
133
+ # https://docs.github.com/en/actions/concepts/runners/about-larger-runners
134
+ os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
135
+
136
+ steps:
137
+ - uses: actions/checkout@v4
138
+ with:
139
+ ref: main
140
+ submodules: true
141
+ # Used to host cibuildwheel
142
+ - uses: actions/setup-python@v5
143
+ with:
144
+ python-version: "3.10"
145
+
146
+ - name: Install Rust
147
+ uses: dtolnay/rust-toolchain@stable
148
+
149
+ - name: Install cibuildwheel
150
+ run: python -m pip install cibuildwheel==2.16.2
151
+
152
+ - name: Build wheels
153
+ run: python -m cibuildwheel --output-dir wheelhouse
154
+ env:
155
+ CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*"
156
+ CIBW_SKIP: "cp38-win32 cp39-win32 cp310-win32 cp311-win32 cp312-win32 *-win32 *-musllinux* *-manylinux_i686"
157
+ CIBW_BEFORE_ALL_LINUX: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && source ~/.cargo/env"
158
+ CIBW_ENVIRONMENT_LINUX: "PATH=$HOME/.cargo/bin:$PATH"
159
+ CIBW_BEFORE_ALL_MACOS: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && source ~/.cargo/env"
160
+ CIBW_ENVIRONMENT_MACOS: "PATH=$HOME/.cargo/bin:$PATH"
161
+ CIBW_BEFORE_ALL_WINDOWS: "choco install rust -y"
162
+
163
+ - uses: actions/upload-artifact@v4
164
+ with:
165
+ name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
166
+ path: ./wheelhouse/*.whl
167
+
168
+ upload_pypi:
169
+ needs: [build_wheels, build_sdist, tag-release]
170
+ runs-on: ubuntu-latest
171
+ environment: pypi
172
+ steps:
173
+ - uses: actions/setup-python@v4
174
+ with:
175
+ python-version: "3.12"
176
+ - uses: actions/download-artifact@v4
177
+ with:
178
+ # unpacks all CIBW artifacts into dist/
179
+ path: dist
180
+ pattern: cibw-wheels-*
181
+ merge-multiple: true
182
+ - name: Download sdist artifact
183
+ uses: actions/download-artifact@v4
184
+ with:
185
+ name: sdist-artifact
186
+ path: dist
187
+ - uses: pypa/gh-action-pypi-publish@release/v1
188
+ with:
189
+ password: ${{ secrets.PYPI_TOKEN }}
@@ -0,0 +1,115 @@
1
+ name: Run Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ # Allows you to run this workflow manually from the Actions tab
10
+ workflow_dispatch:
11
+
12
+ jobs:
13
+ formatting:
14
+ name: Check Formatting
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - name: Set up Python 3.10
19
+ uses: actions/setup-python@v4
20
+ with:
21
+ python-version: "3.10"
22
+ - name: Install Rust
23
+ uses: dtolnay/rust-toolchain@stable
24
+ - name: Install Formatting Tools
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install ruff flake8
28
+ rustup component add rustfmt clippy
29
+ - name: Check Python Formatting
30
+ run: |
31
+ ruff check .
32
+ flake8 .
33
+ - name: Check Rust Formatting
34
+ run: |
35
+ cargo fmt --check
36
+ cargo clippy -- -D warnings
37
+
38
+ test-python:
39
+ name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
40
+ runs-on: ${{ matrix.os }}
41
+ strategy:
42
+ matrix:
43
+ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
44
+ os: [ubuntu-latest, macos-latest, windows-latest]
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+ - name: Set up Python ${{ matrix.python-version }}
48
+ uses: actions/setup-python@v4
49
+ with:
50
+ python-version: ${{ matrix.python-version }}
51
+ - name: Install Rust
52
+ uses: dtolnay/rust-toolchain@stable
53
+ - name: Install dependencies
54
+ run: |
55
+ python -m pip install --upgrade pip
56
+ pip install maturin pytest
57
+ - name: Build and install package
58
+ run: |
59
+ maturin build
60
+ pip install --find-links target/wheels zacro
61
+ - name: Run tests
62
+ run: |
63
+ python -m pytest tests/ -v
64
+
65
+ test-rust:
66
+ name: Test Rust on ${{ matrix.os }}
67
+ runs-on: ${{ matrix.os }}
68
+ strategy:
69
+ matrix:
70
+ os: [ubuntu-latest, macos-latest, windows-latest]
71
+ steps:
72
+ - uses: actions/checkout@v4
73
+ - name: Install Rust
74
+ uses: dtolnay/rust-toolchain@stable
75
+ - name: Run Rust tests
76
+ run: |
77
+ cargo test --lib
78
+
79
+ build_wheels:
80
+ name: Build wheels on ${{ matrix.os }}
81
+ runs-on: ${{ matrix.os }}
82
+ strategy:
83
+ matrix:
84
+ # os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-latest]
85
+ os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
86
+
87
+ steps:
88
+ - uses: actions/checkout@v4
89
+
90
+ - name: Set up Python
91
+ uses: actions/setup-python@v5
92
+ with:
93
+ python-version: "3.10"
94
+
95
+ - name: Install Rust
96
+ uses: dtolnay/rust-toolchain@stable
97
+
98
+ - name: Install cibuildwheel
99
+ run: python -m pip install cibuildwheel==2.16.2
100
+
101
+ - name: Build wheels
102
+ run: python -m cibuildwheel --output-dir wheelhouse
103
+ env:
104
+ CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*"
105
+ CIBW_SKIP: "cp38-win32 cp39-win32 cp310-win32 cp311-win32 cp312-win32 *-win32 *-musllinux* *-manylinux_i686"
106
+ CIBW_BEFORE_ALL_LINUX: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && source ~/.cargo/env"
107
+ CIBW_ENVIRONMENT_LINUX: "PATH=$HOME/.cargo/bin:$PATH"
108
+ CIBW_BEFORE_ALL_MACOS: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && source ~/.cargo/env"
109
+ CIBW_ENVIRONMENT_MACOS: "PATH=$HOME/.cargo/bin:$PATH"
110
+ CIBW_BEFORE_ALL_WINDOWS: "choco install rust -y"
111
+
112
+ - uses: actions/upload-artifact@v4
113
+ with:
114
+ name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
115
+ path: ./wheelhouse/*.whl
zacro-0.1.1/.gitignore ADDED
@@ -0,0 +1,272 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be added to the global gitignore or merged into this project gitignore. For a PyCharm
158
+ # project, uncomment the following line:
159
+ #.idea/
160
+
161
+ # Rust
162
+ # Generated by Cargo
163
+ # will have compiled files and executables
164
+ debug/
165
+ target/
166
+
167
+ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
168
+ # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
169
+ Cargo.lock
170
+
171
+ # These are backup files generated by rustfmt
172
+ **/*.rs.bk
173
+
174
+ # MSVC Windows builds of rustc generate these, which store debugging information
175
+ *.pdb
176
+
177
+ # Maturin
178
+ *.whl
179
+
180
+ # macOS
181
+ .DS_Store
182
+ .AppleDouble
183
+ .LSOverride
184
+
185
+ # Icon must end with two \r
186
+ Icon
187
+
188
+ # Thumbnails
189
+ ._*
190
+
191
+ # Files that might appear in the root of a volume
192
+ .DocumentRevisions-V100
193
+ .fseventsd
194
+ .Spotlight-V100
195
+ .TemporaryItems
196
+ .Trashes
197
+ .VolumeIcon.icns
198
+ .com.apple.timemachine.donotpresent
199
+
200
+ # Directories potentially created on remote AFP share
201
+ .AppleDB
202
+ .AppleDesktop
203
+ Network Trash Folder
204
+ Temporary Items
205
+ .apdisk
206
+
207
+ # Linux
208
+ *~
209
+
210
+ # temporary files which can be created if a process still has a handle open of a deleted file
211
+ .fuse_hidden*
212
+
213
+ # KDE directory preferences
214
+ .directory
215
+
216
+ # Linux trash folder which might appear on any partition or disk
217
+ .Trash-*
218
+
219
+ # .nfs files are created when an open file is removed but is still being accessed
220
+ .nfs*
221
+
222
+ # Windows
223
+ # Windows thumbnail cache files
224
+ Thumbs.db
225
+ Thumbs.db:encryptable
226
+ ehthumbs.db
227
+ ehthumbs_vista.db
228
+
229
+ # Dump file
230
+ *.stackdump
231
+
232
+ # Folder config file
233
+ [Dd]esktop.ini
234
+
235
+ # Recycle Bin used on file shares
236
+ $RECYCLE.BIN/
237
+
238
+ # Windows Installer files
239
+ *.cab
240
+ *.msi
241
+ *.msix
242
+ *.msm
243
+ *.msp
244
+
245
+ # Windows shortcuts
246
+ *.lnk
247
+
248
+ # Editor backups
249
+ *~
250
+ *.swp
251
+ *.swo
252
+ *#
253
+ .#*
254
+
255
+ # IDE
256
+ .vscode/
257
+ .idea/
258
+
259
+ # Project-specific
260
+ # Test output files
261
+ test_robot.xacro
262
+ test_robot.urdf
263
+ *.tmp
264
+ tmp/
265
+
266
+ # Log files
267
+ *.log
268
+
269
+ # Temporary build artifacts
270
+ /python/zacro/*.so
271
+ /python/zacro/*.pyd
272
+ /python/zacro/*.dll