We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a14e36a commit a19973bCopy full SHA for a19973b
tools/vendored.py
@@ -166,4 +166,17 @@ def update_setuptools():
166
rewrite_more_itertools(vendor / "more_itertools")
167
168
169
+def yield_root_package(name):
170
+ """Useful when defining the MetaPathFinder
171
+ >>> set(yield_root_package("setuptools")) & {"jaraco", "backports"}
172
+ {'jaraco', 'backports'}
173
+ """
174
+ vendored = Path(f"{name}/_vendor/vendored.txt")
175
+ yield from (
176
+ line.partition("=")[0].partition(".")[0].replace("-", "_")
177
+ for line in vendored.read_text(encoding="utf-8").splitlines()
178
+ if line and not line.startswith("#")
179
+ )
180
+
181
182
__name__ == '__main__' and update_vendored()
0 commit comments