ignore-python 0.3.2__tar.gz → 0.3.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.
@@ -0,0 +1,15 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "cargo" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "weekly"
12
+ - package-ecosystem: "pip" # See documentation for possible values
13
+ directory: "/" # Location of package manifests
14
+ schedule:
15
+ interval: "weekly"
@@ -1,4 +1,4 @@
1
- # This file is autogenerated by maturin v1.8.3
1
+ # This file is autogenerated by maturin v1.12.6
2
2
  # To update, run
3
3
  #
4
4
  # maturin generate-ci github --pytest
@@ -8,7 +8,8 @@ name: CI
8
8
  on:
9
9
  push:
10
10
  branches:
11
- - '**'
11
+ - main
12
+ - master
12
13
  tags:
13
14
  - '*'
14
15
  pull_request:
@@ -36,8 +37,8 @@ jobs:
36
37
  - runner: ubuntu-22.04
37
38
  target: ppc64le
38
39
  steps:
39
- - uses: actions/checkout@v4
40
- - uses: actions/setup-python@v5
40
+ - uses: actions/checkout@v6
41
+ - uses: actions/setup-python@v6
41
42
  with:
42
43
  python-version: 3.x
43
44
  - name: Build wheels
@@ -48,7 +49,7 @@ jobs:
48
49
  sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
49
50
  manylinux: auto
50
51
  - name: Upload wheels
51
- uses: actions/upload-artifact@v4
52
+ uses: actions/upload-artifact@v6
52
53
  with:
53
54
  name: wheels-linux-${{ matrix.platform.target }}
54
55
  path: dist
@@ -59,7 +60,7 @@ jobs:
59
60
  set -e
60
61
  python3 -m venv .venv
61
62
  source .venv/bin/activate
62
- pip install ignore-python --find-links dist --force-reinstall --no-cache --no-index
63
+ pip install ignore-python --find-links dist --force-reinstall
63
64
  pip install pytest
64
65
  pytest
65
66
  - name: pytest
@@ -75,7 +76,7 @@ jobs:
75
76
  pip3 install -U pip pytest
76
77
  run: |
77
78
  set -e
78
- pip3 install ignore-python --find-links dist --force-reinstall --no-cache --no-index
79
+ pip3 install ignore-python --find-links dist --force-reinstall
79
80
  pytest
80
81
 
81
82
  musllinux:
@@ -92,8 +93,8 @@ jobs:
92
93
  - runner: ubuntu-22.04
93
94
  target: armv7
94
95
  steps:
95
- - uses: actions/checkout@v4
96
- - uses: actions/setup-python@v5
96
+ - uses: actions/checkout@v6
97
+ - uses: actions/setup-python@v6
97
98
  with:
98
99
  python-version: 3.x
99
100
  - name: Build wheels
@@ -104,24 +105,22 @@ jobs:
104
105
  sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
105
106
  manylinux: musllinux_1_2
106
107
  - name: Upload wheels
107
- uses: actions/upload-artifact@v4
108
+ uses: actions/upload-artifact@v6
108
109
  with:
109
110
  name: wheels-musllinux-${{ matrix.platform.target }}
110
111
  path: dist
111
112
  - name: pytest
112
113
  if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
113
- uses: addnab/docker-run-action@v3
114
- with:
115
- image: alpine:latest
116
- options: -v ${{ github.workspace }}:/io -w /io
117
- run: |
118
- set -e
114
+ run: |
115
+ set -e
116
+ docker run --rm -v ${{ github.workspace }}:/io -w /io alpine:latest sh -c '
119
117
  apk add py3-pip py3-virtualenv
120
118
  python3 -m virtualenv .venv
121
119
  source .venv/bin/activate
122
- pip install ignore-python --find-links dist --force-reinstall --no-cache --no-index
120
+ pip install ignore-python --no-index --find-links dist --force-reinstall
123
121
  pip install pytest
124
122
  pytest
123
+ '
125
124
  - name: pytest
126
125
  if: ${{ !startsWith(matrix.platform.target, 'x86') }}
127
126
  uses: uraimo/run-on-arch-action@v2
