ignore-python 0.1.0__cp38-none-win_amd64.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 = 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,55 @@
1
+ Metadata-Version: 2.3
2
+ Name: ignore-python
3
+ Version: 0.1.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
+ Requires-Python: >=3.8
9
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
10
+
11
+ # ignore in Python
12
+ This is a Python library that binds to the Rust crate
13
+ [ignore](https://github.com/BurntSushi/ripgrep/tree/master/crates/ignore).
14
+
15
+ ignore's Python bindings can be used for building a fast recursive
16
+ directory iterator that respects various filters such as globs, file
17
+ types and `.gitignore` files.
18
+
19
+ ## Example
20
+ This example shows the most basic usage of this package. This code
21
+ will recursively traverse the current directory while automatically
22
+ filtering out files and directories according to ignore globs found in
23
+ files like `.ignore` and `.gitignore`:
24
+
25
+ ```python
26
+ from ignore import Walk
27
+
28
+ for entry in Walk("./"):
29
+ print(entry.path())
30
+ ```
31
+
32
+ ## Example: advanced
33
+ By default, the recursive directory iterator will ignore hidden files and directories. This can be disabled by building the iterator with `WalkBuilder`:
34
+
35
+ ```python
36
+ from ignore import WalkBuilder
37
+
38
+ for entry in WalkBuilder("./").hidden(False).build():
39
+ print(entry.path())
40
+ ```
41
+
42
+ Refer to the [API documentation](https://borsattoz.github.io/ignore-python) for more information.
43
+
44
+ ## How to install (from pip)
45
+ ```sh
46
+ pip install ignore-python
47
+ # or
48
+ python -m pip install ignore-python
49
+ ```
50
+
51
+ ## How to develop
52
+ This assumes that you have rust and cargo installed. I use the
53
+ workflow recommended by [pyo3](https://github.com/PyO3/pyo3) and
54
+ [maturin](https://github.com/PyO3/maturin).
55
+
@@ -0,0 +1,10 @@
1
+ ignore_python-0.1.0.dist-info/METADATA,sha256=nny4byFi0cUNnyqBomQVmLuuxrJ9VtG2DVEca7LMuPA,1754
2
+ ignore_python-0.1.0.dist-info/WHEEL,sha256=-guPU4lo10KD1AzVI_4ZU9dzpXKpVXntHq12iPmG5yE,94
3
+ ignore_python-0.1.0.dist-info/license_files/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=1GQlU3jDQX6wzI5TqVqcf0e6WM4A6_dOSQPclHwzemY,2559
9
+ ignore/ignore.cp38-win_amd64.pyd,sha256=BpEX8SasramhP57AZD3MJ6A64KmFjsHNW7CqcuAWv6w,1840640
10
+ ignore_python-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.7.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp38-none-win_amd64
@@ -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.