convolve-rs 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.
@@ -0,0 +1,4 @@
1
+ # Allow Python symbols to be resolved at runtime (required for pyo3 extension modules
2
+ # and for the stub_gen binary, which uses pyo3 type info without calling Python).
3
+ [target.aarch64-apple-darwin]
4
+ rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]
@@ -0,0 +1,146 @@
1
+ name: CD
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - main
9
+ release:
10
+ types:
11
+ - published
12
+
13
+ concurrency:
14
+ group: ${{ github.workflow }}-${{ github.ref }}
15
+ cancel-in-progress: true
16
+
17
+ env:
18
+ FORCE_COLOR: 3
19
+
20
+ jobs:
21
+ sdist:
22
+ name: Build sdist
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v6
26
+
27
+ - name: Install cargo-edit
28
+ if: github.event_name == 'release'
29
+ uses: taiki-e/install-action@v2
30
+ with:
31
+ tool: cargo-edit
32
+
33
+ - name: Pin version from release tag
34
+ if: github.event_name == 'release'
35
+ shell: bash
36
+ env:
37
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
38
+ run: cargo set-version "${RELEASE_TAG#v}"
39
+
40
+ - name: Build sdist
41
+ uses: PyO3/maturin-action@v1
42
+ with:
43
+ command: sdist
44
+ args: --out dist
45
+
46
+ - uses: actions/upload-artifact@v4
47
+ with:
48
+ name: dist-sdist
49
+ path: dist/*.tar.gz
50
+
51
+ wheels:
52
+ name: Wheels (${{ matrix.platform }}, ${{ matrix.target }})
53
+ runs-on: ${{ matrix.runner }}
54
+ strategy:
55
+ fail-fast: false
56
+ matrix:
57
+ include:
58
+ - { platform: linux, runner: ubuntu-latest, target: x86_64 }
59
+ - { platform: linux, runner: ubuntu-latest, target: aarch64 }
60
+ - { platform: macos, runner: macos-14, target: aarch64 }
61
+ # No Windows wheel: cfitsio can't be built from source under MSVC.
62
+ # Windows users can build from the sdist or use conda/WSL.
63
+ steps:
64
+ - uses: actions/checkout@v6
65
+
66
+ - name: Install cargo-edit
67
+ if: github.event_name == 'release'
68
+ uses: taiki-e/install-action@v2
69
+ with:
70
+ tool: cargo-edit
71
+
72
+ - name: Pin version from release tag
73
+ if: github.event_name == 'release'
74
+ shell: bash
75
+ env:
76
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
77
+ run: cargo set-version "${RELEASE_TAG#v}"
78
+
79
+ # cfitsio is compiled from source via the crate's `fitsio-src` feature,
80
+ # so the only build requirement is a C compiler, which every runner (and
81
+ # the manylinux container) already provides.
82
+ - name: Build wheels
83
+ uses: PyO3/maturin-action@v1
84
+ with:
85
+ target: ${{ matrix.target }}
86
+ # `auto` selects an appropriate manylinux image; maturin-action's
87
+ # cross images carry the aarch64 C toolchain needed to build cfitsio.
88
+ manylinux: auto
89
+ # `abi3` builds one stable-ABI wheel per platform (Python >=3.10) and
90
+ # lets maturin build without a (target) interpreter, needed for aarch64.
91
+ args: --release --out dist --features abi3
92
+
93
+ - uses: actions/upload-artifact@v4
94
+ with:
95
+ name: dist-${{ matrix.platform }}-${{ matrix.target }}
96
+ path: dist/*.whl
97
+
98
+ publish-pypi:
99
+ name: Publish to PyPI
100
+ needs: [sdist, wheels]
101
+ runs-on: ubuntu-latest
102
+ environment: pypi
103
+ permissions:
104
+ id-token: write # trusted publishing
105
+ attestations: write
106
+ contents: read
107
+ if: github.event_name == 'release' && github.event.action == 'published'
108
+ steps:
109
+ - uses: actions/download-artifact@v4
110
+ with:
111
+ pattern: dist-*
112
+ path: dist
113
+ merge-multiple: true
114
+
115
+ - name: Generate artifact attestations
116
+ uses: actions/attest-build-provenance@v4
117
+ with:
118
+ subject-path: "dist/*"
119
+
120
+ - uses: pypa/gh-action-pypi-publish@release/v1
121
+
122
+ publish-crates:
123
+ name: Publish to crates.io
124
+ needs: [sdist, wheels]
125
+ runs-on: ubuntu-latest
126
+ if: github.event_name == 'release' && github.event.action == 'published'
127
+ steps:
128
+ - uses: actions/checkout@v6
129
+
130
+ - name: Install Rust toolchain
131
+ uses: dtolnay/rust-toolchain@stable
132
+
133
+ - name: Install cargo-edit
134
+ uses: taiki-e/install-action@v2
135
+ with:
136
+ tool: cargo-edit
137
+
138
+ - name: Pin version from release tag
139
+ shell: bash
140
+ env:
141
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
142
+ run: cargo set-version "${RELEASE_TAG#v}"
143
+
144
+ # --allow-dirty: `cargo set-version` leaves the manifest modified vs HEAD.
145
+ - name: Publish crate
146
+ run: cargo publish --allow-dirty --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
@@ -0,0 +1,121 @@
1
+ name: CI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - main
9
+
10
+ concurrency:
11
+ group: ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ env:
15
+ # Many color libraries just need this variable to be set to any value.
16
+ FORCE_COLOR: 3
17
+ CARGO_TERM_COLOR: always
18
+ # Bump this to invalidate the cached MIRIAD build.
19
+ MIRIAD_CACHE_VERSION: v1
20
+
21
+ jobs:
22
+ lint:
23
+ name: Lint & format
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v6
27
+
28
+ - name: Install Rust toolchain
29
+ uses: dtolnay/rust-toolchain@stable
30
+ with:
31
+ components: rustfmt, clippy
32
+
33
+ - uses: Swatinem/rust-cache@v2
34
+
35
+ - name: rustfmt
36
+ run: cargo fmt --all --check
37
+
38
+ - name: clippy
39
+ # Not --all-features: `abi3` and `stubgen` are mutually exclusive.
40
+ # `stubgen` pulls in the full Python module (it implies `python`).
41
+ run: cargo clippy --all-targets --features stubgen -- -D warnings
42
+
43
+ - uses: astral-sh/setup-uv@v7
44
+
45
+ - name: ruff check
46
+ run: uvx ruff check .
47
+
48
+ - name: ruff format
49
+ run: uvx ruff format --check .
50
+
51
+ rust-test:
52
+ name: Rust tests (vs MIRIAD)
53
+ runs-on: ubuntu-latest
54
+ needs: [lint]
55
+ steps:
56
+ - uses: actions/checkout@v6
57
+
58
+ - name: Install Rust toolchain
59
+ uses: dtolnay/rust-toolchain@stable
60
+
61
+ - uses: Swatinem/rust-cache@v2
62
+
63
+ # ── MIRIAD: build from source (csiro/miriad), aggressively cached ────────
64
+ - name: Cache MIRIAD install
65
+ id: miriad-cache
66
+ uses: actions/cache@v4
67
+ with:
68
+ path: ~/miriad-install
69
+ key: miriad-${{ runner.os }}-${{ env.MIRIAD_CACHE_VERSION }}
70
+
71
+ - name: Install MIRIAD build dependencies
72
+ if: steps.miriad-cache.outputs.cache-hit != 'true'
73
+ run: |
74
+ sudo apt-get update
75
+ sudo apt-get install -y --no-install-recommends \
76
+ gfortran libx11-dev libpng-dev libreadline-dev cmake
77
+
78
+ - name: Build MIRIAD from source
79
+ if: steps.miriad-cache.outputs.cache-hit != 'true'
80
+ run: |
81
+ git clone --depth 1 https://github.com/csiro/miriad.git /tmp/miriad-src
82
+ cmake -S /tmp/miriad-src -B /tmp/miriad-build \
83
+ -DCMAKE_INSTALL_PREFIX="$HOME/miriad-install"
84
+ cmake --build /tmp/miriad-build --target install -j"$(nproc)"
85
+
86
+ - name: Run Rust tests
87
+ run: |
88
+ # The MIRIAD comparison test reads MIRIAD_BIN and derives the rest of
89
+ # the runtime environment (catalogs, etc.) from the install prefix.
90
+ export MIRIAD_BIN="$HOME/miriad-install/bin"
91
+ # The integration tests exercise the pure-Rust API; no Python features.
92
+ cargo test
93
+
94
+ python-test:
95
+ name: Python ${{ matrix.python-version }}
96
+ runs-on: ubuntu-latest
97
+ needs: [lint]
98
+ strategy:
99
+ fail-fast: false
100
+ matrix:
101
+ python-version: ["3.10", "3.12", "3.13", "3.14"]
102
+ steps:
103
+ - uses: actions/checkout@v6
104
+
105
+ - name: Install Rust toolchain
106
+ uses: dtolnay/rust-toolchain@stable
107
+
108
+ - uses: Swatinem/rust-cache@v2
109
+
110
+ - uses: astral-sh/setup-uv@v7
111
+ with:
112
+ python-version: ${{ matrix.python-version }}
113
+
114
+ # Builds the maturin extension module and installs the `test` extra
115
+ # (pytest, radio-beam, astropy). cfitsio is compiled from source via the
116
+ # crate's `fitsio-src` feature, so no system library is needed.
117
+ - name: Build extension and install test dependencies
118
+ run: uv sync --extra test
119
+
120
+ - name: Run pytest
121
+ run: uv run --no-sync pytest -ra --durations=20
@@ -0,0 +1,245 @@
1
+ # Generated by Cargo
2
+ # will have compiled files and executables
3
+ debug
4
+ target
5
+
6
+ # These are backup files generated by rustfmt
7
+ **/*.rs.bk
8
+
9
+ # MSVC Windows builds of rustc generate these, which store debugging information
10
+ *.pdb
11
+
12
+ # Generated by cargo mutants
13
+ # Contains mutation testing data
14
+ **/mutants.out*/
15
+
16
+ # rustc will dump stack traces when hitting an internal compiler error to PWD
17
+ rustc-ice-*.txt
18
+
19
+ # RustRover
20
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
21
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
22
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
23
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
24
+ #.idea/
25
+
26
+ # Byte-compiled / optimized / DLL files
27
+ __pycache__/
28
+ *.py[codz]
29
+ *$py.class
30
+
31
+ # C extensions
32
+ *.so
33
+
34
+ # Distribution / packaging
35
+ .Python
36
+ build/
37
+ develop-eggs/
38
+ dist/
39
+ downloads/
40
+ eggs/
41
+ .eggs/
42
+ lib/
43
+ lib64/
44
+ parts/
45
+ sdist/
46
+ var/
47
+ wheels/
48
+ share/python-wheels/
49
+ *.egg-info/
50
+ .installed.cfg
51
+ *.egg
52
+ MANIFEST
53
+
54
+ # PyInstaller
55
+ # Usually these files are written by a python script from a template
56
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
57
+ *.manifest
58
+ *.spec
59
+
60
+ # Installer logs
61
+ pip-log.txt
62
+ pip-delete-this-directory.txt
63
+
64
+ # Unit test / coverage reports
65
+ htmlcov/
66
+ .tox/
67
+ .nox/
68
+ .coverage
69
+ .coverage.*
70
+ .cache
71
+ nosetests.xml
72
+ coverage.xml
73
+ *.cover
74
+ *.py.cover
75
+ *.lcov
76
+ .hypothesis/
77
+ .pytest_cache/
78
+ cover/
79
+
80
+ # Translations
81
+ *.mo
82
+ *.pot
83
+
84
+ # Django stuff:
85
+ *.log
86
+ local_settings.py
87
+ db.sqlite3
88
+ db.sqlite3-journal
89
+
90
+ # Flask stuff:
91
+ instance/
92
+ .webassets-cache
93
+
94
+ # Scrapy stuff:
95
+ .scrapy
96
+
97
+ # Sphinx documentation
98
+ docs/_build/
99
+
100
+ # PyBuilder
101
+ .pybuilder/
102
+ target/
103
+
104
+ # Jupyter Notebook
105
+ .ipynb_checkpoints
106
+
107
+ # IPython
108
+ profile_default/
109
+ ipython_config.py
110
+
111
+ # pyenv
112
+ # For a library or package, you might want to ignore these files since the code is
113
+ # intended to run in multiple environments; otherwise, check them in:
114
+ # .python-version
115
+
116
+ # pipenv
117
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
118
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
119
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
120
+ # install all needed dependencies.
121
+ # Pipfile.lock
122
+
123
+ # UV
124
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
125
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
126
+ # commonly ignored for libraries.
127
+ # uv.lock
128
+
129
+ # poetry
130
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
131
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
132
+ # commonly ignored for libraries.
133
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
134
+ # poetry.lock
135
+ # poetry.toml
136
+
137
+ # pdm
138
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
139
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
140
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
141
+ # pdm.lock
142
+ # pdm.toml
143
+ .pdm-python
144
+ .pdm-build/
145
+
146
+ # pixi
147
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
148
+ # pixi.lock
149
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
150
+ # in the .venv directory. It is recommended not to include this directory in version control.
151
+ .pixi/*
152
+ !.pixi/config.toml
153
+
154
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
155
+ __pypackages__/
156
+
157
+ # Celery stuff
158
+ celerybeat-schedule*
159
+ celerybeat.pid
160
+
161
+ # Redis
162
+ *.rdb
163
+ *.aof
164
+ *.pid
165
+
166
+ # RabbitMQ
167
+ mnesia/
168
+ rabbitmq/
169
+ rabbitmq-data/
170
+
171
+ # ActiveMQ
172
+ activemq-data/
173
+
174
+ # SageMath parsed files
175
+ *.sage.py
176
+
177
+ # Environments
178
+ .env
179
+ .envrc
180
+ .venv
181
+ env/
182
+ venv/
183
+ ENV/
184
+ env.bak/
185
+ venv.bak/
186
+
187
+ # Spyder project settings
188
+ .spyderproject
189
+ .spyproject
190
+
191
+ # Rope project settings
192
+ .ropeproject
193
+
194
+ # mkdocs documentation
195
+ /site
196
+
197
+ # mypy
198
+ .mypy_cache/
199
+ .dmypy.json
200
+ dmypy.json
201
+
202
+ # Pyre type checker
203
+ .pyre/
204
+
205
+ # pytype static type analyzer
206
+ .pytype/
207
+
208
+ # Cython debug symbols
209
+ cython_debug/
210
+
211
+ # PyCharm
212
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
213
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
214
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
215
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
216
+ # .idea/
217
+
218
+ # Abstra
219
+ # Abstra is an AI-powered process automation framework.
220
+ # Ignore directories containing user credentials, local state, and settings.
221
+ # Learn more at https://abstra.io/docs
222
+ .abstra/
223
+
224
+ # Visual Studio Code
225
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
226
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
227
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
228
+ # you could uncomment the following to ignore the entire vscode folder
229
+ # .vscode/
230
+ # Temporary file for partial code execution
231
+ tempCodeRunnerFile.py
232
+
233
+ # Ruff stuff:
234
+ .ruff_cache/
235
+
236
+ # PyPI configuration file
237
+ .pypirc
238
+
239
+ # Marimo
240
+ marimo/_static/
241
+ marimo/_lsp/
242
+ __marimo__/
243
+
244
+ # Streamlit
245
+ .streamlit/secrets.toml