@@ -136,7 +135,7 @@ jobs:
136
135
  python3 -m virtualenv .venv
137
136
  source .venv/bin/activate
138
137
  pip install pytest
139
- pip install ignore-python --find-links dist --force-reinstall --no-cache --no-index
138
+ pip install ignore-python --find-links dist --force-reinstall
140
139
  pytest
141
140
 
142
141
  windows:
@@ -146,14 +145,19 @@ jobs:
146
145
  platform:
147
146
  - runner: windows-latest
148
147
  target: x64
148
+ python_arch: x64
149
149
  - runner: windows-latest
150
150
  target: x86
151
+ python_arch: x86
152
+ - runner: windows-11-arm
153
+ target: aarch64
154
+ python_arch: arm64
151
155
  steps:
152
- - uses: actions/checkout@v4
153
- - uses: actions/setup-python@v5
156
+ - uses: actions/checkout@v6
157
+ - uses: actions/setup-python@v6
154
158
  with:
155
- python-version: 3.x
156
- architecture: ${{ matrix.platform.target }}
159
+ python-version: 3.13
160
+ architecture: ${{ matrix.platform.python_arch }}
157
161
  - name: Build wheels
158
162
  uses: PyO3/maturin-action@v1
159
163
  with:
@@ -161,18 +165,17 @@ jobs:
161
165
  args: --release --out dist --find-interpreter
162
166
  sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
163
167
  - name: Upload wheels
164
- uses: actions/upload-artifact@v4
168
+ uses: actions/upload-artifact@v6
165
169
  with:
166
170
  name: wheels-windows-${{ matrix.platform.target }}
167
171
  path: dist
168
172
  - name: pytest
169
- if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
170
173
  shell: bash
171
174
  run: |
172
175
  set -e
173
176
  python3 -m venv .venv
174
177
  source .venv/Scripts/activate
175
- pip install ignore-python --find-links dist --force-reinstall --no-cache --no-index
178
+ pip install ignore-python --find-links dist --force-reinstall
176
179
  pip install pytest
177
180
  pytest
178
181
 
@@ -181,11 +184,13 @@ jobs:
181
184
  strategy:
182
185
  matrix:
183
186
  platform:
184
- - runner: macos-14
187
+ - runner: macos-15-intel
188
+ target: x86_64
189
+ - runner: macos-latest
185
190
  target: aarch64
186
191
  steps:
187
- - uses: actions/checkout@v4
188
- - uses: actions/setup-python@v5
192
+ - uses: actions/checkout@v6
193
+ - uses: actions/setup-python@v6
189
194
  with:
190
195
  python-version: 3.x
191
196
  - name: Build wheels
@@ -195,7 +200,7 @@ jobs:
195
200
  args: --release --out dist --find-interpreter
196
201
  sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
197
202
  - name: Upload wheels
198
- uses: actions/upload-artifact@v4
203
+ uses: actions/upload-artifact@v6
199
204
  with:
200
205
  name: wheels-macos-${{ matrix.platform.target }}
201
206
  path: dist
@@ -204,21 +209,21 @@ jobs:
204
209
  set -e
205
210
  python3 -m venv .venv
206
211
  source .venv/bin/activate
207
- pip install ignore-python --find-links dist --force-reinstall --no-cache --no-index
212
+ pip install ignore-python --find-links dist --force-reinstall
208
213
  pip install pytest
209
214
  pytest
210
215
 
211
216
  sdist:
212
217
  runs-on: ubuntu-latest
213
218
  steps:
214
- - uses: actions/checkout@v4
219
+ - uses: actions/checkout@v6
215
220
  - name: Build sdist
216
221
  uses: PyO3/maturin-action@v1
217
222
  with:
218
223
  command: sdist
219
224
  args: --out dist
220
225
  - name: Upload sdist
221
- uses: actions/upload-artifact@v4
226
+ uses: actions/upload-artifact@v6
222
227
  with:
223
228
  name: wheels-sdist
224
229
  path: dist
@@ -228,6 +233,8 @@ jobs:
228
233
  runs-on: ubuntu-latest
229
234
  if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
230
235
  needs: [linux, musllinux, windows, macos, sdist]
