ignore-python 0.2.0__cp310-cp310-win32.whl

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.
ignore/__init__.py ADDED
@@ -0,0 +1 @@
1
+ from .ignore import *
ignore/__init__.pyi ADDED
@@ -0,0 +1,100 @@
1
+ import pathlib
2
+ from typing import Self
3
+
4
+ from ignore.overrides import Override
5
+
6
+
7
+ class Error(Exception):
8
+ """Represents an error that can occur during operations."""
9
+
10
+
11
+ class IOError(Exception):
12
+ """
13
+ An error that occurs when doing I/O.
14
+
15
+ Currently, the only case where this error is used is for operating
16
+ system errors of type ENOENT.
17
+ """
18
+
19
+ errno: int
20
+ """A numeric error code from the C variable errno."""
21
+
22
+ filename: str
23
+ """The file system path involved."""
24
+
25
+
26
+ class DirEntry:
27
+ """
28
+ A directory entry.
29
+
30
+ See https://docs.rs/ignore/latest/ignore/struct.DirEntry.html for
31
+ more information.
32
+ """
33
+
34
+ def path(self) -> pathlib.Path: ...
35
+
36
+ def depth(self) -> int: ...
37
+
38
+
39
+ class WalkBuilder:
40
+ """
41
+ WalkBuilder builds a recursive directory iterator.
42
+
43
+ See https://docs.rs/ignore/latest/ignore/struct.WalkBuilder.html
44
+ for more information.
45
+ """
46
+
47
+ def __init__(self, path: pathlib.Path) -> None:
48
+ """Create a new builder for a recursive directory iterator for the directory given."""
49
+
50
+ def hidden(self, yes: bool) -> Self: ...
51
+
52
+ def ignore(self, yes: bool) -> Self: ...
53
+
54
+ def parents(self, yes: bool) -> Self: ...
55
+
56
+ def git_ignore(self, yes: bool) -> Self: ...
57
+
58
+ def git_global(self, yes: bool) -> Self: ...
59
+
60
+ def git_exclude(self, yes: bool) -> Self: ...
61
+
62
+ def require_git(self, yes: bool) -> Self: ...
63
+
64
+ def overrides(self, overrides: Override) -> Self: ...
65
+
66
+ def follow_links(self, yes: bool) -> Self: ...
67
+
68
+ def same_file_system(self, yes: bool) -> Self: ...
69
+
70
+ def max_depth(self, depth: int | None) -> Self: ...
71
+
72
+ def add_custom_ignore_filename(self, file_name: str) -> Self: ...
73
+
74
+ def add(self, path: pathlib.Path) -> Self: ...
75
+
76
+ def add_ignore(self, path: pathlib.Path) -> None: ...
77
+
78
+ def build(self) -> Walk: ...
79
+
80
+
81
+ class Walk:
82
+ """
83
+ Walk is a recursive directory iterator over file paths in one or more directories.
84
+
85
+ See https://docs.rs/ignore/latest/ignore/struct.Walk.html for more
86
+ information.
87
+ """
88
+
89
+ def __init__(self, path: pathlib.Path) -> None:
90
+ """Creates a new recursive directory iterator for the file path given."""
91
+
92
+ def __iter__(self) -> Self: ...
93
+
94
+ def __next__(self) -> DirEntry:
95
+ """
96
+ Advances the iterator and returns the next value.
97
+
98
+ :raises IOError: Currently, only when a ENOENT error happens
99
+ (e.g. broken symlinks when following them)
100
+ """
Binary file
@@ -0,0 +1,25 @@
1
+ import pathlib
2
+ from typing import Self
3
+
4
+
5
+ class Override:
6
+ """
7
+ Manages a set of overrides provided explicitly by the end user.
8
+
9
+ See https://docs.rs/ignore/latest/ignore/overrides/struct.Override.html for more information.
10
+ """
11
+
12
+
13
+ class OverrideBuilder:
14
+ """
15
+ Builds a matcher for a set of glob overrides.
16
+
17
+ See https://docs.rs/ignore/latest/ignore/overrides/struct.OverrideBuilder.html for more information.
18
+ """
19
+
20
+ def __init__(self, path: pathlib.Path) -> None:
21
+ """Create a new override builder."""
22
+
23
+ def build(self) -> Override: ...
24
+
25
+ def add(self, glob: str) -> Self: ...
File without changes
ignore/py.typed ADDED
File without changes
@@ -0,0 +1,59 @@
1
+ Metadata-Version: 2.4
2
+ Name: ignore-python
3
+ Version: 0.2.0
4
+ Classifier: Programming Language :: Rust
5
+ Classifier: Programming Language :: Python :: Implementation :: CPython
6
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
7
+ License-File: LICENSE.txt
8
+ Summary: Rust ignore crate Python bindings
9
+ Keywords: python,gitignore,search,rust,extension,module,filesystem,recursively-search,fd,ripgrep,ignore
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
12
+ Project-URL: documentation, https://borsattoz.github.io/ignore-python
13
+ Project-URL: repository, https://github.com/borsattoz/ignore-python
14
+
15
+ # ignore in Python
16
+ This is a Python library that binds to the Rust crate
17
+ [ignore](https://github.com/BurntSushi/ripgrep/tree/master/crates/ignore).
18
+
19
+ ignore's Python bindings can be used for building a fast recursive
20
+ directory iterator that respects various filters such as globs, file
21
+ types and `.gitignore` files.
22
+
23
+ ## Example
24
+ This example shows the most basic usage of this package. This code
25
+ will recursively traverse the current directory while automatically
26
+ filtering out files and directories according to ignore globs found in
27
+ files like `.ignore` and `.gitignore`:
28
+
29
+ ```python
30
+ from ignore import Walk
31
+
32
+ for entry in Walk("./"):
33
+ print(entry.path())
34
+ ```
35
+
36
+ ## Example: advanced
37
+ By default, the recursive directory iterator will ignore hidden files and directories. This can be disabled by building the iterator with `WalkBuilder`:
38
+
39
+ ```python
40
+ from ignore import WalkBuilder
41
+
42
+ for entry in WalkBuilder("./").hidden(False).build():
43
+ print(entry.path())
44
+ ```
45
+
46
+ Refer to the [API documentation](https://borsattoz.github.io/ignore-python) for more information.
47
+
48
+ ## How to install (from pip)
49
+ ```sh
50
+ pip install ignore-python
51
+ # or
52
+ python -m pip install ignore-python
53
+ ```
54
+
55
+ ## How to develop
56
+ This assumes that you have rust and cargo installed. I use the
57
+ workflow recommended by [pyo3](https://github.com/PyO3/pyo3) and
58
+ [maturin](https://github.com/PyO3/maturin).
59
+
@@ -0,0 +1,10 @@
1
+ ignore_python-0.2.0.dist-info/METADATA,sha256=YKLWNq8XtvDNe7NcvBZ4bOiUDhAMnJCCMp2KK9g6kuo,2039
2
+ ignore_python-0.2.0.dist-info/WHEEL,sha256=WWWNS_YivL6eU-qhhdTFNNU59V1SfDxFkjCIXFZL9K8,92
3
+ ignore_python-0.2.0.dist-info/licenses/LICENSE.txt,sha256=jiHYUToyQDxHxfl1uJu46PFHYiv3jm1OPT--5qKSysY,1094
4
+ ignore/overrides/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ ignore/overrides/__init__.pyi,sha256=YCXFwT83pO-3qzSOzjH7vXZlhxV5bCLKxbPuNtWR-HY,641
6
+ ignore/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ ignore/__init__.py,sha256=M5KX00vnQSTlKos8XxRuiwKu0A5rzv2qRPMdcrjx4uY,23
8
+ ignore/__init__.pyi,sha256=zVv5S75TBB-u7vwdPKdz88I83Z_cz5mGRMAxfN_AmNc,2552
9
+ ignore/ignore.cp310-win32.pyd,sha256=KYvU4Scq1VLIjS9kfMys7b7lGUQ-BQEWMXGH_BVEB84,1452032
10
+ ignore_python-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.8.3)
3
+ Root-Is-Purelib: false
4
+ Tag: cp310-cp310-win32
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Stefano Borsatto
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.