Skip to content

Commit 0ce4533

Browse files
committed
Fix #68
1 parent cd959e1 commit 0ce4533

File tree

3 files changed

+35
-12
lines changed

3 files changed

+35
-12
lines changed

CHANGES.rst

+2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ Change History
99
Improvements:
1010

1111
- `Issue #66`_/`Pull #67`_: Package not marked as py.typed.
12+
- `Issue #68`_: Exports are considered private.
1213
- `Issue #70`_/`Pull #71`_: 'Self' string literal type is Unknown in pyright.
1314

1415

1516
.. _`Issue #66`: https://github.com/cpburnz/python-pathspec/issues/66
1617
.. _`Pull #67`: https://github.com/cpburnz/python-pathspec/pull/67
18+
.. _`Issue #68`: https://github.com/cpburnz/python-pathspec/issues/68
1719
.. _`Issue #70`: https://github.com/cpburnz/python-pathspec/issues/70
1820
.. _`Pull #71`: https://github.com/cpburnz/python-pathspec/pull/71
1921

pathspec/__init__.py

+29-11
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@
66
The following classes are imported and made available from the root of
77
the `pathspec` package:
88
9-
- :class:`pathspec.gitignore.GitIgnoreSpec`
9+
- :class:`pathspec.gitignore.GitIgnoreSpec`
1010
11-
- :class:`pathspec.pathspec.PathSpec`
11+
- :class:`pathspec.pathspec.PathSpec`
1212
13-
- :class:`pathspec.pattern.Pattern`
13+
- :class:`pathspec.pattern.Pattern`
1414
15-
- :class:`pathspec.pattern.RegexPattern`
15+
- :class:`pathspec.pattern.RegexPattern`
1616
17-
- :class:`pathspec.util.RecursionError`
17+
- :class:`pathspec.util.RecursionError`
1818
1919
The following functions are also imported:
2020
21-
- :func:`pathspec.util.lookup_pattern`
21+
- :func:`pathspec.util.lookup_pattern`
2222
2323
The following deprecated functions are also imported to maintain
2424
backward compatibility:
2525
26-
- :func:`pathspec.util.iter_tree` which is an alias for
27-
:func:`pathspec.util.iter_tree_files`.
26+
- :func:`pathspec.util.iter_tree` which is an alias for
27+
:func:`pathspec.util.iter_tree_files`.
2828
29-
- :func:`pathspec.util.match_files`
29+
- :func:`pathspec.util.match_files`
3030
"""
3131

3232
from .gitignore import (
@@ -53,6 +53,24 @@
5353
# Load pattern implementations.
5454
from . import patterns
5555

56-
# Expose `GitIgnorePattern` class in the root module for backward
57-
# compatibility with v0.4.
56+
# DEPRECATED: Expose the `GitIgnorePattern` class in the root module for
57+
# backward compatibility with v0.4.
5858
from .patterns.gitwildmatch import GitIgnorePattern
59+
60+
# Declare private imports as part of the public interface. Deprecated
61+
# imports are deliberately excluded.
62+
__all__ = [
63+
'GitIgnoreSpec',
64+
'PathSpec',
65+
'Pattern',
66+
'RecursionError',
67+
'RegexPattern',
68+
'__author__',
69+
'__copyright__',
70+
'__credits__',
71+
'__license__',
72+
'__version__',
73+
'iter_tree',
74+
'lookup_pattern',
75+
'match_files',
76+
]

pathspec/patterns/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
# encoding: utf-8
21
"""
32
The *pathspec.patterns* package contains the pattern matching
43
implementations.
54
"""
65

76
# Load pattern implementations.
7+
from . import gitwildmatch
8+
9+
# DEPRECATED: Expose the `GitWildMatchPattern` class in this module for
10+
# backward compatibility with v0.5.
811
from .gitwildmatch import GitWildMatchPattern

0 commit comments

Comments
 (0)