rustyzipper 1.0.5__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.
@@ -0,0 +1,81 @@
1
+ name: CI
2
+
3
+ on:
4
+ # push:
5
+ # branches:
6
+ # - main
7
+ # - master
8
+ # - "feature*"
9
+ pull_request:
10
+ branches:
11
+ - main
12
+ - "feature*"
13
+
14
+ env:
15
+ CARGO_TERM_COLOR: always
16
+
17
+ jobs:
18
+ # -------------------------
19
+ # Rust tests
20
+ # -------------------------
21
+ rust-test:
22
+ name: Rust Tests
23
+ runs-on: ubuntu-latest
24
+
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+
28
+ - name: Install Rust
29
+ uses: dtolnay/rust-toolchain@stable
30
+
31
+ - name: Cache cargo
32
+ uses: Swatinem/rust-cache@v2
33
+
34
+ - name: Run Rust tests
35
+ run: cargo test --verbose
36
+
37
+ # - name: Check formatting
38
+ # run: cargo fmt --check
39
+ #
40
+ # - name: Run clippy
41
+ # run: cargo clippy -- -D warnings
42
+
43
+ # -------------------------
44
+ # Python tests (via maturin)
45
+ # -------------------------
46
+ python-test:
47
+ name: Python Tests (${{ matrix.os }}, Python ${{ matrix.python-version }})
48
+ runs-on: ${{ matrix.os }}
49
+
50
+ strategy:
51
+ fail-fast: false
52
+ matrix:
53
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
54
+ python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
55
+
56
+ steps:
57
+ - uses: actions/checkout@v4
58
+
59
+ - name: Set up Python ${{ matrix.python-version }}
60
+ uses: actions/setup-python@v5
61
+ with:
62
+ python-version: ${{ matrix.python-version }}
63
+
64
+ - name: Install Rust
65
+ uses: dtolnay/rust-toolchain@stable
66
+
67
+ - name: Cache cargo
68
+ uses: Swatinem/rust-cache@v2
69
+
70
+ - name: Install maturin and pytest
71
+ run: pip install maturin pytest
72
+
73
+ - name: Build wheel
74
+ run: maturin build --release
75
+
76
+ - name: Install wheel
77
+ shell: bash
78
+ run: pip install target/wheels/*.whl
79
+
80
+ - name: Run Python tests
81
+ run: pytest -v --import-mode=importlib
@@ -0,0 +1,229 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types: [ published ]
6
+ workflow_dispatch:
7
+ inputs:
8
+ publish:
9
+ description: 'Publish to PyPI'
10
+ required: true
11
+ type: boolean
12
+ default: false
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ env:
18
+ PACKAGE_NAME: rustyzipper
19
+
20
+ jobs:
21
+ # Build wheels for Linux
22
+ linux:
23
+ name: Build Linux (${{ matrix.target }})
24
+ runs-on: ubuntu-latest
25
+
26
+ strategy:
27
+ fail-fast: false
28
+ matrix:
29
+ target:
30
+ - x86_64-unknown-linux-gnu
31
+ - x86_64-unknown-linux-musl
32
+ - aarch64-unknown-linux-gnu
33
+ - aarch64-unknown-linux-musl
34
+ - armv7-unknown-linux-gnueabihf
35
+ - i686-unknown-linux-gnu
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - name: Set up QEMU
40
+ uses: docker/setup-qemu-action@v3
41
+
42
+ - name: Set up Python
43
+ uses: actions/setup-python@v5
44
+ with:
45
+ python-version: "3.12"
46
+
47
+ - name: Set Release Version
48
+ run: |
49
+ CLEAN_VERSION=${GITHUB_REF_NAME#v}
50
+ sed -i "s/^version = \".*\"/version = \"$CLEAN_VERSION\"/" pyproject.toml
51
+
52
+ - name: Build wheels
53
+ uses: PyO3/maturin-action@v1
54
+ with:
55
+ target: ${{ matrix.target }}
56
+ args: --release --out dist --find-interpreter
57
+ sccache: 'true'
58
+ manylinux: auto
59
+
60
+ - name: Upload wheels
61
+ uses: actions/upload-artifact@v4
62
+ with:
63
+ name: wheels-linux-${{ matrix.target }}
64
+ path: dist/*.whl
65
+ windows:
66
+ name: Build Windows (${{ matrix.target }})
67
+ runs-on: windows-latest
68
+ strategy:
69
+ fail-fast: false
70
+ matrix:
71
+ target:
72
+ - x86_64-pc-windows-msvc
73
+ - aarch64-pc-windows-msvc
74
+ # Removed i686 to avoid 32-bit Python mismatch
75
+ steps:
76
+ - uses: actions/checkout@v4
77
+
78
+ - name: Set up Python
79
+ uses: actions/setup-python@v5
80
+ with:
81
+ python-version: "3.12"
82
+ architecture: x64 # Ensure 64-bit Python
83
+
84
+ - name: Set Release Version
85
+ shell: bash
86
+ run: |
87
+ CLEAN_VERSION=${GITHUB_REF_NAME#v}
88
+ sed -i "s/^version = \".*\"/version = \"$CLEAN_VERSION\"/" pyproject.toml
89
+
90
+ - name: Build wheels
91
+ uses: PyO3/maturin-action@v1
92
+ with:
93
+ target: ${{ matrix.target }}
94
+ args: >
95
+ --release
96
+ --out dist
97
+ --find-interpreter
98
+ ${{ matrix.target == 'aarch64-pc-windows-msvc' && '--features win-arm64' || '' }}
99
+ sccache: 'true'
100
+
101
+
102
+ - name: Upload wheels
103
+ uses: actions/upload-artifact@v4
104
+ with:
105
+ name: wheels-windows-${{ matrix.target }}
106
+ path: dist/*.whl
107
+
108
+
109
+ # Build wheels for macOS
110
+ macos:
111
+ name: Build macOS (${{ matrix.target }})
112
+ runs-on: macos-latest
113
+ strategy:
114
+ fail-fast: false
115
+ matrix:
116
+ target:
117
+ - universal2-apple-darwin
118
+ steps:
119
+ - uses: actions/checkout@v4
120
+
121
+ - name: Set up Python
122
+ uses: actions/setup-python@v5
123
+ with:
124
+ python-version: "3.12"
125
+
126
+ - name: Set Release Version
127
+ shell: bash
128
+ run: |
129
+ CLEAN_VERSION=${GITHUB_REF_NAME#v}
130
+ # Add '' after -i for macOS compatibility
131
+ sed -i '' "s/^version = \".*\"/version = \"$CLEAN_VERSION\"/" pyproject.toml
132
+
133
+ - name: Build wheels
134
+ uses: PyO3/maturin-action@v1
135
+ with:
136
+ target: ${{ matrix.target }}
137
+ # maturin-version: ${{ github.ref_name }}
138
+ args: --release --out dist --find-interpreter
139
+ sccache: 'true'
140
+
141
+ - name: Upload wheels
142
+ uses: actions/upload-artifact@v4
143
+ with:
144
+ name: wheels-macos-${{ matrix.target }}
145
+ path: dist/*.whl
146
+
147
+ # Build source distribution
148
+ sdist:
149
+ name: Build Source Distribution
150
+ runs-on: ubuntu-latest
151
+ steps:
152
+ - uses: actions/checkout@v4
153
+
154
+
155
+ - name: Set Release Version
156
+ shell: bash
157
+ run: |
158
+ CLEAN_VERSION=${GITHUB_REF_NAME#v}
159
+ sed -i "s/^version = \".*\"/version = \"$CLEAN_VERSION\"/" pyproject.toml
160
+
161
+
162
+ - name: Build sdist
163
+ uses: PyO3/maturin-action@v1
164
+ with:
165
+ command: sdist
166
+ args: --out dist
167
+
168
+ - name: Upload sdist
169
+ uses: actions/upload-artifact@v4
170
+ with:
171
+ name: wheels-sdist
172
+ path: dist/*.tar.gz
173
+
174
+ # Publish to PyPI
175
+ publish:
176
+ name: Publish to PyPI
177
+ needs: [ linux, windows, macos, sdist ]
178
+ runs-on: ubuntu-latest
179
+ if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.publish)
180
+ environment:
181
+ name: pypi
182
+ url: https://pypi.org/project/rustyzipper/
183
+ permissions:
184
+ id-token: write # For trusted publishing
185
+ steps:
186
+ - name: Download all artifacts
187
+ uses: actions/download-artifact@v4
188
+ with:
189
+ path: dist
190
+ pattern: wheels-*
191
+ merge-multiple: true
192
+
193
+ - name: List distribution files
194
+ run: ls -la dist/
195
+
196
+ - name: Publish to PyPI
197
+ uses: pypa/gh-action-pypi-publish@release/v1
198
+ with:
199
+ packages-dir: dist/
200
+ # For testing, use TestPyPI first:
201
+ # repository-url: https://test.pypi.org/legacy/
202
+
203
+ # Publish to TestPyPI (for testing releases)
204
+ publish-testpypi:
205
+ name: Publish to TestPyPI
206
+ needs: [ linux, windows, macos, sdist ]
207
+ runs-on: ubuntu-latest
208
+ if: github.event_name == 'workflow_dispatch' && !inputs.publish
209
+ environment:
210
+ name: testpypi
211
+ url: https://test.pypi.org/project/rustyzipper/
212
+ permissions:
213
+ id-token: write
214
+ steps:
215
+ - name: Download all artifacts
216
+ uses: actions/download-artifact@v4
217
+ with:
218
+ path: dist
219
+ pattern: wheels-*
220
+ merge-multiple: true
221
+
222
+ - name: List distribution files
223
+ run: ls -la dist/
224
+
225
+ - name: Publish to TestPyPI
226
+ uses: pypa/gh-action-pypi-publish@release/v1
227
+ with:
228
+ packages-dir: dist/
229
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,56 @@
1
+ # Rust
2
+ /target/
3
+ Cargo.lock
4
+
5
+ # Python
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+ *.so
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
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+
27
+ # Virtual environments
28
+ .env
29
+ .venv
30
+ env/
31
+ venv/
32
+ ENV/
33
+
34
+ # IDE
35
+ .idea/
36
+ .vscode/
37
+ *.swp
38
+ *.swo
39
+ *~
40
+
41
+ # Testing
42
+ .pytest_cache/
43
+ .coverage
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+
48
+ # Documentation
49
+ docs/_build/
50
+
51
+ # OS
52
+ .DS_Store
53
+ Thumbs.db
54
+
55
+ # Maturin
56
+ *.whl