]> crepu.dev Git - config.git/blame - djavu-asus/elpy/rpc-venv/lib/python3.11/site-packages/pathspec-0.11.2.dist-info/METADATA
Configuracion en desarrollo PC pega
[config.git] / djavu-asus / elpy / rpc-venv / lib / python3.11 / site-packages / pathspec-0.11.2.dist-info / METADATA
CommitLineData
53e6db90
DC
1Metadata-Version: 2.1
2Name: pathspec
3Version: 0.11.2
4Summary: Utility library for gitignore style pattern matching of file paths.
5Author-email: "Caleb P. Burns" <cpburnz@gmail.com>
6Requires-Python: >=3.7
7Description-Content-Type: text/x-rst
8Classifier: Development Status :: 4 - Beta
9Classifier: Intended Audience :: Developers
10Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
11Classifier: Operating System :: OS Independent
12Classifier: Programming Language :: Python
13Classifier: Programming Language :: Python :: 3
14Classifier: Programming Language :: Python :: 3.7
15Classifier: Programming Language :: Python :: 3.8
16Classifier: Programming Language :: Python :: 3.9
17Classifier: Programming Language :: Python :: 3.10
18Classifier: Programming Language :: Python :: 3.11
19Classifier: Programming Language :: Python :: Implementation :: CPython
20Classifier: Programming Language :: Python :: Implementation :: PyPy
21Classifier: Topic :: Software Development :: Libraries :: Python Modules
22Classifier: Topic :: Utilities
23Project-URL: Documentation, https://python-path-specification.readthedocs.io/en/latest/index.html
24Project-URL: Issue Tracker, https://github.com/cpburnz/python-pathspec/issues
25Project-URL: Source Code, https://github.com/cpburnz/python-pathspec
26
27
28PathSpec
29========
30
31*pathspec* is a utility library for pattern matching of file paths. So
32far this only includes Git's wildmatch pattern matching which itself is
33derived from Rsync's wildmatch. Git uses wildmatch for its `gitignore`_
34files.
35
36.. _`gitignore`: http://git-scm.com/docs/gitignore
37
38
39Tutorial
40--------
41
42Say you have a "Projects" directory and you want to back it up, but only
43certain files, and ignore others depending on certain conditions::
44
45 >>> import pathspec
46 >>> # The gitignore-style patterns for files to select, but we're including
47 >>> # instead of ignoring.
48 >>> spec_text = """
49 ...
50 ... # This is a comment because the line begins with a hash: "#"
51 ...
52 ... # Include several project directories (and all descendants) relative to
53 ... # the current directory. To reference a directory you must end with a
54 ... # slash: "/"
55 ... /project-a/
56 ... /project-b/
57 ... /project-c/
58 ...
59 ... # Patterns can be negated by prefixing with exclamation mark: "!"
60 ...
61 ... # Ignore temporary files beginning or ending with "~" and ending with
62 ... # ".swp".
63 ... !~*
64 ... !*~
65 ... !*.swp
66 ...
67 ... # These are python projects so ignore compiled python files from
68 ... # testing.
69 ... !*.pyc
70 ...
71 ... # Ignore the build directories but only directly under the project
72 ... # directories.
73 ... !/*/build/
74 ...
75 ... """
76
77We want to use the ``GitWildMatchPattern`` class to compile our patterns. The
78``PathSpec`` class provides an interface around pattern implementations::
79
80 >>> spec = pathspec.PathSpec.from_lines(pathspec.patterns.GitWildMatchPattern, spec_text.splitlines())
81
82That may be a mouthful but it allows for additional patterns to be implemented
83in the future without them having to deal with anything but matching the paths
84sent to them. ``GitWildMatchPattern`` is the implementation of the actual
85pattern which internally gets converted into a regular expression. ``PathSpec``
86is a simple wrapper around a list of compiled patterns.
87
88To make things simpler, we can use the registered name for a pattern class
89instead of always having to provide a reference to the class itself. The
90``GitWildMatchPattern`` class is registered as **gitwildmatch**::
91
92 >>> spec = pathspec.PathSpec.from_lines('gitwildmatch', spec_text.splitlines())
93
94If we wanted to manually compile the patterns we can just do the following::
95
96 >>> patterns = map(pathspec.patterns.GitWildMatchPattern, spec_text.splitlines())
97 >>> spec = PathSpec(patterns)
98
99``PathSpec.from_lines()`` is simply a class method which does just that.
100
101If you want to load the patterns from file, you can pass the file instance
102directly as well::
103
104 >>> with open('patterns.list', 'r') as fh:
105 >>> spec = pathspec.PathSpec.from_lines('gitwildmatch', fh)
106
107You can perform matching on a whole directory tree with::
108
109 >>> matches = spec.match_tree('path/to/directory')
110
111Or you can perform matching on a specific set of file paths with::
112
113 >>> matches = spec.match_files(file_paths)
114
115Or check to see if an individual file matches::
116
117 >>> is_matched = spec.match_file(file_path)
118
119There is a specialized class, ``pathspec.GitIgnoreSpec``, which more closely
120implements the behavior of **gitignore**. This uses ``GitWildMatchPattern``
121pattern by default and handles some edge cases differently from the generic
122``PathSpec`` class. ``GitIgnoreSpec`` can be used without specifying the pattern
123factory::
124
125 >>> spec = pathspec.GitIgnoreSpec.from_lines(spec_text.splitlines())
126
127
128License
129-------
130
131*pathspec* is licensed under the `Mozilla Public License Version 2.0`_. See
132`LICENSE`_ or the `FAQ`_ for more information.
133
134In summary, you may use *pathspec* with any closed or open source project
135without affecting the license of the larger work so long as you:
136
137- give credit where credit is due,
138
139- and release any custom changes made to *pathspec*.
140
141.. _`Mozilla Public License Version 2.0`: http://www.mozilla.org/MPL/2.0
142.. _`LICENSE`: LICENSE
143.. _`FAQ`: http://www.mozilla.org/MPL/2.0/FAQ.html
144
145
146Source
147------
148
149The source code for *pathspec* is available from the GitHub repo
150`cpburnz/python-pathspec`_.
151
152.. _`cpburnz/python-pathspec`: https://github.com/cpburnz/python-pathspec
153
154
155Installation
156------------
157
158*pathspec* is available for install through `PyPI`_::
159
160 pip install pathspec
161
162*pathspec* can also be built from source. The following packages will be
163required:
164
165- `build`_ (>=0.6.0)
166
167*pathspec* can then be built and installed with::
168
169 python -m build
170 pip install dist/pathspec-*-py3-none-any.whl
171
172.. _`PyPI`: http://pypi.python.org/pypi/pathspec
173.. _`build`: https://pypi.org/project/build/
174
175
176Documentation
177-------------
178
179Documentation for *pathspec* is available on `Read the Docs`_.
180
181.. _`Read the Docs`: https://python-path-specification.readthedocs.io
182
183
184Other Languages
185---------------
186
187The related project `pathspec-ruby`_ (by *highb*) provides a similar library as
188a `Ruby gem`_.
189
190.. _`pathspec-ruby`: https://github.com/highb/pathspec-ruby
191.. _`Ruby gem`: https://rubygems.org/gems/pathspec
192
193
194
195Change History
196==============
197
198
1990.11.2 (2023-07-28)
200-------------------
201
202New features:
203
204- `Issue #80`_: match_files with negated path spec. `pathspec.PathSpec.match_*()` now have a `negate` parameter to make using *.gitignore* logic easier and more efficient.
205
206Bug fixes:
207
208- `Pull #76`_: Add edge case: patterns that end with an escaped space
209- `Issue #77`_/`Pull #78`_: Negate with caret symbol as with the exclamation mark.
210
211
212.. _`Pull #76`: https://github.com/cpburnz/python-pathspec/pull/76
213.. _`Issue #77`: https://github.com/cpburnz/python-pathspec/issues/77
214.. _`Pull #78`: https://github.com/cpburnz/python-pathspec/pull/78/
215.. _`Issue #80`: https://github.com/cpburnz/python-pathspec/issues/80
216
217
2180.11.1 (2023-03-14)
219-------------------
220
221Bug fixes:
222
223- `Issue #74`_: Include directory should override exclude file.
224
225Improvements:
226
227- `Pull #75`_: Fix partially unknown PathLike type.
228- Convert `os.PathLike` to a string properly using `os.fspath`.
229
230
231.. _`Issue #74`: https://github.com/cpburnz/python-pathspec/issues/74
232.. _`Pull #75`: https://github.com/cpburnz/python-pathspec/pull/75
233
234
2350.11.0 (2023-01-24)
236-------------------
237
238Major changes:
239
240- Changed build backend to `flit_core.buildapi`_ from `setuptools.build_meta`_. Building with `setuptools` through `setup.py` is still supported for distributions that need it. See `Issue #72`_.
241
242Improvements:
243
244- `Issue #72`_/`Pull #73`_: Please consider switching the build-system to flit_core to ease setuptools bootstrap.
245
246
247.. _`flit_core.buildapi`: https://flit.pypa.io/en/latest/index.html
248.. _`Issue #72`: https://github.com/cpburnz/python-pathspec/issues/72
249.. _`Pull #73`: https://github.com/cpburnz/python-pathspec/pull/73
250
251
2520.10.3 (2022-12-09)
253-------------------
254
255New features:
256
257- Added utility function `pathspec.util.append_dir_sep()` to aid in distinguishing between directories and files on the file-system. See `Issue #65`_.
258
259Bug fixes:
260
261- `Issue #66`_/`Pull #67`_: Package not marked as py.typed.
262- `Issue #68`_: Exports are considered private.
263- `Issue #70`_/`Pull #71`_: 'Self' string literal type is Unknown in pyright.
264
265Improvements:
266
267- `Issue #65`_: Checking directories via match_file() does not work on Path objects.
268
269
270.. _`Issue #65`: https://github.com/cpburnz/python-pathspec/issues/65
271.. _`Issue #66`: https://github.com/cpburnz/python-pathspec/issues/66
272.. _`Pull #67`: https://github.com/cpburnz/python-pathspec/pull/67
273.. _`Issue #68`: https://github.com/cpburnz/python-pathspec/issues/68
274.. _`Issue #70`: https://github.com/cpburnz/python-pathspec/issues/70
275.. _`Pull #71`: https://github.com/cpburnz/python-pathspec/pull/71
276
277
2780.10.2 (2022-11-12)
279-------------------
280
281Bug fixes:
282
283- Fix failing tests on Windows.
284- Type hint on *root* parameter on `pathspec.pathspec.PathSpec.match_tree_entries()`.
285- Type hint on *root* parameter on `pathspec.pathspec.PathSpec.match_tree_files()`.
286- Type hint on *root* parameter on `pathspec.util.iter_tree_entries()`.
287- Type hint on *root* parameter on `pathspec.util.iter_tree_files()`.
288- `Issue #64`_: IndexError with my .gitignore file when trying to build a Python package.
289
290Improvements:
291
292- `Pull #58`_: CI: add GitHub Actions test workflow.
293
294
295.. _`Pull #58`: https://github.com/cpburnz/python-pathspec/pull/58
296.. _`Issue #64`: https://github.com/cpburnz/python-pathspec/issues/64
297
298
2990.10.1 (2022-09-02)
300-------------------
301
302Bug fixes:
303
304- Fix documentation on `pathspec.pattern.RegexPattern.match_file()`.
305- `Pull #60`_: Remove redundant wheel dep from pyproject.toml.
306- `Issue #61`_: Dist failure for Fedora, CentOS, EPEL.
307- `Issue #62`_: Since version 0.10.0 pure wildcard does not work in some cases.
308
309Improvements:
310
311- Restore support for legacy installations using `setup.py`. See `Issue #61`_.
312
313
314.. _`Pull #60`: https://github.com/cpburnz/python-pathspec/pull/60
315.. _`Issue #61`: https://github.com/cpburnz/python-pathspec/issues/61
316.. _`Issue #62`: https://github.com/cpburnz/python-pathspec/issues/62
317
318
3190.10.0 (2022-08-30)
320-------------------
321
322Major changes:
323
324- Dropped support of EOL Python 2.7, 3.5, 3.6. See `Issue #47`_.
325- The *gitwildmatch* pattern `dir/*` is now handled the same as `dir/`. This means `dir/*` will now match all descendants rather than only direct children. See `Issue #19`_.
326- Added `pathspec.GitIgnoreSpec` class (see new features).
327- Changed build system to `pyproject.toml`_ and build backend to `setuptools.build_meta`_ which may have unforeseen consequences.
328- Renamed GitHub project from `python-path-specification`_ to `python-pathspec`_. See `Issue #35`_.
329
330API changes:
331
332- Deprecated: `pathspec.util.match_files()` is an old function no longer used.
333- Deprecated: `pathspec.match_files()` is an old function no longer used.
334- Deprecated: `pathspec.util.normalize_files()` is no longer used.
335- Deprecated: `pathspec.util.iter_tree()` is an alias for `pathspec.util.iter_tree_files()`.
336- Deprecated: `pathspec.iter_tree()` is an alias for `pathspec.util.iter_tree_files()`.
337- Deprecated: `pathspec.pattern.Pattern.match()` is no longer used. Use or implement
338 `pathspec.pattern.Pattern.match_file()`.
339
340New features:
341
342- Added class `pathspec.gitignore.GitIgnoreSpec` (with alias `pathspec.GitIgnoreSpec`) to implement *gitignore* behavior not possible with standard `PathSpec` class. The particular *gitignore* behavior implemented is prioritizing patterns matching the file directly over matching an ancestor directory.
343
344Bug fixes:
345
346- `Issue #19`_: Files inside an ignored sub-directory are not matched.
347- `Issue #41`_: Incorrectly (?) matches files inside directories that do match.
348- `Pull #51`_: Refactor deprecated unittest aliases for Python 3.11 compatibility.
349- `Issue #53`_: Symlink pathspec_meta.py breaks Windows.
350- `Issue #54`_: test_util.py uses os.symlink which can fail on Windows.
351- `Issue #55`_: Backslashes at start of pattern not handled correctly.
352- `Pull #56`_: pyproject.toml: include subpackages in setuptools config
353- `Issue #57`_: `!` doesn't exclude files in directories if the pattern doesn't have a trailing slash.
354
355Improvements:
356
357- Support Python 3.10, 3.11.
358- Modernize code to Python 3.7.
359- `Issue #52`_: match_files() is not a pure generator function, and it impacts tree_*() gravely.
360
361
362.. _`python-path-specification`: https://github.com/cpburnz/python-path-specification
363.. _`python-pathspec`: https://github.com/cpburnz/python-pathspec
364.. _`pyproject.toml`: https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/
365.. _`setuptools.build_meta`: https://setuptools.pypa.io/en/latest/build_meta.html
366.. _`Issue #19`: https://github.com/cpburnz/python-pathspec/issues/19
367.. _`Issue #35`: https://github.com/cpburnz/python-pathspec/issues/35
368.. _`Issue #41`: https://github.com/cpburnz/python-pathspec/issues/41
369.. _`Issue #47`: https://github.com/cpburnz/python-pathspec/issues/47
370.. _`Pull #51`: https://github.com/cpburnz/python-pathspec/pull/51
371.. _`Issue #52`: https://github.com/cpburnz/python-pathspec/issues/52
372.. _`Issue #53`: https://github.com/cpburnz/python-pathspec/issues/53
373.. _`Issue #54`: https://github.com/cpburnz/python-pathspec/issues/54
374.. _`Issue #55`: https://github.com/cpburnz/python-pathspec/issues/55
375.. _`Pull #56`: https://github.com/cpburnz/python-pathspec/pull/56
376.. _`Issue #57`: https://github.com/cpburnz/python-pathspec/issues/57
377
378
3790.9.0 (2021-07-17)
380------------------
381
382- `Issue #44`_/`Pull #50`_: Raise `GitWildMatchPatternError` for invalid git patterns.
383- `Pull #45`_: Fix for duplicate leading double-asterisk, and edge cases.
384- `Issue #46`_: Fix matching absolute paths.
385- API change: `util.normalize_files()` now returns a `Dict[str, List[pathlike]]` instead of a `Dict[str, pathlike]`.
386- Added type hinting.
387
388.. _`Issue #44`: https://github.com/cpburnz/python-pathspec/issues/44
389.. _`Pull #45`: https://github.com/cpburnz/python-pathspec/pull/45
390.. _`Issue #46`: https://github.com/cpburnz/python-pathspec/issues/46
391.. _`Pull #50`: https://github.com/cpburnz/python-pathspec/pull/50
392
393
3940.8.1 (2020-11-07)
395------------------
396
397- `Pull #43`_: Add support for addition operator.
398
399.. _`Pull #43`: https://github.com/cpburnz/python-pathspec/pull/43
400
401
4020.8.0 (2020-04-09)
403------------------
404
405- `Issue #30`_: Expose what patterns matched paths. Added `util.detailed_match_files()`.
406- `Issue #31`_: `match_tree()` doesn't return symlinks.
407- `Issue #34`_: Support `pathlib.Path`\ s.
408- Add `PathSpec.match_tree_entries` and `util.iter_tree_entries()` to support directories and symlinks.
409- API change: `match_tree()` has been renamed to `match_tree_files()`. The old name `match_tree()` is still available as an alias.
410- API change: `match_tree_files()` now returns symlinks. This is a bug fix but it will change the returned results.
411
412.. _`Issue #30`: https://github.com/cpburnz/python-pathspec/issues/30
413.. _`Issue #31`: https://github.com/cpburnz/python-pathspec/issues/31
414.. _`Issue #34`: https://github.com/cpburnz/python-pathspec/issues/34
415
416
4170.7.0 (2019-12-27)
418------------------
419
420- `Pull #28`_: Add support for Python 3.8, and drop Python 3.4.
421- `Pull #29`_: Publish bdist wheel.
422
423.. _`Pull #28`: https://github.com/cpburnz/python-pathspec/pull/28
424.. _`Pull #29`: https://github.com/cpburnz/python-pathspec/pull/29
425
426
4270.6.0 (2019-10-03)
428------------------
429
430- `Pull #24`_: Drop support for Python 2.6, 3.2, and 3.3.
431- `Pull #25`_: Update README.rst.
432- `Pull #26`_: Method to escape gitwildmatch.
433
434.. _`Pull #24`: https://github.com/cpburnz/python-pathspec/pull/24
435.. _`Pull #25`: https://github.com/cpburnz/python-pathspec/pull/25
436.. _`Pull #26`: https://github.com/cpburnz/python-pathspec/pull/26
437
438
4390.5.9 (2018-09-15)
440------------------
441
442- Fixed file system error handling.
443
444
4450.5.8 (2018-09-15)
446------------------
447
448- Improved type checking.
449- Created scripts to test Python 2.6 because Tox removed support for it.
450- Improved byte string handling in Python 3.
451- `Issue #22`_: Handle dangling symlinks.
452
453.. _`Issue #22`: https://github.com/cpburnz/python-pathspec/issues/22
454
455
4560.5.7 (2018-08-14)
457------------------
458
459- `Issue #21`_: Fix collections deprecation warning.
460
461.. _`Issue #21`: https://github.com/cpburnz/python-pathspec/issues/21
462
463
4640.5.6 (2018-04-06)
465------------------
466
467- Improved unit tests.
468- Improved type checking.
469- `Issue #20`_: Support current directory prefix.
470
471.. _`Issue #20`: https://github.com/cpburnz/python-pathspec/issues/20
472
473
4740.5.5 (2017-09-09)
475------------------
476
477- Add documentation link to README.
478
479
4800.5.4 (2017-09-09)
481------------------
482
483- `Pull #17`_: Add link to Ruby implementation of *pathspec*.
484- Add sphinx documentation.
485
486.. _`Pull #17`: https://github.com/cpburnz/python-pathspec/pull/17
487
488
4890.5.3 (2017-07-01)
490------------------
491
492- `Issue #14`_: Fix byte strings for Python 3.
493- `Pull #15`_: Include "LICENSE" in source package.
494- `Issue #16`_: Support Python 2.6.
495
496.. _`Issue #14`: https://github.com/cpburnz/python-pathspec/issues/14
497.. _`Pull #15`: https://github.com/cpburnz/python-pathspec/pull/15
498.. _`Issue #16`: https://github.com/cpburnz/python-pathspec/issues/16
499
500
5010.5.2 (2017-04-04)
502------------------
503
504- Fixed change log.
505
506
5070.5.1 (2017-04-04)
508------------------
509
510- `Pull #13`_: Add equality methods to `PathSpec` and `RegexPattern`.
511
512.. _`Pull #13`: https://github.com/cpburnz/python-pathspec/pull/13
513
514
5150.5.0 (2016-08-22)
516------------------
517
518- `Issue #12`_: Add `PathSpec.match_file()`.
519- Renamed `gitignore.GitIgnorePattern` to `patterns.gitwildmatch.GitWildMatchPattern`.
520- Deprecated `gitignore.GitIgnorePattern`.
521
522.. _`Issue #12`: https://github.com/cpburnz/python-pathspec/issues/12
523
524
5250.4.0 (2016-07-15)
526------------------
527
528- `Issue #11`_: Support converting patterns into regular expressions without compiling them.
529- API change: Subclasses of `RegexPattern` should implement `pattern_to_regex()`.
530
531.. _`Issue #11`: https://github.com/cpburnz/python-pathspec/issues/11
532
533
5340.3.4 (2015-08-24)
535------------------
536
537- `Pull #7`_: Fixed non-recursive links.
538- `Pull #8`_: Fixed edge cases in gitignore patterns.
539- `Pull #9`_: Fixed minor usage documentation.
540- Fixed recursion detection.
541- Fixed trivial incompatibility with Python 3.2.
542
543.. _`Pull #7`: https://github.com/cpburnz/python-pathspec/pull/7
544.. _`Pull #8`: https://github.com/cpburnz/python-pathspec/pull/8
545.. _`Pull #9`: https://github.com/cpburnz/python-pathspec/pull/9
546
547
5480.3.3 (2014-11-21)
549------------------
550
551- Improved documentation.
552
553
5540.3.2 (2014-11-08)
555------------------
556
557- `Pull #5`_: Use tox for testing.
558- `Issue #6`_: Fixed matching Windows paths.
559- Improved documentation.
560- API change: `spec.match_tree()` and `spec.match_files()` now return iterators instead of sets.
561
562.. _`Pull #5`: https://github.com/cpburnz/python-pathspec/pull/5
563.. _`Issue #6`: https://github.com/cpburnz/python-pathspec/issues/6
564
565
5660.3.1 (2014-09-17)
567------------------
568
569- Updated README.
570
571
5720.3.0 (2014-09-17)
573------------------
574
575- `Pull #3`_: Fixed trailing slash in gitignore patterns.
576- `Pull #4`_: Fixed test for trailing slash in gitignore patterns.
577- Added registered patterns.
578
579.. _`Pull #3`: https://github.com/cpburnz/python-pathspec/pull/3
580.. _`Pull #4`: https://github.com/cpburnz/python-pathspec/pull/4
581
582
5830.2.2 (2013-12-17)
584------------------
585
586- Fixed setup.py.
587
588
5890.2.1 (2013-12-17)
590------------------
591
592- Added tests.
593- Fixed comment gitignore patterns.
594- Fixed relative path gitignore patterns.
595
596
5970.2.0 (2013-12-07)
598------------------
599
600- Initial release.
601