Commit 5ce9e5f3 authored by Jason R. Coombs's avatar Jason R. Coombs

👹 Feed the hobgoblins (delint).

parent 313ac58f
...@@ -64,10 +64,10 @@ html_use_index = False ...@@ -64,10 +64,10 @@ html_use_index = False
# Grouping the document tree into LaTeX files. List of tuples # Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, # (source start file, target name, title, author,
# documentclass [howto/manual]). # documentclass [howto/manual]).
latex_documents = [ latex_documents = [(
('index', 'Setuptools.tex', 'Setuptools Documentation', 'index', 'Setuptools.tex', 'Setuptools Documentation',
'The fellowship of the packaging', 'manual'), 'The fellowship of the packaging', 'manual',
] )]
link_files = { link_files = {
'../CHANGES.rst': dict( '../CHANGES.rst': dict(
......
...@@ -191,8 +191,8 @@ class Command(_Command): ...@@ -191,8 +191,8 @@ class Command(_Command):
ok = False ok = False
if not ok: if not ok:
raise DistutilsOptionError( raise DistutilsOptionError(
"'%s' must be a list of strings (got %r)" "'%s' must be a list of strings (got %r)"
% (option, val)) % (option, val))
def reinitialize_command(self, command, reinit_subcommands=0, **kw): def reinitialize_command(self, command, reinit_subcommands=0, **kw):
cmd = _Command.reinitialize_command(self, command, reinit_subcommands) cmd = _Command.reinitialize_command(self, command, reinit_subcommands)
......
...@@ -25,9 +25,9 @@ class build_clib(orig.build_clib): ...@@ -25,9 +25,9 @@ class build_clib(orig.build_clib):
sources = build_info.get('sources') sources = build_info.get('sources')
if sources is None or not isinstance(sources, (list, tuple)): if sources is None or not isinstance(sources, (list, tuple)):
raise DistutilsSetupError( raise DistutilsSetupError(
"in 'libraries' option (library '%s'), " "in 'libraries' option (library '%s'), "
"'sources' must be present and must be " "'sources' must be present and must be "
"a list of source filenames" % lib_name) "a list of source filenames" % lib_name)
sources = list(sources) sources = list(sources)
log.info("building '%s' library", lib_name) log.info("building '%s' library", lib_name)
...@@ -38,9 +38,9 @@ class build_clib(orig.build_clib): ...@@ -38,9 +38,9 @@ class build_clib(orig.build_clib):
obj_deps = build_info.get('obj_deps', dict()) obj_deps = build_info.get('obj_deps', dict())
if not isinstance(obj_deps, dict): if not isinstance(obj_deps, dict):
raise DistutilsSetupError( raise DistutilsSetupError(
"in 'libraries' option (library '%s'), " "in 'libraries' option (library '%s'), "
"'obj_deps' must be a dictionary of " "'obj_deps' must be a dictionary of "
"type 'source: list'" % lib_name) "type 'source: list'" % lib_name)
dependencies = [] dependencies = []
# Get the global dependencies that are specified by the '' key. # Get the global dependencies that are specified by the '' key.
...@@ -48,9 +48,9 @@ class build_clib(orig.build_clib): ...@@ -48,9 +48,9 @@ class build_clib(orig.build_clib):
global_deps = obj_deps.get('', list()) global_deps = obj_deps.get('', list())
if not isinstance(global_deps, (list, tuple)): if not isinstance(global_deps, (list, tuple)):
raise DistutilsSetupError( raise DistutilsSetupError(
"in 'libraries' option (library '%s'), " "in 'libraries' option (library '%s'), "
"'obj_deps' must be a dictionary of " "'obj_deps' must be a dictionary of "
"type 'source: list'" % lib_name) "type 'source: list'" % lib_name)
# Build the list to be used by newer_pairwise_group # Build the list to be used by newer_pairwise_group
# each source will be auto-added to its dependencies. # each source will be auto-added to its dependencies.
...@@ -60,16 +60,16 @@ class build_clib(orig.build_clib): ...@@ -60,16 +60,16 @@ class build_clib(orig.build_clib):
extra_deps = obj_deps.get(source, list()) extra_deps = obj_deps.get(source, list())
if not isinstance(extra_deps, (list, tuple)): if not isinstance(extra_deps, (list, tuple)):
raise DistutilsSetupError( raise DistutilsSetupError(
"in 'libraries' option (library '%s'), " "in 'libraries' option (library '%s'), "
"'obj_deps' must be a dictionary of " "'obj_deps' must be a dictionary of "
"type 'source: list'" % lib_name) "type 'source: list'" % lib_name)
src_deps.extend(extra_deps) src_deps.extend(extra_deps)
dependencies.append(src_deps) dependencies.append(src_deps)
expected_objects = self.compiler.object_filenames( expected_objects = self.compiler.object_filenames(
sources, sources,
output_dir=self.build_temp output_dir=self.build_temp,
) )
if ( if (
newer_pairwise_group(dependencies, expected_objects) newer_pairwise_group(dependencies, expected_objects)
......
...@@ -162,7 +162,7 @@ def write_pkg_file(self, file): ...@@ -162,7 +162,7 @@ def write_pkg_file(self, file):
if self.download_url: if self.download_url:
write_field('Download-URL', self.download_url) write_field('Download-URL', self.download_url)
for project_url in self.project_urls.items(): for project_url in self.project_urls.items():
write_field('Project-URL', '%s, %s' % project_url) write_field('Project-URL', '%s, %s' % project_url)
long_desc = rfc822_escape(self.get_long_description()) long_desc = rfc822_escape(self.get_long_description())
write_field('Description', long_desc) write_field('Description', long_desc)
......
...@@ -544,7 +544,7 @@ class SystemInfo: ...@@ -544,7 +544,7 @@ class SystemInfo:
# Except for VS15+, VC version is aligned with VS version # Except for VS15+, VC version is aligned with VS version
self.vs_ver = self.vc_ver = ( self.vs_ver = self.vc_ver = (
vc_ver or self._find_latest_available_vs_ver()) vc_ver or self._find_latest_available_vs_ver())
def _find_latest_available_vs_ver(self): def _find_latest_available_vs_ver(self):
""" """
......
...@@ -6,7 +6,7 @@ from setuptools.extern.six import PY2, PY3 ...@@ -6,7 +6,7 @@ from setuptools.extern.six import PY2, PY3
__all__ = [ __all__ = [
'fail_on_ascii', 'py2_only', 'py3_only' 'fail_on_ascii', 'py2_only', 'py3_only'
] ]
......
...@@ -8,8 +8,7 @@ from setuptools.dist import Distribution ...@@ -8,8 +8,7 @@ from setuptools.dist import Distribution
class TestBuildCLib: class TestBuildCLib:
@mock.patch( @mock.patch(
'setuptools.command.build_clib.newer_pairwise_group' 'setuptools.command.build_clib.newer_pairwise_group')
)
def test_build_libraries(self, mock_newer): def test_build_libraries(self, mock_newer):
dist = Distribution() dist = Distribution()
cmd = build_clib(dist) cmd = build_clib(dist)
......
...@@ -695,7 +695,7 @@ class TestOptions: ...@@ -695,7 +695,7 @@ class TestOptions:
) )
with get_dist(tmpdir) as dist: with get_dist(tmpdir) as dist:
assert set(dist.packages) == set( assert set(dist.packages) == set(
['fake_package', 'fake_package.sub_two']) ['fake_package', 'fake_package.sub_two'])
@py2_only @py2_only
def test_find_namespace_directive_fails_on_py2(self, tmpdir): def test_find_namespace_directive_fails_on_py2(self, tmpdir):
...@@ -748,7 +748,7 @@ class TestOptions: ...@@ -748,7 +748,7 @@ class TestOptions:
) )
with get_dist(tmpdir) as dist: with get_dist(tmpdir) as dist:
assert set(dist.packages) == { assert set(dist.packages) == {
'fake_package', 'fake_package.sub_two' 'fake_package', 'fake_package.sub_two'
} }
def test_extras_require(self, tmpdir): def test_extras_require(self, tmpdir):
...@@ -881,7 +881,7 @@ class TestExternalSetters: ...@@ -881,7 +881,7 @@ class TestExternalSetters:
return None return None
@patch.object(_Distribution, '__init__', autospec=True) @patch.object(_Distribution, '__init__', autospec=True)
def test_external_setters(self, mock_parent_init, tmpdir): def test_external_setters(self, mock_parent_init, tmpdir):
mock_parent_init.side_effect = self._fake_distribution_init mock_parent_init.side_effect = self._fake_distribution_init
dist = Distribution(attrs={ dist = Distribution(attrs={
......
...@@ -629,7 +629,7 @@ class TestSetupRequires: ...@@ -629,7 +629,7 @@ class TestSetupRequires:
test_pkg = create_setup_requires_package( test_pkg = create_setup_requires_package(
temp_dir, setup_attrs=dict(version='attr: foobar.version'), temp_dir, setup_attrs=dict(version='attr: foobar.version'),
make_package=make_dependency_sdist, make_package=make_dependency_sdist,
use_setup_cfg=use_setup_cfg+('version',), use_setup_cfg=use_setup_cfg + ('version',),
) )
test_setup_py = os.path.join(test_pkg, 'setup.py') test_setup_py = os.path.join(test_pkg, 'setup.py')
with contexts.quiet() as (stdout, stderr): with contexts.quiet() as (stdout, stderr):
...@@ -905,8 +905,8 @@ def make_python_requires_sdist(dist_path, distname, version, python_requires): ...@@ -905,8 +905,8 @@ def make_python_requires_sdist(dist_path, distname, version, python_requires):
python_requires={python_requires!r}, python_requires={python_requires!r},
) )
""").format( """).format(
name=distname, version=version, name=distname, version=version,
python_requires=python_requires)), python_requires=python_requires)),
('setup.cfg', ''), ('setup.cfg', ''),
]) ])
...@@ -965,16 +965,16 @@ def create_setup_requires_package(path, distname='foobar', version='0.1', ...@@ -965,16 +965,16 @@ def create_setup_requires_package(path, distname='foobar', version='0.1',
value = ';'.join(value) value = ';'.join(value)
section.append('%s: %s' % (name, value)) section.append('%s: %s' % (name, value))
test_setup_cfg_contents = DALS( test_setup_cfg_contents = DALS(
""" """
[metadata] [metadata]
{metadata} {metadata}
[options] [options]
{options} {options}
""" """
).format( ).format(
options='\n'.join(options), options='\n'.join(options),
metadata='\n'.join(metadata), metadata='\n'.join(metadata),
) )
else: else:
test_setup_cfg_contents = '' test_setup_cfg_contents = ''
with open(os.path.join(test_pkg, 'setup.cfg'), 'w') as f: with open(os.path.join(test_pkg, 'setup.cfg'), 'w') as f:
......
...@@ -223,10 +223,10 @@ class TestFeatures: ...@@ -223,10 +223,10 @@ class TestFeatures:
py_modules=['bar_et'], remove=['bar.ext'], py_modules=['bar_et'], remove=['bar.ext'],
), ),
'baz': Feature( 'baz': Feature(
"baz", optional=False, packages=['pkg.baz'], "baz", optional=False, packages=['pkg.baz'],
scripts=['scripts/baz_it'], scripts=['scripts/baz_it'],
libraries=[('libfoo', 'foo/foofoo.c')] libraries=[('libfoo', 'foo/foofoo.c')]
), ),
'dwim': Feature("DWIM", available=False, remove='bazish'), 'dwim': Feature("DWIM", available=False, remove='bazish'),
}, },
script_args=['--without-bar', 'install'], script_args=['--without-bar', 'install'],
......
...@@ -125,11 +125,12 @@ def flatten_tree(tree): ...@@ -125,11 +125,12 @@ def flatten_tree(tree):
def format_install_tree(tree): def format_install_tree(tree):
return {x.format( return {
py_version=PY_MAJOR, x.format(
platform=get_platform(), py_version=PY_MAJOR,
shlib_ext=get_config_var('EXT_SUFFIX') or get_config_var('SO')) platform=get_platform(),
for x in tree} shlib_ext=get_config_var('EXT_SUFFIX') or get_config_var('SO'))
for x in tree}
def _check_wheel_install(filename, install_dir, install_tree_includes, def _check_wheel_install(filename, install_dir, install_tree_includes,
......
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