236
+ environment:
237
+ name: pypi
231
238
  permissions:
232
239
  # Use to sign the release artifacts
233
240
  id-token: write
@@ -236,16 +243,14 @@ jobs:
236
243
  # Used to generate artifact attestation
237
244
  attestations: write
238
245
  steps:
239
- - uses: actions/download-artifact@v4
246
+ - uses: actions/download-artifact@v7
240
247
  - name: Generate artifact attestation
241
- uses: actions/attest-build-provenance@v2
248
+ uses: actions/attest-build-provenance@v3
242
249
  with:
243
250
  subject-path: 'wheels-*/*'
251
+ - name: Install uv
252
+ if: ${{ startsWith(github.ref, 'refs/tags/') }}
253
+ uses: astral-sh/setup-uv@v7
244
254
  - name: Publish to PyPI
245
255
  if: ${{ startsWith(github.ref, 'refs/tags/') }}
246
- uses: PyO3/maturin-action@v1
247
- env:
248
- MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
249
- with:
250
- command: upload
251
- args: --non-interactive --skip-existing wheels-*/*
256
+ run: uv publish 'wheels-*/*'
@@ -11,12 +11,6 @@ dependencies = [
11
11
  "memchr",
12
12
  ]
13
13
 
14
- [[package]]
15
- name = "autocfg"
16
- version = "1.5.0"
17
- source = "registry+https://github.com/rust-lang/crates.io-index"
18
- checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
19
-
20
14
  [[package]]
21
15
  name = "bstr"
22
16
  version = "1.12.1"
