Skip to content

Commit fb2a173

Browse files
authored
Merge pull request #200 from pypa/bugfix/178-include-posix-prefix
For 'get_python_inc', bypass missing config include dir
2 parents ca3195b + 67bb76c commit fb2a173

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+50
-75
lines changed

distutils/_msvccompiler.py

-3
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ def compile( # noqa: C901
339339
extra_postargs=None,
340340
depends=None,
341341
):
342-
343342
if not self.initialized:
344343
self.initialize()
345344
compile_info = self._setup_compile(
@@ -426,7 +425,6 @@ def compile( # noqa: C901
426425
def create_static_lib(
427426
self, objects, output_libname, output_dir=None, debug=0, target_lang=None
428427
):
429-
430428
if not self.initialized:
431429
self.initialize()
432430
objects, output_dir = self._fix_object_args(objects, output_dir)
@@ -460,7 +458,6 @@ def link(
460458
build_temp=None,
461459
target_lang=None,
462460
):
463-
464461
if not self.initialized:
465462
self.initialize()
466463
objects, output_dir = self._fix_object_args(objects, output_dir)

distutils/bcppcompiler.py

-6
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class BCPPCompiler(CCompiler):
6464
exe_extension = '.exe'
6565

6666
def __init__(self, verbose=0, dry_run=0, force=0):
67-
6867
super().__init__(verbose, dry_run, force)
6968

7069
# These executables are assumed to all be in the path.
@@ -98,7 +97,6 @@ def compile( # noqa: C901
9897
extra_postargs=None,
9998
depends=None,
10099
):
101-
102100
macros, objects, extra_postargs, pp_opts, build = self._setup_compile(
103101
output_dir, macros, include_dirs, sources, depends, extra_postargs
104102
)
@@ -167,7 +165,6 @@ def compile( # noqa: C901
167165
def create_static_lib(
168166
self, objects, output_libname, output_dir=None, debug=0, target_lang=None
169167
):
170-
171168
(objects, output_dir) = self._fix_object_args(objects, output_dir)
172169
output_filename = self.library_filename(output_libname, output_dir=output_dir)
173170

@@ -200,7 +197,6 @@ def link( # noqa: C901
200197
build_temp=None,
201198
target_lang=None,
202199
):
203-
204200
# XXX this ignores 'build_temp'! should follow the lead of
205201
# msvccompiler.py
206202

@@ -219,7 +215,6 @@ def link( # noqa: C901
219215
output_filename = os.path.join(output_dir, output_filename)
220216

221217
if self._need_link(objects, output_filename):
222-
223218
# Figure out linker args based on type of target.
224219
if target_desc == CCompiler.EXECUTABLE:
225220
startup_obj = 'c0w32'
@@ -380,7 +375,6 @@ def preprocess(
380375
extra_preargs=None,
381376
extra_postargs=None,
382377
):
383-
384378
(_, macros, include_dirs) = self._fix_compile_args(None, macros, include_dirs)
385379
pp_opts = gen_preprocess_options(macros, include_dirs)
386380
pp_args = ['cpp32.exe'] + pp_opts

distutils/cmd.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def dump_options(self, header=None, indent=""):
160160
header = "command options for '%s':" % self.get_command_name()
161161
self.announce(indent + header, level=logging.INFO)
162162
indent = indent + " "
163-
for (option, _, _) in self.user_options:
163+
for option, _, _ in self.user_options:
164164
option = option.translate(longopt_xlate)
165165
if option[-1] == "=":
166166
option = option[:-1]
@@ -291,7 +291,7 @@ def set_undefined_options(self, src_cmd, *option_pairs):
291291
# Option_pairs: list of (src_option, dst_option) tuples
292292
src_cmd_obj = self.distribution.get_command_obj(src_cmd)
293293
src_cmd_obj.ensure_finalized()
294-
for (src_option, dst_option) in option_pairs:
294+
for src_option, dst_option in option_pairs:
295295
if getattr(self, dst_option) is None:
296296
setattr(self, dst_option, getattr(src_cmd_obj, src_option))
297297

@@ -325,7 +325,7 @@ def get_sub_commands(self):
325325
run for the current distribution. Return a list of command names.
326326
"""
327327
commands = []
328-
for (cmd_name, method) in self.sub_commands:
328+
for cmd_name, method in self.sub_commands:
329329
if method is None or method(self):
330330
commands.append(cmd_name)
331331
return commands

distutils/command/bdist.py

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def append(self, item):
3333

3434

3535
class bdist(Command):
36-
3736
description = "create a built (binary) distribution"
3837

3938
user_options = [

distutils/command/bdist_dumb.py

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515

1616
class bdist_dumb(Command):
17-
1817
description = "create a \"dumb\" built distribution"
1918

2019
user_options = [

distutils/command/bdist_rpm.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222

2323
class bdist_rpm(Command):
24-
2524
description = "create an RPM distribution"
2625

2726
user_options = [
@@ -554,7 +553,7 @@ def _make_spec_file(self): # noqa: C901
554553
('postun', 'post_uninstall', None),
555554
]
556555

557-
for (rpm_opt, attr, default) in script_options:
556+
for rpm_opt, attr, default in script_options:
558557
# Insert contents of file referred to, if no file is referred to
559558
# use 'default' as contents of script
560559
val = getattr(self, attr)

distutils/command/build.py

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ def show_compilers():
1616

1717

1818
class build(Command):
19-
2019
description = "build everything needed to install"
2120

2221
user_options = [

distutils/command/build_clib.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def show_compilers():
2828

2929

3030
class build_clib(Command):
31-
3231
description = "build C/C++ libraries used by Python extensions"
3332

3433
user_options = [
@@ -103,7 +102,7 @@ def run(self):
103102
self.compiler.set_include_dirs(self.include_dirs)
104103
if self.define is not None:
105104
# 'define' option is a list of (name,value) tuples
106-
for (name, value) in self.define:
105+
for name, value in self.define:
107106
self.compiler.define_macro(name, value)
108107
if self.undef is not None:
109108
for macro in self.undef:
@@ -155,14 +154,14 @@ def get_library_names(self):
155154
return None
156155

157156
lib_names = []
158-
for (lib_name, build_info) in self.libraries:
157+
for lib_name, build_info in self.libraries:
159158
lib_names.append(lib_name)
160159
return lib_names
161160

162161
def get_source_files(self):
163162
self.check_library_list(self.libraries)
164163
filenames = []
165-
for (lib_name, build_info) in self.libraries:
164+
for lib_name, build_info in self.libraries:
166165
sources = build_info.get('sources')
167166
if sources is None or not isinstance(sources, (list, tuple)):
168167
raise DistutilsSetupError(
@@ -175,7 +174,7 @@ def get_source_files(self):
175174
return filenames
176175

177176
def build_libraries(self, libraries):
178-
for (lib_name, build_info) in libraries:
177+
for lib_name, build_info in libraries:
179178
sources = build_info.get('sources')
180179
if sources is None or not isinstance(sources, (list, tuple)):
181180
raise DistutilsSetupError(

distutils/command/build_ext.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def show_compilers():
3939

4040

4141
class build_ext(Command):
42-
4342
description = "build C/C++ extensions (compile/link to build directory)"
4443

4544
# XXX thoughts on how to deal with complex command-line options like
@@ -328,7 +327,7 @@ def run(self): # noqa: C901
328327
self.compiler.set_include_dirs(self.include_dirs)
329328
if self.define is not None:
330329
# 'define' option is a list of (name,value) tuples
331-
for (name, value) in self.define:
330+
for name, value in self.define:
332331
self.compiler.define_macro(name, value)
333332
if self.undef is not None:
334333
for macro in self.undef:

distutils/command/build_py.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515

1616
class build_py(Command):
17-
1817
description = "\"build\" pure Python modules (copy to build directory)"
1918

2019
user_options = [
@@ -310,7 +309,7 @@ def get_module_outfile(self, build_dir, package, module):
310309
def get_outputs(self, include_bytecode=1):
311310
modules = self.find_all_modules()
312311
outputs = []
313-
for (package, module, module_file) in modules:
312+
for package, module, module_file in modules:
314313
package = package.split('.')
315314
filename = self.get_module_outfile(self.build_lib, package, module)
316315
outputs.append(filename)
@@ -352,7 +351,7 @@ def build_module(self, module, module_file, package):
352351

353352
def build_modules(self):
354353
modules = self.find_modules()
355-
for (package, module, module_file) in modules:
354+
for package, module, module_file in modules:
356355
# Now "build" the module -- ie. copy the source file to
357356
# self.build_lib (the build directory for Python source).
358357
# (Actually, it gets copied to the directory for this package
@@ -375,7 +374,7 @@ def build_packages(self):
375374

376375
# Now loop over the modules we found, "building" each one (just
377376
# copy it to self.build_lib).
378-
for (package_, module, module_file) in modules:
377+
for package_, module, module_file in modules:
379378
assert package == package_
380379
self.build_module(module, module_file, package)
381380

distutils/command/build_scripts.py

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323

2424
class build_scripts(Command):
25-
2625
description = "\"build\" scripts (copy and fixup #! line)"
2726

2827
user_options = [

distutils/command/clean.py

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212

1313
class clean(Command):
14-
1514
description = "clean up temporary files from 'build' command"
1615
user_options = [
1716
('build-base=', 'b', "base build directory (default: 'build.build-base')"),

distutils/command/config.py

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222

2323
class config(Command):
24-
2524
description = "prepare to build"
2625

2726
user_options = [

distutils/command/install.py

-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ def _pypy_hack(name):
180180

181181

182182
class install(Command):
183-
184183
description = "install everything from build directory"
185184

186185
user_options = [

distutils/command/install_data.py

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212

1313
class install_data(Command):
14-
1514
description = "install data files"
1615

1716
user_options = [

distutils/command/install_headers.py

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
# XXX force is never used
1010
class install_headers(Command):
11-
1211
description = "install C/C++ header files"
1312

1413
user_options = [

distutils/command/install_lib.py

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717

1818
class install_lib(Command):
19-
2019
description = "install all Python modules (extensions and pure Python)"
2120

2221
# The byte-compilation options are a tad confusing. Here are the

distutils/command/install_scripts.py

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313

1414
class install_scripts(Command):
15-
1615
description = "install scripts (Python or otherwise)"
1716

1817
user_options = [

distutils/command/register.py

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818

1919
class register(PyPIRCCommand):
20-
2120
description = "register the distribution with the Python package index"
2221
user_options = PyPIRCCommand.user_options + [
2322
('list-classifiers', None, 'list the valid Trove classifiers'),

distutils/command/sdist.py

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def show_formats():
3333

3434

3535
class sdist(Command):
36-
3736
description = "create a source distribution (tarball, zip file, etc.)"
3837

3938
def checking_metadata(self):

distutils/command/upload.py

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828

2929
class upload(PyPIRCCommand):
30-
3130
description = "upload binary package to PyPI"
3231

3332
user_options = PyPIRCCommand.user_options + [

distutils/cygwinccompiler.py

-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ class CygwinCCompiler(UnixCCompiler):
8484
exe_extension = ".exe"
8585

8686
def __init__(self, verbose=0, dry_run=0, force=0):
87-
8887
super().__init__(verbose, dry_run, force)
8988

9089
status, details = check_config_h()
@@ -269,7 +268,6 @@ class Mingw32CCompiler(CygwinCCompiler):
269268
compiler_type = 'mingw32'
270269

271270
def __init__(self, verbose=0, dry_run=0, force=0):
272-
273271
super().__init__(verbose, dry_run, force)
274272

275273
shared_option = "-shared"

0 commit comments

Comments
 (0)