Skip to content

Commit aecfb67

Browse files
Fix sdist_upip script to include PKG-INFO and LICENSE files required by PyPI
PKG-INFO and LICENSE files must be part of the tar.gz file See https://packaging.python.org/en/latest/discussions/package-formats/
1 parent 18fdda4 commit aecfb67

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

sdist_upip.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@
3030
from setuptools.command.sdist import sdist as _sdist
3131

3232

33+
# include, exclude
3334
FILTERS = [
34-
# include, exclude, repeat
35-
(r".+\.egg-info/(PKG-INFO|requires\.txt)", r"setup.py$"),
36-
(r".+\.py$", r"[^/]+$"),
35+
# include required metadata files in .egg-info
36+
(r".+\.egg-info/(PKG-INFO|requires\.txt)", r"setup.(py|cfg)$"),
37+
# include all Python files and the PKG-INFO
38+
(r".+\.py$|^PKG-INFO$|^LICENSE\.txt$", r"[^\/]+$"),
39+
# exclude all other .egg-info files
3740
(None, r".+\.egg-info/.+"),
3841
]
3942
outbuf = io.BytesIO()

0 commit comments

Comments
 (0)