Commit 1047052e authored by Deniz Taneli's avatar Deniz Taneli

Address review comments

parent 4e4efa77
...@@ -6,7 +6,6 @@ import io ...@@ -6,7 +6,6 @@ import io
import contextlib import contextlib
from setuptools.extern import six from setuptools.extern import six
from setuptools.extern.six.moves import configparser
from .py36compat import sdist_add_defaults from .py36compat import sdist_add_defaults
...@@ -206,11 +205,12 @@ class sdist(sdist_add_defaults, orig.sdist): ...@@ -206,11 +205,12 @@ class sdist(sdist_add_defaults, orig.sdist):
""" """
opts = self.distribution.get_option_dict('metadata') opts = self.distribution.get_option_dict('metadata')
try:
# ignore the source of the value # ignore the source of the value
_, license_file = opts.get('license_file') _, license_file = opts.get('license_file', (None, None))
except TypeError:
log.debug("'license_file' attribute is not defined") if license_file is None:
log.debug("'license_file' option was not specified")
return return
if not os.path.exists(license_file): if not os.path.exists(license_file):
......
...@@ -529,8 +529,10 @@ class TestEggInfo: ...@@ -529,8 +529,10 @@ class TestEggInfo:
env=environ, env=environ,
) )
egg_info_dir = os.path.join('.', 'foo.egg-info') egg_info_dir = os.path.join('.', 'foo.egg-info')
with open(os.path.join(egg_info_dir, 'SOURCES.txt')) as sources_file: with open(os.path.join(egg_info_dir, 'SOURCES.txt')) as sources_file:
sources_text = sources_file.read() sources_text = sources_file.read()
if license_in_sources: if license_in_sources:
assert 'LICENSE' in sources_text assert 'LICENSE' in sources_text
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment