File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -473,6 +473,12 @@ def _expand_patterns(cls, patterns: list[str]) -> Iterator[str]:
473473 ['LICENSE']
474474 >>> list(Distribution._expand_patterns(['pyproject.toml', 'LIC*']))
475475 ['pyproject.toml', 'LICENSE']
476+ >>> list(Distribution._expand_patterns(['setuptools/**/pyprojecttoml.py']))
477+ ['setuptools/config/pyprojecttoml.py']
478+ >>> list(Distribution._expand_patterns(['../LICENSE']))
479+ Traceback (most recent call last):
480+ ...
481+ setuptools.errors.InvalidConfigError: Pattern '../LICENSE' cannot contain '..'
476482 """
477483 return (
478484 path .replace (os .sep , "/" )
@@ -483,14 +489,6 @@ def _expand_patterns(cls, patterns: list[str]) -> Iterator[str]:
483489
484490 @staticmethod
485491 def _find_pattern (pattern : str ) -> Iterator [str ]:
486- """
487- >>> list(Distribution._find_pattern("setuptools/**/pyprojecttoml.py"))
488- ['setuptools/config/pyprojecttoml.py']
489- >>> list(Distribution._find_pattern("../LICENSE"))
490- Traceback (most recent call last):
491- ...
492- setuptools.errors.InvalidConfigError: Pattern '../LICENSE' cannot contain '..'
493- """
494492 if ".." in pattern : # XXX: Any other invalid character?
495493 raise InvalidConfigError (f"Pattern { pattern !r} cannot contain '..'" )
496494 return iglob (pattern , recursive = True )
You can’t perform that action at this time.
0 commit comments