rgapi 0.1.2__tar.gz → 0.1.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.
@@ -0,0 +1,83 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ tags: ['v*']
7
+ pull_request:
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v6
14
+ - run: cargo test
15
+
16
+ linux:
17
+ needs: test
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v6
21
+ - uses: PyO3/maturin-action@v1
22
+ with:
23
+ args: --release --out dist -i python3.10 -i python3.11 -i python3.12 -i python3.13
24
+ manylinux: auto
25
+ before-script-linux: |
26
+ python3.13 -m pip install 'fastship>=0.0.13'
27
+ python3.13 -m fastship.rs_prep --release
28
+ - uses: actions/upload-artifact@v4
29
+ with:
30
+ name: wheels-linux
31
+ path: dist
32
+
33
+ macos:
34
+ needs: test
35
+ runs-on: macos-latest
36
+ steps:
37
+ - uses: actions/checkout@v6
38
+ - uses: actions/setup-python@v6
39
+ with:
40
+ python-version: '3.13'
41
+ - run: python -m pip install 'fastship>=0.0.13'
42
+ - run: python -m fastship.rs_prep --release
43
+ - uses: PyO3/maturin-action@v1
44
+ with:
45
+ args: --release --out dist -i python3.10 -i python3.11 -i python3.12 -i python3.13
46
+ - uses: actions/upload-artifact@v4
47
+ with:
48
+ name: wheels-macos
49
+ path: dist
50
+
51
+ sdist:
52
+ runs-on: ubuntu-latest
53
+ steps:
54
+ - uses: actions/checkout@v6
55
+ - uses: PyO3/maturin-action@v1
56
+ with:
57
+ command: sdist
58
+ args: -o dist
59
+ - uses: actions/upload-artifact@v4
60
+ with:
61
+ name: wheels-sdist
62
+ path: dist
63
+
64
+ publish:
65
+ if: startsWith(github.ref, 'refs/tags/v')
66
+ needs: [linux, macos, sdist]
67
+ runs-on: ubuntu-latest
68
+ permissions:
69
+ id-token: write
70
+ contents: write
71
+ steps:
72
+ - uses: actions/checkout@v6
73
+ - uses: actions/download-artifact@v4
74
+ with:
75
+ path: dist
76
+ merge-multiple: true
77
+ - uses: softprops/action-gh-release@v2
78
+ with:
79
+ files: dist/*
80
+ generate_release_notes: true
81
+ - uses: pypa/gh-action-pypi-publish@release/v1
82
+ with:
83
+ packages-dir: dist/
@@ -11,12 +11,6 @@ dependencies = [
11
11
  "memchr",
12
12
  ]
13
13
 
14
- [[package]]
15
- name = "autocfg"
16
- version = "1.5.1"
17
- source = "registry+https://github.com/rust-lang/crates.io-index"
18
- checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
19
-
20
14
  [[package]]
21
15
  name = "bstr"
22
16
  version = "1.12.1"
@@ -149,15 +143,6 @@ dependencies = [
149
143
  "winapi-util",
150
144
  ]
151
145
 
152
- [[package]]
153
- name = "indoc"
154
- version = "2.0.7"
155
- source = "registry+https://github.com/rust-lang/crates.io-index"
156
- checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
157
- dependencies = [
158
- "rustversion",
159
- ]
160
-
161
146
  [[package]]
162
147
  name = "libc"
163
148
  version = "0.2.186"
@@ -166,9 +151,9 @@ checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
166
151
 
167
152
  [[package]]
168
153
  name = "log"
169
- version = "0.4.32"
154
+ version = "0.4.33"
170
155
  source = "registry+https://github.com/rust-lang/crates.io-index"
171
- checksum = "953f07c43838f8e6f9758cab68bf5bed85465e7587ebe0b823f1bcd81978ad3a"
156
+ checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad"
172
157
 
173
158
  [[package]]
174
159
  name = "memchr"
@@ -185,15 +170,6 @@ dependencies = [
185
170
  "libc",
186
171
  ]
187
172
 
188
- [[package]]
189
- name = "memoffset"
190
- version = "0.9.1"
191
- source = "registry+https://github.com/rust-lang/crates.io-index"
192
- checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
193
- dependencies = [
194
- "autocfg",
195
- ]
196
-
197
173
  [[package]]
198
174
  name = "once_cell"
199
175
  version = "1.21.4"
@@ -217,37 +193,32 @@ dependencies = [
217
193
 
218
194
  [[package]]
219
195
  name = "pyo3"
220
- version = "0.23.5"
196
+ version = "0.29.0"
221
197
  source = "registry+https://github.com/rust-lang/crates.io-index"
222
- checksum = "7778bffd85cf38175ac1f545509665d0b9b92a198ca7941f131f85f7a4f9a872"
198
+ checksum = "cd274650b21d4bfc26a0a47587962c1edb425f69287324355cd040c3ea66071c"
223
199
  dependencies = [
224
- "cfg-if",
225
- "indoc",
226
200
  "libc",
227
- "memoffset",
228
201
  "once_cell",
229
202
  "portable-atomic",
230
203
  "pyo3-build-config",
231
204
  "pyo3-ffi",
232
205
  "pyo3-macros",
233
- "unindent",
234
206
  ]
235
207
 
236
208
  [[package]]
237
209
  name = "pyo3-build-config"
238
- version = "0.23.5"
210
+ version = "0.29.0"
239
211
  source = "registry+https://github.com/rust-lang/crates.io-index"
240
- checksum = "94f6cbe86ef3bf18998d9df6e0f3fc1050a8c5efa409bf712e661a4366e010fb"
212
+ checksum = "c5e2a7d2f0d013342f295c048ad19237add5154a55b1c5a254c0ec93d4109078"
241
213
  dependencies = [
242
- "once_cell",
243
214
  "target-lexicon",
244
215
  ]
245
216
 
246
217
  [[package]]
247
218
  name = "pyo3-ffi"
248
- version = "0.23.5"
219
+ version = "0.29.0"
249
220
  source = "registry+https://github.com/rust-lang/crates.io-index"
250
- checksum = "e9f1b4c431c0bb1c8fb0a338709859eed0d030ff6daa34368d3b152a63dfdd8d"
221
+ checksum = "ca85c467da1bbc8d866eea5deff9cf29ea5f7785054a17da36e65bda9c05845b"
251
222
  dependencies = [
252
223
  "libc",
253
224
  "pyo3-build-config",
@@ -255,9 +226,9 @@ dependencies = [
255
226
 
256
227
  [[package]]
257
228
  name = "pyo3-macros"
258
- version = "0.23.5"
229
+ version = "0.29.0"
259
230
  source = "registry+https://github.com/rust-lang/crates.io-index"
260
- checksum = "fbc2201328f63c4710f68abdf653c89d8dbc2858b88c5d88b0ff38a75288a9da"
231
+ checksum = "9ac53762fd065daa3194dd09337a38bd793a188100fd1a9304c4ab312d901771"
261
232
  dependencies = [
262
233
  "proc-macro2",
263
234
  "pyo3-macros-backend",
@@ -267,13 +238,12 @@ dependencies = [
267
238
 
268
239
  [[package]]
269
240
  name = "pyo3-macros-backend"
270
- version = "0.23.5"
241
+ version = "0.29.0"
271
242
  source = "registry+https://github.com/rust-lang/crates.io-index"
272
- checksum = "fca6726ad0f3da9c9de093d6f116a93c1a38e417ed73bf138472cf4064f72028"
243
+ checksum = "4ca3a1557399783172dc5bf39cfca835157732532cba56b71d2292161e53b362"
273
244
  dependencies = [
274
245
  "heck",
275
246
  "proc-macro2",
276
- "pyo3-build-config",
277
247
  "quote",
278
248
  "syn",
279
249
  ]
@@ -306,7 +276,7 @@ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
306
276
 
307
277
  [[package]]
308
278
  name = "rgapi"
309
- version = "0.1.2"
279
+ version = "0.1.4"
310
280
  dependencies = [
311
281
  "globset",
312
282
  "grep-matcher",
@@ -316,12 +286,6 @@ dependencies = [
316
286
  "pyo3",
317
287
  ]
318
288
 
319
- [[package]]
320
- name = "rustversion"
321
- version = "1.0.22"
322
- source = "registry+https://github.com/rust-lang/crates.io-index"
323
- checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
324
-
325
289
  [[package]]
326
290
  name = "same-file"
327
291
  version = "1.0.6"
@@ -373,9 +337,9 @@ dependencies = [
373
337
 
374
338
  [[package]]
375
339
  name = "target-lexicon"
376
- version = "0.12.16"
340
+ version = "0.13.5"
377
341
  source = "registry+https://github.com/rust-lang/crates.io-index"
378
- checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
342
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
379
343
 
380
344
  [[package]]
381
345
  name = "unicode-ident"
@@ -383,12 +347,6 @@ version = "1.0.24"
383
347
  source = "registry+https://github.com/rust-lang/crates.io-index"
384
348
  checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
385
349
 
386
- [[package]]
387
- name = "unindent"
388
- version = "0.2.4"
389
- source = "registry+https://github.com/rust-lang/crates.io-index"
390
- checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
391
-
392
350
  [[package]]
393
351
  name = "walkdir"
394
352
  version = "2.5.0"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "rgapi"
3
- version = "0.1.2"
3
+ version = "0.1.4"
4
4
  edition = "2021"
5
5
  license = "MIT OR Apache-2.0"
6
6
  description = "Python API for ripgrep-style file walking and searching"
@@ -14,12 +14,12 @@ name = "rgapi"
14
14
  crate-type = ["cdylib", "rlib"]
15
15
 
16
16
  [dependencies]
17
- globset = "0.4.18"
18
- grep-matcher = "0.1.8"
19
- grep-regex = "0.1.14"
20
- grep-searcher = "0.1.16"
21
- ignore = "0.4.26"
22
- pyo3 = { version = "0.23", optional = true }
17
+ globset = ">=0.4.18"
18
+ grep-matcher = ">=0.1.8"
19
+ grep-regex = ">=0.1.14"
20
+ grep-searcher = ">=0.1.16"
21
+ ignore = ">=0.4.26"
22
+ pyo3 = { version = ">=0.28", optional = true }
23
23
 
24
24
  [features]
25
25
  extension-module = ["pyo3", "pyo3/extension-module"]
@@ -17,17 +17,23 @@ The public Python API lives in `python/rgapi/__init__.py`. The extension module
17
17
  ## Commands
18
18
 
19
19
  ```bash
20
- cargo fmt --check
21
- cargo check
22
- maturin develop
23
- pytest -q
20
+ ship-rs-test
24
21
  ```
25
22
 
26
- Run `cargo test` for Rust unit tests. Run `chkstyle` after Python edits once tests pass.
23
+ Run `cargo fmt --check` and `cargo check` for Rust-only edits. Run `chkstyle` after Python edits once tests pass.
27
24
 
28
25
  ## Release
29
26
 
30
- Release plumbing mirrors exhash. `tools/bump.sh` bumps the patch version in `pyproject.toml` and `Cargo.toml`; `tools/bump2.sh` bumps the minor version; `tools/release.sh` tags the current version and pushes `main` plus tags. The GitHub workflow builds wheels for Python 3.10-3.13 on Linux and macOS and publishes artifacts to GitHub Releases and PyPI when a `v*` tag is pushed.
27
+ The canonical version lives in `Cargo.toml`. `pyproject.toml` gets the Python package version from Cargo via `dynamic = ["version"]`.
28
+
29
+ Release flow is: release first, then bump.
30
+
31
+ 1. Run `ship-rs-test`.
32
+ 2. Confirm the release version in `Cargo.toml` (`[package].version`).
33
+ 3. Run `ship-rs-release`.
34
+ 4. After pushing the release tag, run `ship-rs-bump`, commit the `Cargo.toml` version bump, and push to `main` without a tag.
35
+
36
+ The GitHub workflow builds wheels for Python 3.10-3.13 on Linux and macOS and publishes artifacts to GitHub Releases and PyPI when a `v*` tag is pushed.
31
37
 
32
38
  ## Design notes
33
39
 
@@ -1,8 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rgapi
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
+ Requires-Dist: fastship>=0.0.12 ; extra == 'dev'
7
+ Requires-Dist: maturin>=1.0,<2.0 ; extra == 'dev'
8
+ Requires-Dist: pytest ; extra == 'dev'
9
+ Provides-Extra: dev
6
10
  Summary: Python API for ripgrep-style file walking and searching
7
11
  Home-Page: https://github.com/AnswerDotAI/rgapi
8
12
  Author-email: Jeremy Howard <j@fast.ai>
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "rgapi"
7
- version = "0.1.2"
7
+ dynamic = ["version"]
8
8
  description = "Python API for ripgrep-style file walking and searching"
9
9
  license = {text = "MIT OR Apache-2.0"}
10
10
  requires-python = ">=3.10"
@@ -15,6 +15,9 @@ classifiers = [
15
15
  "Programming Language :: Python :: Implementation :: CPython",
16
16
  ]
17
17
 
18
+ [project.optional-dependencies]
19
+ dev = ["fastship>=0.0.12", "maturin>=1.0,<2.0", "pytest"]
20
+
18
21
  [project.urls]
19
22
  Homepage = "https://github.com/AnswerDotAI/rgapi"
20
23
  Repository = "https://github.com/AnswerDotAI/rgapi"
@@ -27,6 +30,3 @@ module-name = "rgapi._core"
27
30
 
28
31
  [tool.fastship]
29
32
  branch = "main"
30
-
31
- [tool.fastship.rs]
32
- bins = []
@@ -13,7 +13,7 @@ use crate::{
13
13
  search_text as search_text_core, FindOptions, RgIter, RgOptions, SearchLine,
14
14
  };
15
15
 
16
- #[pyclass(name = "SearchLine", eq)]
16
+ #[pyclass(name = "SearchLine", eq, skip_from_py_object)]
17
17
  #[derive(Clone, PartialEq)]
18
18
  struct SearchLinePy {
19
19
  #[pyo3(get)]
@@ -105,7 +105,7 @@ fn check_signals_or_cancel(py: Python<'_>, iter: &RgIter) -> PyResult<()> {
105
105
  fn next_rg_line_py(py: Python<'_>, iter: &mut RgIter) -> PyResult<Option<SearchLinePy>> {
106
106
  loop {
107
107
  check_signals_or_cancel(py, iter)?;
108
- let res = py.allow_threads(|| iter.next_timeout(Duration::from_millis(50)));
108
+ let res = py.detach(|| iter.next_timeout(Duration::from_millis(50)));
109
109
  check_signals_or_cancel(py, iter)?;
110
110
  match res {
111
111
  Ok(Ok(line)) => return Ok(Some(SearchLinePy::from(line))),
@@ -123,7 +123,7 @@ fn collect_rg_py(py: Python<'_>, mut iter: RgIter) -> PyResult<Vec<SearchLinePy>
123
123
  }
124
124
  Ok(res)
125
125
  }
126
- #[pyclass(name = "Regex")]
126
+ #[pyclass(name = "Regex", skip_from_py_object)]
127
127
  #[derive(Clone)]
128
128
  struct RegexPy {
129
129
  #[pyo3(get)]
@@ -1,63 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- tags: ['v*']
7
- pull_request:
8
-
9
- jobs:
10
- test:
11
- runs-on: ubuntu-latest
12
- steps:
13
- - uses: actions/checkout@v6
14
- - run: cargo test
15
-
16
- build:
17
- needs: test
18
- strategy:
19
- matrix:
20
- os: [ubuntu-latest, macos-latest]
21
- python: ['3.10', '3.11', '3.12', '3.13']
22
- runs-on: ${{ matrix.os }}
23
- steps:
24
- - uses: actions/checkout@v6
25
- - uses: dtolnay/rust-toolchain@stable
26
- - uses: actions/setup-python@v5
27
- with:
28
- python-version: ${{ matrix.python }}
29
- - run: pip install fastship
30
- - run: ship-rs-prep --release
31
- - uses: PyO3/maturin-action@v1
32
- with:
33
- command: build
34
- args: --release -o dist
35
- - uses: actions/upload-artifact@v4
36
- with:
37
- name: wheel-${{ matrix.os }}-py${{ matrix.python }}
38
- path: dist/*.whl
39
-
40
- publish:
41
- if: startsWith(github.ref, 'refs/tags/v')
42
- needs: build
43
- runs-on: ubuntu-latest
44
- permissions:
45
- id-token: write
46
- contents: write
47
- steps:
48
- - uses: actions/checkout@v6
49
- - uses: PyO3/maturin-action@v1
50
- with:
51
- command: sdist
52
- args: -o dist
53
- - uses: actions/download-artifact@v4
54
- with:
55
- path: dist
56
- merge-multiple: true
57
- - uses: softprops/action-gh-release@v2
58
- with:
59
- files: dist/*
60
- generate_release_notes: true
61
- - uses: pypa/gh-action-pypi-publish@release/v1
62
- with:
63
- packages-dir: dist/
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes