rustyzipper 0.0.4__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.
- rustyzipper-0.0.4/.github/workflows/ci.yml +81 -0
- rustyzipper-0.0.4/.github/workflows/release.yml +222 -0
- rustyzipper-0.0.4/.gitignore +56 -0
- rustyzipper-0.0.4/Cargo.lock +860 -0
- rustyzipper-0.0.4/Cargo.toml +42 -0
- rustyzipper-0.0.4/LICENSE-APACHE +190 -0
- rustyzipper-0.0.4/LICENSE-MIT +21 -0
- rustyzipper-0.0.4/Makefile +92 -0
- rustyzipper-0.0.4/PKG-INFO +328 -0
- rustyzipper-0.0.4/README.md +290 -0
- rustyzipper-0.0.4/pyproject.toml +76 -0
- rustyzipper-0.0.4/python/rustyzipper/__init__.py +224 -0
- rustyzipper-0.0.4/python/rustyzipper/compat.py +98 -0
- rustyzipper-0.0.4/python/rustyzipper/exceptions.py +47 -0
- rustyzipper-0.0.4/python/rustyzipper/py.typed +0 -0
- rustyzipper-0.0.4/python/tests/__init__.py +1 -0
- rustyzipper-0.0.4/python/tests/test_compression.py +294 -0
- rustyzipper-0.0.4/python/tests/test_pyminizip_compat.py +180 -0
- rustyzipper-0.0.4/src/compression.rs +1019 -0
- rustyzipper-0.0.4/src/error.rs +62 -0
- rustyzipper-0.0.4/src/lib.rs +274 -0
|
@@ -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,222 @@
|
|
|
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: true
|
|
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
|
+
- armv7-unknown-linux-gnueabihf
|
|
34
|
+
- i686-unknown-linux-gnu
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
|
|
38
|
+
- name: Set up QEMU
|
|
39
|
+
uses: docker/setup-qemu-action@v3
|
|
40
|
+
|
|
41
|
+
- name: Set up Python
|
|
42
|
+
uses: actions/setup-python@v5
|
|
43
|
+
with:
|
|
44
|
+
python-version: "3.12"
|
|
45
|
+
|
|
46
|
+
- name: Set Release Version
|
|
47
|
+
run: |
|
|
48
|
+
CLEAN_VERSION=${GITHUB_REF_NAME#v}
|
|
49
|
+
sed -i "s/^version = \".*\"/version = \"$CLEAN_VERSION\"/" pyproject.toml
|
|
50
|
+
|
|
51
|
+
- name: Build wheels
|
|
52
|
+
uses: PyO3/maturin-action@v1
|
|
53
|
+
with:
|
|
54
|
+
target: ${{ matrix.target }}
|
|
55
|
+
args: --release --out dist --find-interpreter
|
|
56
|
+
sccache: 'true'
|
|
57
|
+
manylinux: auto
|
|
58
|
+
|
|
59
|
+
- name: Upload wheels
|
|
60
|
+
uses: actions/upload-artifact@v4
|
|
61
|
+
with:
|
|
62
|
+
name: wheels-linux-${{ matrix.target }}
|
|
63
|
+
path: dist/*.whl
|
|
64
|
+
windows:
|
|
65
|
+
name: Build Windows (${{ matrix.target }})
|
|
66
|
+
runs-on: windows-latest
|
|
67
|
+
strategy:
|
|
68
|
+
fail-fast: false
|
|
69
|
+
matrix:
|
|
70
|
+
target:
|
|
71
|
+
- x86_64-pc-windows-msvc
|
|
72
|
+
# Removed i686 to avoid 32-bit Python mismatch
|
|
73
|
+
steps:
|
|
74
|
+
- uses: actions/checkout@v4
|
|
75
|
+
|
|
76
|
+
- name: Set up Python
|
|
77
|
+
uses: actions/setup-python@v5
|
|
78
|
+
with:
|
|
79
|
+
python-version: "3.12"
|
|
80
|
+
architecture: x64 # Ensure 64-bit Python
|
|
81
|
+
|
|
82
|
+
- name: Set Release Version
|
|
83
|
+
shell: bash
|
|
84
|
+
run: |
|
|
85
|
+
CLEAN_VERSION=${GITHUB_REF_NAME#v}
|
|
86
|
+
sed -i "s/^version = \".*\"/version = \"$CLEAN_VERSION\"/" pyproject.toml
|
|
87
|
+
|
|
88
|
+
- name: Build wheels
|
|
89
|
+
uses: PyO3/maturin-action@v1
|
|
90
|
+
with:
|
|
91
|
+
target: ${{ matrix.target }}
|
|
92
|
+
args: --release --out dist --find-interpreter
|
|
93
|
+
sccache: 'true'
|
|
94
|
+
|
|
95
|
+
- name: Upload wheels
|
|
96
|
+
uses: actions/upload-artifact@v4
|
|
97
|
+
with:
|
|
98
|
+
name: wheels-windows-${{ matrix.target }}
|
|
99
|
+
path: dist/*.whl
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
# Build wheels for macOS
|
|
103
|
+
macos:
|
|
104
|
+
name: Build macOS (${{ matrix.target }})
|
|
105
|
+
runs-on: macos-latest
|
|
106
|
+
strategy:
|
|
107
|
+
fail-fast: false
|
|
108
|
+
matrix:
|
|
109
|
+
target:
|
|
110
|
+
- universal2-apple-darwin
|
|
111
|
+
steps:
|
|
112
|
+
- uses: actions/checkout@v4
|
|
113
|
+
|
|
114
|
+
- name: Set up Python
|
|
115
|
+
uses: actions/setup-python@v5
|
|
116
|
+
with:
|
|
117
|
+
python-version: "3.12"
|
|
118
|
+
|
|
119
|
+
- name: Set Release Version
|
|
120
|
+
shell: bash
|
|
121
|
+
run: |
|
|
122
|
+
CLEAN_VERSION=${GITHUB_REF_NAME#v}
|
|
123
|
+
# Add '' after -i for macOS compatibility
|
|
124
|
+
sed -i '' "s/^version = \".*\"/version = \"$CLEAN_VERSION\"/" pyproject.toml
|
|
125
|
+
|
|
126
|
+
- name: Build wheels
|
|
127
|
+
uses: PyO3/maturin-action@v1
|
|
128
|
+
with:
|
|
129
|
+
target: ${{ matrix.target }}
|
|
130
|
+
# maturin-version: ${{ github.ref_name }}
|
|
131
|
+
args: --release --out dist --find-interpreter
|
|
132
|
+
sccache: 'true'
|
|
133
|
+
|
|
134
|
+
- name: Upload wheels
|
|
135
|
+
uses: actions/upload-artifact@v4
|
|
136
|
+
with:
|
|
137
|
+
name: wheels-macos-${{ matrix.target }}
|
|
138
|
+
path: dist/*.whl
|
|
139
|
+
|
|
140
|
+
# Build source distribution
|
|
141
|
+
sdist:
|
|
142
|
+
name: Build Source Distribution
|
|
143
|
+
runs-on: ubuntu-latest
|
|
144
|
+
steps:
|
|
145
|
+
- uses: actions/checkout@v4
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
- name: Set Release Version
|
|
149
|
+
shell: bash
|
|
150
|
+
run: |
|
|
151
|
+
CLEAN_VERSION=${GITHUB_REF_NAME#v}
|
|
152
|
+
sed -i "s/^version = \".*\"/version = \"$CLEAN_VERSION\"/" pyproject.toml
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
- name: Build sdist
|
|
156
|
+
uses: PyO3/maturin-action@v1
|
|
157
|
+
with:
|
|
158
|
+
command: sdist
|
|
159
|
+
args: --out dist
|
|
160
|
+
|
|
161
|
+
- name: Upload sdist
|
|
162
|
+
uses: actions/upload-artifact@v4
|
|
163
|
+
with:
|
|
164
|
+
name: wheels-sdist
|
|
165
|
+
path: dist/*.tar.gz
|
|
166
|
+
|
|
167
|
+
# Publish to PyPI
|
|
168
|
+
publish:
|
|
169
|
+
name: Publish to PyPI
|
|
170
|
+
needs: [ linux, windows, macos, sdist ]
|
|
171
|
+
runs-on: ubuntu-latest
|
|
172
|
+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.publish)
|
|
173
|
+
environment:
|
|
174
|
+
name: pypi
|
|
175
|
+
url: https://pypi.org/project/rustyzipper/
|
|
176
|
+
permissions:
|
|
177
|
+
id-token: write # For trusted publishing
|
|
178
|
+
steps:
|
|
179
|
+
- name: Download all artifacts
|
|
180
|
+
uses: actions/download-artifact@v4
|
|
181
|
+
with:
|
|
182
|
+
path: dist
|
|
183
|
+
pattern: wheels-*
|
|
184
|
+
merge-multiple: true
|
|
185
|
+
|
|
186
|
+
- name: List distribution files
|
|
187
|
+
run: ls -la dist/
|
|
188
|
+
|
|
189
|
+
- name: Publish to PyPI
|
|
190
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
191
|
+
with:
|
|
192
|
+
packages-dir: dist/
|
|
193
|
+
# For testing, use TestPyPI first:
|
|
194
|
+
# repository-url: https://test.pypi.org/legacy/
|
|
195
|
+
|
|
196
|
+
# Publish to TestPyPI (for testing releases)
|
|
197
|
+
publish-testpypi:
|
|
198
|
+
name: Publish to TestPyPI
|
|
199
|
+
needs: [ linux, windows, macos, sdist ]
|
|
200
|
+
runs-on: ubuntu-latest
|
|
201
|
+
if: github.event_name == 'workflow_dispatch' && !inputs.publish
|
|
202
|
+
environment:
|
|
203
|
+
name: testpypi
|
|
204
|
+
url: https://test.pypi.org/project/rustyzip/
|
|
205
|
+
permissions:
|
|
206
|
+
id-token: write
|
|
207
|
+
steps:
|
|
208
|
+
- name: Download all artifacts
|
|
209
|
+
uses: actions/download-artifact@v4
|
|
210
|
+
with:
|
|
211
|
+
path: dist
|
|
212
|
+
pattern: wheels-*
|
|
213
|
+
merge-multiple: true
|
|
214
|
+
|
|
215
|
+
- name: List distribution files
|
|
216
|
+
run: ls -la dist/
|
|
217
|
+
|
|
218
|
+
- name: Publish to TestPyPI
|
|
219
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
220
|
+
with:
|
|
221
|
+
packages-dir: dist/
|
|
222
|
+
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
|