lsdetect 0.1.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,20 @@
1
+ # http://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ end_of_line = lf
6
+ trim_trailing_whitespace = true
7
+ insert_final_newline = true
8
+ indent_style = space
9
+ charset = utf-8
10
+
11
+ [*.rs]
12
+ indent_size = 4
13
+ max_line_length = 100
14
+
15
+ [*.py]
16
+ indent_size = 4
17
+ max_line_length = 79
18
+
19
+ [*.{toml,yml,yaml}]
20
+ indent_size = 2
@@ -0,0 +1,25 @@
1
+ # Dependabot keeps the GitHub Actions pins and the crates fresh.
2
+ version: 2
3
+ updates:
4
+ - package-ecosystem: github-actions
5
+ directory: /
6
+ schedule:
7
+ interval: weekly
8
+ commit-message:
9
+ prefix: ci
10
+ # One PR per week instead of one per action.
11
+ groups:
12
+ actions:
13
+ patterns:
14
+ - "*"
15
+
16
+ - package-ecosystem: cargo
17
+ directory: /
18
+ schedule:
19
+ interval: weekly
20
+ commit-message:
21
+ prefix: chore(deps)
22
+ groups:
23
+ crates:
24
+ patterns:
25
+ - "*"
@@ -0,0 +1,38 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ rust:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v7
16
+ - uses: dtolnay/rust-toolchain@stable
17
+ with:
18
+ components: rustfmt, clippy
19
+ - uses: Swatinem/rust-cache@v2
20
+ - run: cargo fmt --check
21
+ - run: cargo clippy --release -- -D warnings
22
+ - run: cargo test --release
23
+
24
+ python:
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - uses: actions/checkout@v7
28
+ - uses: dtolnay/rust-toolchain@stable
29
+ - uses: Swatinem/rust-cache@v2
30
+ - uses: actions/setup-python@v7
31
+ with:
32
+ python-version: "3.11"
33
+ - run: pip install maturin pytest numpy ruff
34
+ - run: ruff check tests
35
+ - run: ruff format --check tests
36
+ - run: maturin build --release --out dist
37
+ - run: pip install dist/*.whl
38
+ - run: pytest tests -q
@@ -0,0 +1,218 @@
1
+ # This file is autogenerated by maturin v1.15.0
2
+ # Manual deviations:
3
+ #
4
+ # - triggers: tags and workflow_dispatch only (no branch pushes)
5
+ # - publish step: PyPI trusted publishing (uv publish
6
+ # --trusted-publishing always), no PYPI_API_TOKEN secret
7
+ #
8
+ # To update, run:
9
+ # maturin generate-ci github --output .github/workflows/release.yml
10
+ #
11
+ name: Release
12
+
13
+ on:
14
+ push:
15
+ tags:
16
+ - '*'
17
+ workflow_dispatch:
18
+
19
+ permissions:
20
+ contents: read
21
+
22
+ jobs:
23
+ linux:
24
+ runs-on: ${{ matrix.platform.runner }}
25
+ strategy:
26
+ matrix:
27
+ platform:
28
+ - runner: ubuntu-22.04
29
+ target: x86_64
30
+ - runner: ubuntu-22.04
31
+ target: x86
32
+ - runner: ubuntu-22.04
33
+ target: aarch64
34
+ - runner: ubuntu-22.04
35
+ target: armv7
36
+ - runner: ubuntu-22.04
37
+ target: s390x
38
+ - runner: ubuntu-22.04
39
+ target: ppc64le
40
+ steps:
41
+ - uses: actions/checkout@v7
42
+ - uses: actions/setup-python@v7
43
+ with:
44
+ python-version: "3.11"
45
+ - name: Build wheels
46
+ uses: PyO3/maturin-action@v1
47
+ with:
48
+ target: ${{ matrix.platform.target }}
49
+ args: --release --out dist
50
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
51
+ manylinux: auto
52
+ - name: Build free-threaded wheels
53
+ uses: PyO3/maturin-action@v1
54
+ with:
55
+ target: ${{ matrix.platform.target }}
56
+ args: --release --out dist -i python3.14t
57
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
58
+ manylinux: auto
59
+ - name: Upload wheels
60
+ uses: actions/upload-artifact@v7
61
+ with:
62
+ name: wheels-linux-${{ matrix.platform.target }}
63
+ path: dist
64
+
65
+ musllinux:
66
+ runs-on: ${{ matrix.platform.runner }}
67
+ strategy:
68
+ matrix:
69
+ platform:
70
+ - runner: ubuntu-22.04
71
+ target: x86_64
72
+ - runner: ubuntu-22.04
73
+ target: x86
74
+ - runner: ubuntu-22.04
75
+ target: aarch64
76
+ - runner: ubuntu-22.04
77
+ target: armv7
78
+ steps:
79
+ - uses: actions/checkout@v7
80
+ - uses: actions/setup-python@v7
81
+ with:
82
+ python-version: "3.11"
83
+ - name: Build wheels
84
+ uses: PyO3/maturin-action@v1
85
+ with:
86
+ target: ${{ matrix.platform.target }}
87
+ args: --release --out dist
88
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
89
+ manylinux: musllinux_1_2
90
+ - name: Build free-threaded wheels
91
+ uses: PyO3/maturin-action@v1
92
+ with:
93
+ target: ${{ matrix.platform.target }}
94
+ args: --release --out dist -i python3.14t
95
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
96
+ manylinux: musllinux_1_2
97
+ - name: Upload wheels
98
+ uses: actions/upload-artifact@v7
99
+ with:
100
+ name: wheels-musllinux-${{ matrix.platform.target }}
101
+ path: dist
102
+
103
+ windows:
104
+ runs-on: ${{ matrix.platform.runner }}
105
+ strategy:
106
+ matrix:
107
+ platform:
108
+ - runner: windows-latest
109
+ target: x64
110
+ python_arch: x64
111
+ - runner: windows-latest
112
+ target: x86
113
+ python_arch: x86
114
+ - runner: windows-11-arm
115
+ target: aarch64
116
+ python_arch: arm64
117
+ steps:
118
+ - uses: actions/checkout@v7
119
+ - uses: actions/setup-python@v7
120
+ with:
121
+ python-version: "3.13"
122
+ architecture: ${{ matrix.platform.python_arch }}
123
+ - name: Build wheels
124
+ uses: PyO3/maturin-action@v1
125
+ with:
126
+ target: ${{ matrix.platform.target }}
127
+ args: --release --out dist
128
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
129
+ - uses: actions/setup-python@v7
130
+ with:
131
+ python-version: "3.14t"
132
+ architecture: ${{ matrix.platform.python_arch }}
133
+ - name: Build free-threaded wheels
134
+ uses: PyO3/maturin-action@v1
135
+ with:
136
+ target: ${{ matrix.platform.target }}
137
+ args: --release --out dist -i python3.14t
138
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
139
+ - name: Upload wheels
140
+ uses: actions/upload-artifact@v7
141
+ with:
142
+ name: wheels-windows-${{ matrix.platform.target }}
143
+ path: dist
144
+
145
+ macos:
146
+ runs-on: ${{ matrix.platform.runner }}
147
+ strategy:
148
+ matrix:
149
+ platform:
150
+ - runner: macos-15-intel
151
+ target: x86_64
152
+ - runner: macos-latest
153
+ target: aarch64
154
+ steps:
155
+ - uses: actions/checkout@v7
156
+ - uses: actions/setup-python@v7
157
+ with:
158
+ python-version: "3.11"
159
+ - name: Build wheels
160
+ uses: PyO3/maturin-action@v1
161
+ with:
162
+ target: ${{ matrix.platform.target }}
163
+ args: --release --out dist
164
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
165
+ - uses: actions/setup-python@v7
166
+ with:
167
+ python-version: "3.14t"
168
+ - name: Build free-threaded wheels
169
+ uses: PyO3/maturin-action@v1
170
+ with:
171
+ target: ${{ matrix.platform.target }}
172
+ args: --release --out dist -i python3.14t
173
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
174
+ - name: Upload wheels
175
+ uses: actions/upload-artifact@v7
176
+ with:
177
+ name: wheels-macos-${{ matrix.platform.target }}
178
+ path: dist
179
+
180
+ sdist:
181
+ runs-on: ubuntu-latest
182
+ steps:
183
+ - uses: actions/checkout@v7
184
+ - name: Build sdist
185
+ uses: PyO3/maturin-action@v1
186
+ with:
187
+ command: sdist
188
+ args: --out dist
189
+ - name: Upload sdist
190
+ uses: actions/upload-artifact@v7
191
+ with:
192
+ name: wheels-sdist
193
+ path: dist
194
+
195
+ release:
196
+ name: Release
197
+ runs-on: ubuntu-latest
198
+ if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
199
+ needs: [linux, musllinux, windows, macos, sdist]
200
+ permissions:
201
+ # Use to sign the release artifacts
202
+ id-token: write
203
+ # Used to upload release artifacts
204
+ contents: write
205
+ # Used to generate artifact attestation
206
+ attestations: write
207
+ steps:
208
+ - uses: actions/download-artifact@v8
209
+ - name: Generate artifact attestation
210
+ uses: actions/attest@v4
211
+ with:
212
+ subject-path: 'wheels-*/*'
213
+ - name: Install uv
214
+ if: ${{ startsWith(github.ref, 'refs/tags/') }}
215
+ uses: astral-sh/setup-uv@v7
216
+ - name: Publish to PyPI
217
+ if: ${{ startsWith(github.ref, 'refs/tags/') }}
218
+ run: uv publish --trusted-publishing always 'wheels-*/*'
@@ -0,0 +1,6 @@
1
+ /target
2
+ /dist
3
+ __pycache__/
4
+ .pytest_cache/
5
+ .venv/
6
+ .idea/
@@ -0,0 +1,28 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v6.0.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ - id: no-commit-to-branch
9
+ - repo: https://github.com/astral-sh/ruff-pre-commit
10
+ rev: v0.14.3
11
+ hooks:
12
+ - id: ruff-check
13
+ args: [--fix]
14
+ - id: ruff-format
15
+ - repo: local
16
+ hooks:
17
+ - id: cargo-fmt
18
+ name: cargo fmt
19
+ entry: cargo fmt --check
20
+ language: system
21
+ types: [rust]
22
+ pass_filenames: false
23
+ - id: cargo-clippy
24
+ name: cargo clippy
25
+ entry: cargo clippy --release -- -D warnings
26
+ language: system
27
+ types: [rust]
28
+ pass_filenames: false
@@ -0,0 +1,280 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "autocfg"
7
+ version = "1.5.1"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
10
+
11
+ [[package]]
12
+ name = "crossbeam-deque"
13
+ version = "0.8.8"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a"
16
+ dependencies = [
17
+ "crossbeam-epoch",
18
+ "crossbeam-utils",
19
+ ]
20
+
21
+ [[package]]
22
+ name = "crossbeam-epoch"
23
+ version = "0.9.21"
24
+ source = "registry+https://github.com/rust-lang/crates.io-index"
25
+ checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"
26
+ dependencies = [
27
+ "crossbeam-utils",
28
+ ]
29
+
30
+ [[package]]
31
+ name = "crossbeam-utils"
32
+ version = "0.8.23"
33
+ source = "registry+https://github.com/rust-lang/crates.io-index"
34
+ checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
35
+
36
+ [[package]]
37
+ name = "either"
38
+ version = "1.18.0"
39
+ source = "registry+https://github.com/rust-lang/crates.io-index"
40
+ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
41
+
42
+ [[package]]
43
+ name = "heck"
44
+ version = "0.5.0"
45
+ source = "registry+https://github.com/rust-lang/crates.io-index"
46
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
47
+
48
+ [[package]]
49
+ name = "libc"
50
+ version = "0.2.189"
51
+ source = "registry+https://github.com/rust-lang/crates.io-index"
52
+ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
53
+
54
+ [[package]]
55
+ name = "lsdetect"
56
+ version = "0.1.0"
57
+ dependencies = [
58
+ "numpy",
59
+ "pyo3",
60
+ "rayon",
61
+ ]
62
+
63
+ [[package]]
64
+ name = "matrixmultiply"
65
+ version = "0.3.11"
66
+ source = "registry+https://github.com/rust-lang/crates.io-index"
67
+ checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7"
68
+ dependencies = [
69
+ "autocfg",
70
+ "rawpointer",
71
+ ]
72
+
73
+ [[package]]
74
+ name = "ndarray"
75
+ version = "0.17.2"
76
+ source = "registry+https://github.com/rust-lang/crates.io-index"
77
+ checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d"
78
+ dependencies = [
79
+ "matrixmultiply",
80
+ "num-complex",
81
+ "num-integer",
82
+ "num-traits",
83
+ "portable-atomic",
84
+ "portable-atomic-util",
85
+ "rawpointer",
86
+ ]
87
+
88
+ [[package]]
89
+ name = "num-complex"
90
+ version = "0.4.6"
91
+ source = "registry+https://github.com/rust-lang/crates.io-index"
92
+ checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
93
+ dependencies = [
94
+ "num-traits",
95
+ ]
96
+
97
+ [[package]]
98
+ name = "num-integer"
99
+ version = "0.1.47"
100
+ source = "registry+https://github.com/rust-lang/crates.io-index"
101
+ checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"
102
+ dependencies = [
103
+ "num-traits",
104
+ ]
105
+
106
+ [[package]]
107
+ name = "num-traits"
108
+ version = "0.2.19"
109
+ source = "registry+https://github.com/rust-lang/crates.io-index"
110
+ checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
111
+ dependencies = [
112
+ "autocfg",
113
+ ]
114
+
115
+ [[package]]
116
+ name = "numpy"
117
+ version = "0.29.0"
118
+ source = "registry+https://github.com/rust-lang/crates.io-index"
119
+ checksum = "6a5b15d63a5ff39e378daed0e1340d3a5964703ea9712eb09a0dc66fade996f4"
120
+ dependencies = [
121
+ "libc",
122
+ "ndarray",
123
+ "num-complex",
124
+ "num-integer",
125
+ "num-traits",
126
+ "pyo3",
127
+ "pyo3-build-config",
128
+ "rustc-hash",
129
+ ]
130
+
131
+ [[package]]
132
+ name = "once_cell"
133
+ version = "1.21.4"
134
+ source = "registry+https://github.com/rust-lang/crates.io-index"
135
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
136
+
137
+ [[package]]
138
+ name = "portable-atomic"
139
+ version = "1.15.0"
140
+ source = "registry+https://github.com/rust-lang/crates.io-index"
141
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
142
+
143
+ [[package]]
144
+ name = "portable-atomic-util"
145
+ version = "0.2.8"
146
+ source = "registry+https://github.com/rust-lang/crates.io-index"
147
+ checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715"
148
+ dependencies = [
149
+ "portable-atomic",
150
+ ]
151
+
152
+ [[package]]
153
+ name = "proc-macro2"
154
+ version = "1.0.107"
155
+ source = "registry+https://github.com/rust-lang/crates.io-index"
156
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
157
+ dependencies = [
158
+ "unicode-ident",
159
+ ]
160
+
161
+ [[package]]
162
+ name = "pyo3"
163
+ version = "0.29.2"
164
+ source = "registry+https://github.com/rust-lang/crates.io-index"
165
+ checksum = "4688ddedf473e32662b9b067670129a8afb8c18e351482c70d62ba4a88171e8b"
166
+ dependencies = [
167
+ "libc",
168
+ "once_cell",
169
+ "portable-atomic",
170
+ "pyo3-build-config",
171
+ "pyo3-ffi",
172
+ "pyo3-macros",
173
+ ]
174
+
175
+ [[package]]
176
+ name = "pyo3-build-config"
177
+ version = "0.29.2"
178
+ source = "registry+https://github.com/rust-lang/crates.io-index"
179
+ checksum = "f41027e41b4bd03f6e60f9f417fe24a6341a6bb744edd62b6f709f2a52ea30e9"
180
+ dependencies = [
181
+ "target-lexicon",
182
+ ]
183
+
184
+ [[package]]
185
+ name = "pyo3-ffi"
186
+ version = "0.29.2"
187
+ source = "registry+https://github.com/rust-lang/crates.io-index"
188
+ checksum = "e591a95526fead067432c3b3a33fc74770b87b1e04e73671090d9c2055a2b327"
189
+ dependencies = [
190
+ "libc",
191
+ "pyo3-build-config",
192
+ ]
193
+
194
+ [[package]]
195
+ name = "pyo3-macros"
196
+ version = "0.29.2"
197
+ source = "registry+https://github.com/rust-lang/crates.io-index"
198
+ checksum = "73225868fc1cd84eef2c3c230ddb91273bf1de46aeb8a4248da76d32a0924a1c"
199
+ dependencies = [
200
+ "proc-macro2",
201
+ "pyo3-macros-backend",
202
+ "quote",
203
+ "syn",
204
+ ]
205
+
206
+ [[package]]
207
+ name = "pyo3-macros-backend"
208
+ version = "0.29.2"
209
+ source = "registry+https://github.com/rust-lang/crates.io-index"
210
+ checksum = "571575aa3749fa6216757dd47d2a3e7ef360f329a40f0666a9fbd14889024952"
211
+ dependencies = [
212
+ "heck",
213
+ "proc-macro2",
214
+ "quote",
215
+ "syn",
216
+ ]
217
+
218
+ [[package]]
219
+ name = "quote"
220
+ version = "1.0.47"
221
+ source = "registry+https://github.com/rust-lang/crates.io-index"
222
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
223
+ dependencies = [
224
+ "proc-macro2",
225
+ ]
226
+
227
+ [[package]]
228
+ name = "rawpointer"
229
+ version = "0.2.1"
230
+ source = "registry+https://github.com/rust-lang/crates.io-index"
231
+ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
232
+
233
+ [[package]]
234
+ name = "rayon"
235
+ version = "1.12.0"
236
+ source = "registry+https://github.com/rust-lang/crates.io-index"
237
+ checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
238
+ dependencies = [
239
+ "either",
240
+ "rayon-core",
241
+ ]
242
+
243
+ [[package]]
244
+ name = "rayon-core"
245
+ version = "1.13.0"
246
+ source = "registry+https://github.com/rust-lang/crates.io-index"
247
+ checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
248
+ dependencies = [
249
+ "crossbeam-deque",
250
+ "crossbeam-utils",
251
+ ]
252
+
253
+ [[package]]
254
+ name = "rustc-hash"
255
+ version = "2.1.3"
256
+ source = "registry+https://github.com/rust-lang/crates.io-index"
257
+ checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
258
+
259
+ [[package]]
260
+ name = "syn"
261
+ version = "2.0.119"
262
+ source = "registry+https://github.com/rust-lang/crates.io-index"
263
+ checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
264
+ dependencies = [
265
+ "proc-macro2",
266
+ "quote",
267
+ "unicode-ident",
268
+ ]
269
+
270
+ [[package]]
271
+ name = "target-lexicon"
272
+ version = "0.13.5"
273
+ source = "registry+https://github.com/rust-lang/crates.io-index"
274
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
275
+
276
+ [[package]]
277
+ name = "unicode-ident"
278
+ version = "1.0.26"
279
+ source = "registry+https://github.com/rust-lang/crates.io-index"
280
+ checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"
@@ -0,0 +1,24 @@
1
+ [package]
2
+ name = "lsdetect"
3
+ version = "0.1.0"
4
+ edition = "2024"
5
+ license = "MIT OR Apache-2.0"
6
+ authors = ["Patrick Zwerschke"]
7
+ repository = "https://github.com/p5k369/lsdetect"
8
+ description = "Line segment detector (LSD) in pure Rust, with Python bindings"
9
+ readme = "README.md"
10
+
11
+ [lib]
12
+ crate-type = ["cdylib", "rlib"]
13
+
14
+ [lints.rust]
15
+ missing_docs = "warn"
16
+
17
+ [dependencies]
18
+ numpy = { version = "0.29.0", optional = true }
19
+ pyo3 = { version = "0.29.2", features = ["abi3-py311"], optional = true }
20
+ rayon = "1.12.0"
21
+
22
+ [features]
23
+ default = []
24
+ extension-module = ["dep:pyo3", "dep:numpy", "pyo3/extension-module"]