Skip to content

Commit

Permalink
Fix #68
Browse files Browse the repository at this point in the history
  • Loading branch information
cpburnz committed Dec 6, 2022
1 parent cd959e1 commit 0ce4533
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ Change History
Improvements:

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


.. _`Issue #66`: https://github.com/cpburnz/python-pathspec/issues/66
.. _`Pull #67`: https://github.com/cpburnz/python-pathspec/pull/67
.. _`Issue #68`: https://github.com/cpburnz/python-pathspec/issues/68
.. _`Issue #70`: https://github.com/cpburnz/python-pathspec/issues/70
.. _`Pull #71`: https://github.com/cpburnz/python-pathspec/pull/71

Expand Down
40 changes: 29 additions & 11 deletions pathspec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@
The following classes are imported and made available from the root of
the `pathspec` package:
- :class:`pathspec.gitignore.GitIgnoreSpec`
- :class:`pathspec.gitignore.GitIgnoreSpec`
- :class:`pathspec.pathspec.PathSpec`
- :class:`pathspec.pathspec.PathSpec`
- :class:`pathspec.pattern.Pattern`
- :class:`pathspec.pattern.Pattern`
- :class:`pathspec.pattern.RegexPattern`
- :class:`pathspec.pattern.RegexPattern`
- :class:`pathspec.util.RecursionError`
- :class:`pathspec.util.RecursionError`
The following functions are also imported:
- :func:`pathspec.util.lookup_pattern`
- :func:`pathspec.util.lookup_pattern`
The following deprecated functions are also imported to maintain
backward compatibility:
- :func:`pathspec.util.iter_tree` which is an alias for
:func:`pathspec.util.iter_tree_files`.
- :func:`pathspec.util.iter_tree` which is an alias for
:func:`pathspec.util.iter_tree_files`.
- :func:`pathspec.util.match_files`
- :func:`pathspec.util.match_files`
"""

from .gitignore import (
Expand All @@ -53,6 +53,24 @@
# Load pattern implementations.
from . import patterns

# Expose `GitIgnorePattern` class in the root module for backward
# compatibility with v0.4.
# DEPRECATED: Expose the `GitIgnorePattern` class in the root module for
# backward compatibility with v0.4.
from .patterns.gitwildmatch import GitIgnorePattern

# Declare private imports as part of the public interface. Deprecated
# imports are deliberately excluded.
__all__ = [
'GitIgnoreSpec',
'PathSpec',
'Pattern',
'RecursionError',
'RegexPattern',
'__author__',
'__copyright__',
'__credits__',
'__license__',
'__version__',
'iter_tree',
'lookup_pattern',
'match_files',
]
5 changes: 4 additions & 1 deletion pathspec/patterns/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# encoding: utf-8
"""
The *pathspec.patterns* package contains the pattern matching
implementations.
"""

# Load pattern implementations.
from . import gitwildmatch

# DEPRECATED: Expose the `GitWildMatchPattern` class in this module for
# backward compatibility with v0.5.
from .gitwildmatch import GitWildMatchPattern

0 comments on commit 0ce4533

Please sign in to comment.