rsnumpy 1.0.2__tar.gz → 1.0.3__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.
- rsnumpy-1.0.3/.github/workflows/ci.yml +87 -0
- rsnumpy-1.0.3/.github/workflows/release.yml +162 -0
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/.gitignore +2 -3
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/Cargo.lock +37 -258
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/Cargo.toml +4 -3
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/PKG-INFO +1 -1
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/RELEASE_NOTES.md +3 -3
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/pyproject.toml +1 -1
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/python/rsnumpy/__init__.py +1 -1
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/src/fft.rs +16 -16
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/src/indexing.rs +128 -57
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/src/lib.rs +1006 -411
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/src/linalg.rs +340 -152
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/src/random.rs +173 -79
- rsnumpy-1.0.3/test/run_test.py +1681 -0
- rsnumpy-1.0.2/.github/ci.yml +0 -140
- rsnumpy-1.0.2/.github/release.yml +0 -84
- rsnumpy-1.0.2/.github/workflows/rust-clippy.yml +0 -55
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/LICENSE +0 -0
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/README.md +0 -0
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/build_wheel.sh +0 -0
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/plots.py +0 -0
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/python/rsnumpy/array_methods.py +0 -0
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/python/rsnumpy/array_ops.py +0 -0
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/python/rsnumpy/char.py +0 -0
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/python/rsnumpy/io.py +0 -0
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/python/rsnumpy/linalg/__init__.py +0 -0
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/python/rsnumpy/math_functions.py +0 -0
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/python/rsnumpy/matlib.py +0 -0
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/python/rsnumpy/polynomial/__init__.py +0 -0
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/python/rsnumpy/random/__init__.py +0 -0
- {rsnumpy-1.0.2 → rsnumpy-1.0.3}/python/rsnumpy/statistics.py +0 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master, dev, development]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, master, dev, development]
|
|
8
|
+
|
|
9
|
+
# 同一分支/PR 的新推送会取消仍在进行的旧运行,节省 CI 时间。
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
test:
|
|
19
|
+
name: Test (${{ matrix.os }}, py${{ matrix.python-version }})
|
|
20
|
+
runs-on: ${{ matrix.os }}
|
|
21
|
+
env:
|
|
22
|
+
PYTHONUTF8: 1
|
|
23
|
+
PYTHONIOENCODING: utf-8
|
|
24
|
+
strategy:
|
|
25
|
+
fail-fast: false
|
|
26
|
+
matrix:
|
|
27
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
28
|
+
python-version: ["3.10", "3.13", "3.14"]
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v4
|
|
31
|
+
|
|
32
|
+
- name: Cache Rust build artifacts
|
|
33
|
+
uses: actions/cache@v4
|
|
34
|
+
with:
|
|
35
|
+
path: |
|
|
36
|
+
~/.cargo/registry
|
|
37
|
+
~/.cargo/git
|
|
38
|
+
target
|
|
39
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
40
|
+
restore-keys: |
|
|
41
|
+
${{ runner.os }}-cargo-
|
|
42
|
+
|
|
43
|
+
- uses: actions/setup-python@v5
|
|
44
|
+
with:
|
|
45
|
+
python-version: ${{ matrix.python-version }}
|
|
46
|
+
|
|
47
|
+
- name: Build wheel
|
|
48
|
+
uses: PyO3/maturin-action@v1
|
|
49
|
+
with:
|
|
50
|
+
command: build
|
|
51
|
+
# -i python 绑定到当前矩阵版本;container:'off' 让 Linux 也直接在宿主机构建,
|
|
52
|
+
# 从而与 setup-python 的版本一致(CI 只需能导入运行,无需 manylinux 合规)。
|
|
53
|
+
args: --release --out dist -i python
|
|
54
|
+
container: "off"
|
|
55
|
+
sccache: "true"
|
|
56
|
+
|
|
57
|
+
- name: Install built wheel
|
|
58
|
+
run: python -m pip install --no-index --find-links dist rsnumpy
|
|
59
|
+
|
|
60
|
+
- name: Install test dependencies
|
|
61
|
+
run: python -m pip install numpy
|
|
62
|
+
|
|
63
|
+
- name: Run smoke test
|
|
64
|
+
run: python test/run_test.py
|
|
65
|
+
|
|
66
|
+
lint:
|
|
67
|
+
name: Lint (rustfmt + clippy)
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
|
|
72
|
+
# pyo3 的 build script 需要一个 Python 解释器来探测 ABI。
|
|
73
|
+
- uses: actions/setup-python@v5
|
|
74
|
+
with:
|
|
75
|
+
python-version: "3.13"
|
|
76
|
+
|
|
77
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
78
|
+
with:
|
|
79
|
+
components: rustfmt, clippy
|
|
80
|
+
|
|
81
|
+
- uses: Swatinem/rust-cache@v2
|
|
82
|
+
|
|
83
|
+
- name: Check formatting
|
|
84
|
+
run: cargo fmt --all -- --check
|
|
85
|
+
|
|
86
|
+
- name: Run clippy
|
|
87
|
+
run: cargo clippy -- -D warnings
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
name: Build and Publish Wheels
|
|
2
|
+
|
|
3
|
+
# 触发方式:推送 v* 标签(如 v0.1.8)或在 GitHub 上 Publish 一个 Release。
|
|
4
|
+
# 也可在 Actions 页手动触发(workflow_dispatch)——手动触发只构建、不发布。
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
tags:
|
|
8
|
+
- "v*"
|
|
9
|
+
release:
|
|
10
|
+
types: [published]
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
# ---------------- Linux: x86_64 + aarch64 ----------------
|
|
18
|
+
# manylinux 容器内含全部 CPython,--find-interpreter 自动为每个版本各产出一个 wheel。
|
|
19
|
+
linux:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
strategy:
|
|
22
|
+
fail-fast: false
|
|
23
|
+
matrix:
|
|
24
|
+
target: [x86_64, aarch64]
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
|
|
28
|
+
- name: Cache Rust build artifacts
|
|
29
|
+
uses: actions/cache@v4
|
|
30
|
+
with:
|
|
31
|
+
path: |
|
|
32
|
+
~/.cargo/registry
|
|
33
|
+
~/.cargo/git
|
|
34
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
35
|
+
restore-keys: |
|
|
36
|
+
${{ runner.os }}-cargo-
|
|
37
|
+
|
|
38
|
+
- name: Build wheels (${{ matrix.target }})
|
|
39
|
+
uses: PyO3/maturin-action@v1
|
|
40
|
+
with:
|
|
41
|
+
target: ${{ matrix.target }}
|
|
42
|
+
manylinux: auto
|
|
43
|
+
args: --release --out dist --find-interpreter
|
|
44
|
+
|
|
45
|
+
- uses: actions/upload-artifact@v4
|
|
46
|
+
with:
|
|
47
|
+
name: wheels-linux-${{ matrix.target }}
|
|
48
|
+
path: dist
|
|
49
|
+
|
|
50
|
+
# ---------------- Windows: x64,按 Python 版本矩阵 ----------------
|
|
51
|
+
windows:
|
|
52
|
+
runs-on: windows-latest
|
|
53
|
+
strategy:
|
|
54
|
+
fail-fast: false
|
|
55
|
+
matrix:
|
|
56
|
+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
57
|
+
steps:
|
|
58
|
+
- uses: actions/checkout@v4
|
|
59
|
+
|
|
60
|
+
- name: Cache Rust build artifacts
|
|
61
|
+
uses: actions/cache@v4
|
|
62
|
+
with:
|
|
63
|
+
path: |
|
|
64
|
+
~/.cargo/registry
|
|
65
|
+
~/.cargo/git
|
|
66
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
67
|
+
restore-keys: |
|
|
68
|
+
${{ runner.os }}-cargo-
|
|
69
|
+
|
|
70
|
+
- uses: actions/setup-python@v5
|
|
71
|
+
with:
|
|
72
|
+
python-version: ${{ matrix.python-version }}
|
|
73
|
+
architecture: x64
|
|
74
|
+
|
|
75
|
+
- name: Build wheel (py${{ matrix.python-version }})
|
|
76
|
+
uses: PyO3/maturin-action@v1
|
|
77
|
+
with:
|
|
78
|
+
# -i python 指向 setup-python 激活的解释器,确保为当前矩阵版本构建。
|
|
79
|
+
args: --release --out dist -i python
|
|
80
|
+
|
|
81
|
+
- uses: actions/upload-artifact@v4
|
|
82
|
+
with:
|
|
83
|
+
name: wheels-windows-${{ matrix.python-version }}
|
|
84
|
+
path: dist
|
|
85
|
+
|
|
86
|
+
# ---------------- macOS: universal2(Intel + Apple Silicon),按版本矩阵 ----------------
|
|
87
|
+
# macos-13(Intel) runner 已退役,改在 arm64 runner 上交叉编译 universal2,
|
|
88
|
+
# 一个 wheel 同时兼容 x86_64 与 arm64,无需 Intel 机器。
|
|
89
|
+
macos:
|
|
90
|
+
runs-on: macos-latest
|
|
91
|
+
strategy:
|
|
92
|
+
fail-fast: false
|
|
93
|
+
matrix:
|
|
94
|
+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
95
|
+
steps:
|
|
96
|
+
- uses: actions/checkout@v4
|
|
97
|
+
|
|
98
|
+
- name: Cache Rust build artifacts
|
|
99
|
+
uses: actions/cache@v4
|
|
100
|
+
with:
|
|
101
|
+
path: |
|
|
102
|
+
~/.cargo/registry
|
|
103
|
+
~/.cargo/git
|
|
104
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
105
|
+
restore-keys: |
|
|
106
|
+
${{ runner.os }}-cargo-
|
|
107
|
+
|
|
108
|
+
- uses: actions/setup-python@v5
|
|
109
|
+
with:
|
|
110
|
+
python-version: ${{ matrix.python-version }}
|
|
111
|
+
|
|
112
|
+
- name: Build universal2 wheel (py${{ matrix.python-version }})
|
|
113
|
+
uses: PyO3/maturin-action@v1
|
|
114
|
+
with:
|
|
115
|
+
target: universal2-apple-darwin
|
|
116
|
+
args: --release --out dist -i python
|
|
117
|
+
|
|
118
|
+
- uses: actions/upload-artifact@v4
|
|
119
|
+
with:
|
|
120
|
+
name: wheels-macos-${{ matrix.python-version }}
|
|
121
|
+
path: dist
|
|
122
|
+
|
|
123
|
+
# ---------------- 源码分发(sdist)----------------
|
|
124
|
+
# 当某平台/版本无预编译 wheel 时,pip 可用 sdist 从源码构建(需目标机器有 Rust)。
|
|
125
|
+
sdist:
|
|
126
|
+
runs-on: ubuntu-latest
|
|
127
|
+
steps:
|
|
128
|
+
- uses: actions/checkout@v4
|
|
129
|
+
|
|
130
|
+
- name: Build sdist
|
|
131
|
+
uses: PyO3/maturin-action@v1
|
|
132
|
+
with:
|
|
133
|
+
command: sdist
|
|
134
|
+
args: --out dist
|
|
135
|
+
|
|
136
|
+
- uses: actions/upload-artifact@v4
|
|
137
|
+
with:
|
|
138
|
+
name: wheels-sdist
|
|
139
|
+
path: dist
|
|
140
|
+
|
|
141
|
+
# ---------------- 发布到 PyPI(仅标签 / Release 触发)----------------
|
|
142
|
+
publish:
|
|
143
|
+
name: Publish to PyPI
|
|
144
|
+
runs-on: ubuntu-latest
|
|
145
|
+
needs: [linux, windows, macos, sdist]
|
|
146
|
+
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
|
|
147
|
+
steps:
|
|
148
|
+
- name: Download all artifacts
|
|
149
|
+
uses: actions/download-artifact@v4
|
|
150
|
+
with:
|
|
151
|
+
pattern: wheels-*
|
|
152
|
+
path: dist
|
|
153
|
+
merge-multiple: true
|
|
154
|
+
|
|
155
|
+
- name: Publish
|
|
156
|
+
uses: PyO3/maturin-action@v1
|
|
157
|
+
env:
|
|
158
|
+
# 仓库 Settings → Secrets and variables → Actions 中的 secret 名(值为 PyPI token,以 pypi- 开头)。
|
|
159
|
+
MATURIN_PYPI_TOKEN: ${{ secrets.YJ_NIU }}
|
|
160
|
+
with:
|
|
161
|
+
command: upload
|
|
162
|
+
args: --non-interactive --skip-existing dist/*
|
|
@@ -14,7 +14,6 @@ dist/
|
|
|
14
14
|
build/
|
|
15
15
|
*.egg
|
|
16
16
|
.venv/
|
|
17
|
-
test/
|
|
18
17
|
venv/
|
|
19
18
|
uv.lock
|
|
20
19
|
|
|
@@ -30,14 +29,14 @@ uv.lock
|
|
|
30
29
|
Thumbs.db
|
|
31
30
|
|
|
32
31
|
# Data / plots
|
|
32
|
+
debug.txt
|
|
33
|
+
test_old.txt
|
|
33
34
|
out.txt
|
|
34
35
|
outfile.npy
|
|
35
36
|
runoob.npz
|
|
36
37
|
outfile2
|
|
37
38
|
push*.sh
|
|
38
39
|
main*.py
|
|
39
|
-
test*.py
|
|
40
|
-
run*.py
|
|
41
40
|
debug*.py
|
|
42
41
|
check*.py
|
|
43
42
|
|