never-primp 1.0.0__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.

Potentially problematic release.


This version of never-primp might be problematic. Click here for more details.

@@ -0,0 +1,29 @@
1
+ {
2
+ "env": {
3
+ "MAX THINKING TOKENS": "32000"
4
+ },
5
+ "permissions": {
6
+ "allow": [
7
+ "WebSearch",
8
+ "WebFetch(domain:crates.io)",
9
+ "WebFetch(domain:github.com)",
10
+ "Bash(cargo tree:*)",
11
+ "Bash(cargo doc:*)",
12
+ "WebFetch(domain:docs.rs)",
13
+ "Bash(cargo check:*)",
14
+ "Bash(cargo build:*)",
15
+ "Bash(cargo update:*)",
16
+ "Bash(maturin build:*)",
17
+ "Bash(cargo search:*)",
18
+ "Bash(cargo info:*)",
19
+ "Bash(python:*)",
20
+ "Bash(python3:*)",
21
+ "Bash(iconv:*)",
22
+ "Bash(pip install:*)",
23
+ "Bash(pip show:*)",
24
+ "Bash(cat:*)"
25
+ ],
26
+ "deny": [],
27
+ "ask": []
28
+ }
29
+ }
@@ -0,0 +1,247 @@
1
+ name: Build and Publish never_primp
2
+
3
+ on:
4
+ # 手动触发工作流
5
+ workflow_dispatch:
6
+ inputs:
7
+ publish_to_pypi:
8
+ description: '是否发布到 PyPI (true/false)'
9
+ required: true
10
+ default: 'false'
11
+ type: choice
12
+ options:
13
+ - 'false'
14
+ - 'true'
15
+
16
+ # 推送触发:tag 或分支
17
+ push:
18
+ tags:
19
+ - 'v*.*.*'
20
+ branches:
21
+ - main
22
+ - master
23
+
24
+ permissions:
25
+ contents: read
26
+
27
+ jobs:
28
+ # ==================== Linux 平台构建 ====================
29
+ build-linux:
30
+ name: Build Linux ${{ matrix.target }}
31
+ runs-on: ubuntu-latest
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ target:
36
+ - x86_64 # Linux x64 (最常用)
37
+ # - aarch64 # Linux ARM64 (服务器)
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+
41
+ - uses: actions/setup-python@v5
42
+ with:
43
+ python-version: '3.11'
44
+
45
+ - name: Install dependencies
46
+ run: |
47
+ sudo apt-get update
48
+ sudo apt-get install -y \
49
+ libclang-dev \
50
+ clang \
51
+ cmake \
52
+ build-essential \
53
+ pkg-config \
54
+ gcc-multilib \
55
+ libssl-dev
56
+
57
+ - name: Find and set libclang path
58
+ run: |
59
+ # 查找 libclang.so 并设置环境变量
60
+ LIBCLANG_PATH=$(find /usr/lib -name "libclang.so*" | head -1 | xargs dirname)
61
+ echo "LIBCLANG_PATH=$LIBCLANG_PATH" >> $GITHUB_ENV
62
+ echo "Found libclang at: $LIBCLANG_PATH"
63
+ ls -la $LIBCLANG_PATH/libclang.so* || true
64
+
65
+ - name: Build wheels
66
+ uses: PyO3/maturin-action@v1
67
+ with:
68
+ target: ${{ matrix.target }}
69
+ args: --release --out dist --find-interpreter
70
+ sccache: 'true'
71
+ manylinux: ${{ matrix.target == 'x86_64' && '2_28' || '2_28' }}
72
+ before-script-linux: |
73
+ # 检测包管理器并安装依赖
74
+ if command -v yum &> /dev/null; then
75
+ echo "Using yum (manylinux container)"
76
+ yum install -y clang llvm-devel cmake glibc-devel glibc-headers kernel-headers
77
+
78
+ # 设置 bindgen 的 clang 参数,确保能找到系统头文件
79
+ ARCH=$(uname -m)
80
+ export BINDGEN_EXTRA_CLANG_ARGS="-I/usr/include -I/usr/include/$ARCH-linux-gnu"
81
+ echo "BINDGEN_EXTRA_CLANG_ARGS=$BINDGEN_EXTRA_CLANG_ARGS"
82
+
83
+ # 查找并设置 libclang
84
+ export LIBCLANG_PATH="${LIBCLANG_PATH:-$(find /usr/lib* -name "libclang.so*" 2>/dev/null | head -1 | xargs dirname 2>/dev/null || echo "/usr/lib64")}"
85
+ echo "Using LIBCLANG_PATH=$LIBCLANG_PATH"
86
+ else
87
+ echo "Not in manylinux container, using host dependencies"
88
+ fi
89
+
90
+ # 验证
91
+ ls -la $LIBCLANG_PATH/libclang* 2>/dev/null || echo "libclang not found, relying on system defaults"
92
+ clang --version 2>/dev/null || echo "clang not in PATH"
93
+
94
+ - name: List built wheels
95
+ run: ls -lh dist/
96
+
97
+ - name: Upload wheels
98
+ uses: actions/upload-artifact@v4
99
+ with:
100
+ name: wheels-linux-${{ matrix.target }}
101
+ path: dist
102
+
103
+ # ==================== Windows 平台构建 ====================
104
+ build-windows:
105
+ name: Build Windows ${{ matrix.target }}
106
+ runs-on: windows-latest
107
+ strategy:
108
+ fail-fast: false
109
+ matrix:
110
+ target: [x64]
111
+ steps:
112
+ - uses: actions/checkout@v4
113
+
114
+ - uses: actions/setup-python@v5
115
+ with:
116
+ python-version: '3.11'
117
+ architecture: ${{ matrix.target }}
118
+
119
+ - name: Build wheels
120
+ uses: PyO3/maturin-action@v1
121
+ with:
122
+ target: ${{ matrix.target }}
123
+ args: --release --out dist --find-interpreter
124
+ sccache: 'true'
125
+
126
+ - name: List built wheels
127
+ run: dir dist
128
+
129
+ - name: Debug wheel contents
130
+ shell: powershell
131
+ run: |
132
+ $wheel = Get-ChildItem dist\*.whl | Select-Object -First 1
133
+ Write-Host "=== Wheel contents ==="
134
+ python -m zipfile -l $wheel
135
+ Write-Host "`n=== Looking for never_primp files ==="
136
+ python -m zipfile -l $wheel | Select-String "never_primp"
137
+
138
+ - name: Upload wheels
139
+ uses: actions/upload-artifact@v4
140
+ with:
141
+ name: wheels-windows-${{ matrix.target }}
142
+ path: dist
143
+
144
+ # ==================== macOS 平台构建 ====================
145
+ build-macos:
146
+ name: Build macOS ${{ matrix.target }}
147
+ runs-on: macos-latest
148
+ strategy:
149
+ fail-fast: false
150
+ matrix:
151
+ target:
152
+ - x86_64 # Intel Mac
153
+ - aarch64 # Apple Silicon (M1/M2/M3)
154
+ steps:
155
+ - uses: actions/checkout@v4
156
+
157
+ - uses: actions/setup-python@v5
158
+ with:
159
+ python-version: '3.11'
160
+
161
+ - name: Build wheels
162
+ uses: PyO3/maturin-action@v1
163
+ with:
164
+ target: ${{ matrix.target }}
165
+ args: --release --out dist --find-interpreter
166
+ sccache: 'true'
167
+
168
+ - name: List built wheels
169
+ run: ls -lh dist/
170
+
171
+ - name: Upload wheels
172
+ uses: actions/upload-artifact@v4
173
+ with:
174
+ name: wheels-macos-${{ matrix.target }}
175
+ path: dist
176
+
177
+ # ==================== 构建源码分发包 ====================
178
+ build-sdist:
179
+ name: Build source distribution
180
+ runs-on: ubuntu-latest
181
+ steps:
182
+ - uses: actions/checkout@v4
183
+
184
+ - name: Build sdist
185
+ uses: PyO3/maturin-action@v1
186
+ with:
187
+ command: sdist
188
+ args: --out dist
189
+
190
+ - name: List sdist
191
+ run: ls -lh dist/
192
+
193
+ - name: Upload sdist
194
+ uses: actions/upload-artifact@v4
195
+ with:
196
+ name: wheels-sdist
197
+ path: dist
198
+
199
+ # ==================== 发布到 PyPI ====================
200
+ publish-to-pypi:
201
+ name: Publish to PyPI
202
+ runs-on: ubuntu-latest
203
+ needs: [build-linux, build-windows, build-macos, build-sdist]
204
+
205
+ steps:
206
+ - name: Download all artifacts
207
+ uses: actions/download-artifact@v4
208
+ with:
209
+ pattern: wheels-*
210
+ path: dist
211
+ merge-multiple: true
212
+
213
+ - name: List all packages
214
+ run: |
215
+ echo "========================================="
216
+ echo "📦 准备发布的所有包:"
217
+ echo "========================================="
218
+ ls -lh dist/
219
+ echo ""
220
+ echo "========================================="
221
+ echo "📋 包列表:"
222
+ echo "========================================="
223
+ for file in dist/*; do
224
+ echo " ✓ $(basename $file)"
225
+ done
226
+ echo ""
227
+ echo "========================================="
228
+
229
+ - name: Publish to PyPI
230
+ uses: PyO3/maturin-action@v1
231
+ env:
232
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
233
+ with:
234
+ command: upload
235
+ args: --non-interactive --skip-existing dist/*
236
+
237
+ - name: Success message
238
+ run: |
239
+ echo "========================================="
240
+ echo "✅ 发布成功!"
241
+ echo "========================================="
242
+ echo "用户现在可以通过以下命令安装:"
243
+ echo " pip install never_primp"
244
+ echo ""
245
+ echo "查看项目:"
246
+ echo " https://pypi.org/project/never_primp/"
247
+ echo "========================================="
@@ -0,0 +1,76 @@
1
+ /target
2
+ nul
3
+ # Byte-compiled / optimized / DLL files
4
+ __pycache__/
5
+ .pytest_cache/
6
+ *.py[cod]
7
+
8
+ # C extensions
9
+ *.so
10
+
11
+ # Distribution / packaging
12
+ .Python
13
+ .venv/
14
+ env/
15
+ bin/
16
+ build/
17
+ develop-eggs/
18
+ dist/
19
+ eggs/
20
+ lib/
21
+ lib64/
22
+ parts/
23
+ sdist/
24
+ var/
25
+ include/
26
+ man/
27
+ venv/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+
32
+ # Installer logs
33
+ pip-log.txt
34
+ pip-delete-this-directory.txt
35
+ pip-selfcheck.json
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .coverage
41
+ .cache
42
+ nosetests.xml
43
+ coverage.xml
44
+
45
+ # Translations
46
+ *.mo
47
+
48
+ # Mr Developer
49
+ .mr.developer.cfg
50
+ .project
51
+ .pydevproject
52
+
53
+ # Rope
54
+ .ropeproject
55
+
56
+ # Django stuff:
57
+ *.log
58
+ *.pot
59
+
60
+ .DS_Store
61
+
62
+ # Sphinx documentation
63
+ docs/_build/
64
+
65
+ # PyCharm
66
+ .idea/
67
+
68
+ # VSCode
69
+ .vscode/
70
+
71
+ # Pyenv
72
+ .python-version
73
+
74
+ # Ignore csv and jpg files in benchmark folder
75
+ benchmark/*.csv
76
+ benchmark/*.jpg