@@ -89,26 +83,17 @@ dependencies = [
89
83
 
90
84
  [[package]]
91
85
  name = "ignore-python"
92
- version = "0.3.2"
86
+ version = "0.3.3"
93
87
  dependencies = [
94
88
  "ignore",
95
89
  "pyo3",
96
90
  ]
97
91
 
98
- [[package]]
99
- name = "indoc"
100
- version = "2.0.7"
101
- source = "registry+https://github.com/rust-lang/crates.io-index"
102
- checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
103
- dependencies = [
104
- "rustversion",
105
- ]
106
-
107
92
  [[package]]
108
93
  name = "libc"
109
- version = "0.2.180"
94
+ version = "0.2.183"
110
95
  source = "registry+https://github.com/rust-lang/crates.io-index"
111
- checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
96
+ checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d"
112
97
 
113
98
  [[package]]
114
99
  name = "log"
@@ -122,15 +107,6 @@ version = "2.8.0"
122
107
  source = "registry+https://github.com/rust-lang/crates.io-index"
123
108
  checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
124
109
 
125
- [[package]]
126
- name = "memoffset"
127
- version = "0.9.1"
128
- source = "registry+https://github.com/rust-lang/crates.io-index"
129
- checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
130
- dependencies = [
131
- "autocfg",
132
- ]
133
-
134
110
  [[package]]
135
111
  name = "once_cell"
136
112
  version = "1.21.3"
@@ -154,36 +130,32 @@ dependencies = [
154
130
 
155
131
  [[package]]
156
132
  name = "pyo3"
157
- version = "0.25.1"
133
+ version = "0.28.2"
158
134
  source = "registry+https://github.com/rust-lang/crates.io-index"
159
- checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a"
135
+ checksum = "cf85e27e86080aafd5a22eae58a162e133a589551542b3e5cee4beb27e54f8e1"
160
136
  dependencies = [
161
- "indoc",
162
137
  "libc",
163
- "memoffset",
164
138
  "once_cell",
165
139
  "portable-atomic",
166
140
  "pyo3-build-config",
167
141
  "pyo3-ffi",
168
142
  "pyo3-macros",
169
- "unindent",
170
143
  ]
171
144
 
172
145
  [[package]]
173
146
  name = "pyo3-build-config"
174
- version = "0.25.1"
147
+ version = "0.28.2"
175
148
  source = "registry+https://github.com/rust-lang/crates.io-index"
176
- checksum = "458eb0c55e7ece017adeba38f2248ff3ac615e53660d7c71a238d7d2a01c7598"
149
+ checksum = "8bf94ee265674bf76c09fa430b0e99c26e319c945d96ca0d5a8215f31bf81cf7"
177
150
  dependencies = [
178
- "once_cell",
179
151
  "target-lexicon",
180
152
  ]
181
153
 
182
154
  [[package]]
183
155
  name = "pyo3-ffi"
184
- version = "0.25.1"
156
+ version = "0.28.2"
185
157
  source = "registry+https://github.com/rust-lang/crates.io-index"
186
- checksum = "7114fe5457c61b276ab77c5055f206295b812608083644a5c5b2640c3102565c"
158
+ checksum = "491aa5fc66d8059dd44a75f4580a2962c1862a1c2945359db36f6c2818b748dc"
187
159
  dependencies = [
188
160
  "libc",
189
161
  "pyo3-build-config",
@@ -191,9 +163,9 @@ dependencies = [
191
163
 
192
164
  [[package]]
193
165
  name = "pyo3-macros"
194
- version = "0.25.1"
166
+ version = "0.28.2"
195
167
  source = "registry+https://github.com/rust-lang/crates.io-index"
196
- checksum = "a8725c0a622b374d6cb051d11a0983786448f7785336139c3c94f5aa6bef7e50"
168
+ checksum = "f5d671734e9d7a43449f8480f8b38115df67bef8d21f76837fa75ee7aaa5e52e"
197
169
  dependencies = [
198
170
  "proc-macro2",
199
171
  "pyo3-macros-backend",
@@ -203,9 +175,9 @@ dependencies = [
203
175
 
204
176
  [[package]]
205
177
  name = "pyo3-macros-backend"
206
- version = "0.25.1"
178
+ version = "0.28.2"
207
179
  source = "registry+https://github.com/rust-lang/crates.io-index"
208
- checksum = "4109984c22491085343c05b0dbc54ddc405c3cf7b4374fc533f5c3313a572ccc"
180
+ checksum = "22faaa1ce6c430a1f71658760497291065e6450d7b5dc2bcf254d49f66ee700a"
209
181
  dependencies = [
210
182
  "heck",
211
183
  "proc-macro2",
@@ -216,9 +188,9 @@ dependencies = [
216
188
 
217
189
  [[package]]
218
190
  name = "quote"
219
- version = "1.0.44"
191
+ version = "1.0.45"
220
192
  source = "registry+https://github.com/rust-lang/crates.io-index"
221
- checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4"
193
+ checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
222
194
  dependencies = [
223
195
  "proc-macro2",
224
196
  ]
@@ -236,15 +208,9 @@ dependencies = [
236
208
 
237
209
  [[package]]
238
210
  name = "regex-syntax"
239
- version = "0.8.9"
240
- source = "registry+https://github.com/rust-lang/crates.io-index"
241
- checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c"
242
-
243
- [[package]]
244
- name = "rustversion"
245
- version = "1.0.22"
211
+ version = "0.8.10"
246
212
  source = "registry+https://github.com/rust-lang/crates.io-index"
247
- checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
213
+ checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
248
214
 
249
215
  [[package]]
250
216
  name = "same-file"
@@ -286,9 +252,9 @@ dependencies = [
286
252
 
287
253
  [[package]]
288
254
  name = "syn"
289
- version = "2.0.114"
255
+ version = "2.0.117"
290
256
  source = "registry+https://github.com/rust-lang/crates.io-index"
291
- checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
257
+ checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
292
258
  dependencies = [
293
259
  "proc-macro2",
294
260
  "quote",
@@ -297,21 +263,15 @@ dependencies = [
297
263
 
298
264
  [[package]]
299
265
  name = "target-lexicon"
300
- version = "0.13.4"
266
+ version = "0.13.5"
301
267
  source = "registry+https://github.com/rust-lang/crates.io-index"
302
- checksum = "b1dd07eb858a2067e2f3c7155d54e929265c264e6f37efe3ee7a8d1b5a1dd0ba"
268
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
303
269
 
304
270
  [[package]]
305
271
  name = "unicode-ident"
306
- version = "1.0.22"
307
- source = "registry+https://github.com/rust-lang/crates.io-index"
308
- checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
309
-
310
- [[package]]
311
- name = "unindent"
312
- version = "0.2.4"
272
+ version = "1.0.24"
313
273
  source = "registry+https://github.com/rust-lang/crates.io-index"
314
- checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
274
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
315
275
 
316
276
  [[package]]
317
277
  name = "walkdir"
@@ -1,7 +1,7 @@
1
1
  [package]
2
2
  name = "ignore-python"
3
- version = "0.3.2"
4
- edition = "2021"
3
+ version = "0.3.3"
4
+ edition = "2024"
5
5
  readme = "README.md"
6
6
 
7
7
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -10,5 +10,5 @@ name = "ignore"
10
10
  crate-type = ["cdylib"]
11
11
 
12
12
  [dependencies]
13
- pyo3 = "0.25.1"
13
+ pyo3 = "0.28.2"
14
14
  ignore-rust = { version = "0.4.25", package = "ignore" }
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Stefano Borsatto
3
+ Copyright (c) 2026 Stefano Borsatto
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ignore-python
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
7
7
  License-File: LICENSE.txt
8
- Summary: Rust ignore crate Python bindings
8
+ Summary: Python bindings for the Rust crate ignore
9
9
  Keywords: python,gitignore,search,rust,extension,module,filesystem,recursively-search,fd,ripgrep,ignore
10
10
  Requires-Python: >=3.8
11
11
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
@@ -45,7 +45,14 @@ for entry in WalkBuilder("./").hidden(False).build():
45
45
 
46
46
  Refer to the [API documentation](https://borsattoz.github.io/ignore-python) for more information.
47
47
 
48
- ## How to install (from pip)
48
+ ## How to install
49
+ ### On Arch Linux
50
+ You can install the [python-ignore package](https://archlinux.org/packages/extra/x86_64/python-ignore/) from the official repos:
51
+ ```sh
52
+ pacman -S python-ignore
53
+ ```
54
+ ### From pip
55
+ You can install the [ignore-python package](https://pypi.org/project/ignore-python/):
49
56
  ```sh
50
57
  pip install ignore-python
51
58
  # or
@@ -31,7 +31,14 @@ for entry in WalkBuilder("./").hidden(False).build():
31
31
 
32
32
  Refer to the [API documentation](https://borsattoz.github.io/ignore-python) for more information.
33
33
 
34
- ## How to install (from pip)
34
+ ## How to install
35
+ ### On Arch Linux
36
+ You can install the [python-ignore package](https://archlinux.org/packages/extra/x86_64/python-ignore/) from the official repos:
37
+ ```sh
38
+ pacman -S python-ignore
39
+ ```
40
+ ### From pip
41
+ You can install the [ignore-python package](https://pypi.org/project/ignore-python/):
35
42
  ```sh
36
43
  pip install ignore-python
37
44
  # or
@@ -3,11 +3,10 @@ from typing import Self
3
3
 
4
4
  from ignore.overrides import Override
5
5
 
6
-
7
6
  class Error(Exception):
8
- """
9
- Represents an error that can occur during operations.
10
- """
7
+ """
8
+ Represents an error that can occur during operations.
9
+ """
11
10
 
12
11
  class IOError(Exception):
13
12
  """
@@ -22,53 +21,30 @@ class IOError(Exception):
22
21
 
23
22
  def __init__(self, errno: int, strerror: str, filename: str) -> None: ...
24
23
 
25
-
26
24
  class DirEntry:
27
25
  def path(self) -> pathlib.Path: ...
28
-
29
26
  def depth(self) -> int: ...
30
27
 
31
-
32
28
  class Walk:
33
29
  def __init__(self, path: pathlib.Path) -> None: ...
34
-
35
30
  def __iter__(self) -> Self: ...
36
-
37
31
  def __next__(self) -> DirEntry: ...
38
32
 
39
-
40
33
  class WalkBuilder:
41
34
  def __init__(self, path: pathlib.Path) -> None: ...
42
-
43
35
  def hidden(self, yes: bool) -> Self: ...
44
-
45
36
  def ignore(self, yes: bool) -> Self: ...
46
-
47
37
  def parents(self, yes: bool) -> Self: ...
48
-
49
38
  def git_ignore(self, yes: bool) -> Self: ...
50
-
51
39
  def git_global(self, yes: bool) -> Self: ...
52
-
53
40
  def git_exclude(self, yes: bool) -> Self: ...
54
-
55
41
  def require_git(self, yes: bool) -> Self: ...
56
-
57
42
  def overrides(self, overrides: Override) -> Self: ...
58
-
59
43
  def follow_links(self, yes: bool) -> Self: ...
60
-
61
44
  def same_file_system(self, yes: bool) -> Self: ...
62
-
63
45
  def max_depth(self, depth: int | None) -> Self: ...
64
-
65
46
  def max_filesize(self, filesize: int | None) -> Self: ...
66
-
67
47
  def add_custom_ignore_filename(self, file_name: str) -> Self: ...
68
-
69
48
  def add(self, path: pathlib.Path) -> Self: ...
70
-
71
49
  def add_ignore(self, path: pathlib.Path) -> None: ...
72
-
73
50
  def build(self) -> Walk: ...
74
-
@@ -1,13 +1,9 @@
1
1
  import pathlib
2
2
  from typing import Self
3
3
 
4
-
5
4
  class Override: ...
6
5
 
7
-
8
6
  class OverrideBuilder:
9
7
  def __init__(self, path: pathlib.Path) -> None: ...
10
-
11
8
  def build(self) -> Override: ...
12
-
13
9
  def add(self, glob: str) -> Self: ...
@@ -0,0 +1,36 @@
1
+ [[repos]]
2
+ repo = "https://github.com/pre-commit/pre-commit-hooks"
3
+ rev = "v6.0.0"
4
+ hooks = [
5
+ { id = "end-of-file-fixer" },
6
+ { id = "trailing-whitespace" },
7
+ { id = "name-tests-test" },
8
+ { id = "check-toml" },
9
+ ]
10
+
11
+ [[repos]]
12
+ repo = "https://github.com/abravalheri/validate-pyproject"
13
+ rev = "v0.25"
14
+ hooks = [{ id = "validate-pyproject" }]
15
+
16
+ [[repos]]
17
+ repo = "https://github.com/crate-ci/typos"
18
+ rev = "v1.44.0"
19
+ hooks = [{ id = "typos" }]
20
+
21
+ [[repos]]
22
+ repo = "https://github.com/psf/black"
23
+ rev = "26.3.0"
24
+ hooks = [{ id = "black" }]
25
+
26
+ [[repos]]
27
+ repo = "local"
28
+ hooks = [
29
+ {
30
+ id = "rustfmt",
31
+ name = "rustfmt",
32
+ entry = "rustfmt",
33
+ language = "system",
34
+ files = "\\.rs$",
35
+ }
36
+ ]
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "ignore-python"
7
- description = "Rust ignore crate Python bindings"
7
+ description = "Python bindings for the Rust crate ignore"
8
8
  readme = "README.md"
9
9
  license = {file = "LICENSE.txt"}
10
10
  requires-python = ">=3.8"
@@ -26,8 +26,10 @@ fn register_child_module<'a>(
26
26
 
27
27
  struct PathBuf(std::path::PathBuf);
28
28
 
29
- impl FromPyObject<'_> for PathBuf {
30
- fn extract_bound(path: &Bound<'_, PyAny>) -> PyResult<Self> {
29
+ impl<'py> FromPyObject<'_, 'py> for PathBuf {
30
+ type Error = PyErr;
31
+
32
+ fn extract(path: Borrowed<'_, 'py, PyAny>) -> PyResult<Self> {
31
33
  let builtins = PyModule::import(path.py(), "builtins")?;
32
34
 
33
35
  let path = builtins.getattr("str")?.call((path,), None)?;
@@ -126,7 +128,7 @@ mod ignore {
126
128
  match &error.0 {
127
129
  ignore_rust::Error::WithPath { path, err } => match err.as_ref() {
128
130
  ignore_rust::Error::Io(io_error) => match io_error.kind() {
129
- io::ErrorKind::NotFound => Python::with_gil(|py| {
131
+ io::ErrorKind::NotFound => Python::attach(|py| {
130
132
  let errno = py
131
133
  .import("errno")
132
134
  .expect("`errno` module")
@@ -250,11 +252,11 @@ mod ignore {
250
252
  slf
251
253
  }
252
254
 
253
- fn overrides(
254
- mut slf: PyRefMut<'_, Self>,
255
- overrides: overrides::Override,
256
- ) -> PyRefMut<'_, Self> {
257
- slf.0.overrides(overrides.0);
255
+ fn overrides<'a>(
256
+ mut slf: PyRefMut<'a, Self>,
257
+ overrides: &'a overrides::Override,
258
+ ) -> PyRefMut<'a, Self> {
259
+ slf.0.overrides(overrides.0.clone());
258
260
 
259
261
  slf
260
262
  }
@@ -346,7 +348,6 @@ mod ignore {
346
348
  ///
347
349
  /// See https://docs.rs/ignore/0.4.25/ignore/overrides/struct.Override.html for more information.
348
350
  #[pyclass]
349
- #[derive(Clone)]
350
351
  pub struct Override(pub ignore_rust::overrides::Override);
351
352
 
352
353
  /// Builds a matcher for a set of glob overrides.
@@ -6,66 +6,67 @@ from sys import platform
6
6
 
7
7
  PATH = Path("./")
8
8
 
9
+
9
10
  def test_build():
10
11
  walk = WalkBuilder(PATH).build()
11
12
  assert type(walk) == Walk
12
13
  assert len(list(walk)) >= 2
13
14
 
15
+
14
16
  def test_flags():
15
- builder = (WalkBuilder(PATH)
16
- .hidden(True)
17
- .ignore(True)
18
- .parents(True)
19
- .git_ignore(True)
20
- .git_global(True)
21
- .git_exclude(True)
22
- .require_git(True)
23
- .follow_links(True)
24
- .same_file_system(True)
25
- )
17
+ builder = (
18
+ WalkBuilder(PATH)
19
+ .hidden(True)
20
+ .ignore(True)
21
+ .parents(True)
22
+ .git_ignore(True)
23
+ .git_global(True)
24
+ .git_exclude(True)
25
+ .require_git(True)
26
+ .follow_links(True)
27
+ .same_file_system(True)
28
+ )
26
29
 
27
30
  assert type(builder) == WalkBuilder
28
31
 
32
+
29
33
  def test_max_depth():
30
- builder = (WalkBuilder(PATH)
31
- .max_depth(None)
32
- .max_depth(0)
33
- .max_depth(42)
34
- )
34
+ builder = WalkBuilder(PATH).max_depth(None).max_depth(0).max_depth(42)
35
35
 
36
36
  assert type(builder) == WalkBuilder
37
37
 
38
38
  with pytest.raises(OverflowError):
39
39
  WalkBuilder(PATH).max_depth(-1)
40
40
 
41
+
41
42
  def test_max_filesize():
42
- builder = (WalkBuilder(PATH)
43
- .max_filesize(42)
44
- )
43
+ builder = WalkBuilder(PATH).max_filesize(42)
45
44
 
46
45
  assert type(builder) == WalkBuilder
47
46
 
48
47
  with pytest.raises(OverflowError):
49
48
  WalkBuilder(PATH).max_filesize(-1)
50
49
 
50
+
51
51
  def test_add_custom_ignore_filename():
52
52
  builder = WalkBuilder(PATH).add_custom_ignore_filename("foo")
53
53
 
54
54
  assert type(builder) == WalkBuilder
55
55
 
56
+
56
57
  def test_add():
57
58
  builder = WalkBuilder(PATH).add(Path("../bar"))
58
59
 
59
60
  assert type(builder) == WalkBuilder
60
61
 
62
+
61
63
  def test_add_ignore():
62
64
  builder = WalkBuilder(PATH)
63
65
 
64
- if platform == 'win32':
66
+ if platform == "win32":
65
67
  pstr = "C:\\Windows"
66
68
  else:
67
69
  pstr = "/"
68
70
 
69
71
  with pytest.raises(ignore.Error):
70
72
  builder.add_ignore(Path(pstr))
71
-
File without changes