From d53e024af2f5d8f3a4a36588c3dc004d156bc830 Mon Sep 17 00:00:00 2001 From: Alexander Duryagin Date: Fri, 11 Jan 2019 15:57:54 +0300 Subject: do not change py36compat, put changes into sdist command --- setuptools/command/py36compat.py | 2 +- setuptools/command/sdist.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'setuptools/command') diff --git a/setuptools/command/py36compat.py b/setuptools/command/py36compat.py index c256bfb8..61063e75 100644 --- a/setuptools/command/py36compat.py +++ b/setuptools/command/py36compat.py @@ -76,7 +76,7 @@ class sdist_add_defaults: self.warn("standard file '%s' not found" % fn) def _add_defaults_optional(self): - optional = ['test/test*.py', 'setup.cfg', 'pyproject.toml'] + optional = ['test/test*.py', 'setup.cfg'] for pattern in optional: files = filter(os.path.isfile, glob(pattern)) self.filelist.extend(files) diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py index bcfae4d8..40965a67 100644 --- a/setuptools/command/sdist.py +++ b/setuptools/command/sdist.py @@ -121,6 +121,14 @@ class sdist(sdist_add_defaults, orig.sdist): if has_leaky_handle: read_template = __read_template_hack + def _add_defaults_optional(self): + if six.PY2: + sdist_add_defaults._add_defaults_optional(self) + else: + super()._add_defaults_optional() + if os.path.isfile('pyproject.toml'): + self.filelist.append('pyproject.toml') + def _add_defaults_python(self): """getting python files""" if self.distribution.has_pure_modules(): -- cgit v1.2.3