diff options
author | Éric Araujo <merwok@netwok.org> | 2011-09-17 01:31:51 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-09-17 01:31:51 (GMT) |
commit | 7724a6c10c56a1b14b4933de368e672eae840f47 (patch) | |
tree | 1b3bd60ab9b79bd018cbc942a8e12140b2e18576 /Lib/packaging/command/build_ext.py | |
parent | 37ccd6f794539e0678b7a7ad938e571cc73e106c (diff) | |
download | cpython-7724a6c10c56a1b14b4933de368e672eae840f47.zip cpython-7724a6c10c56a1b14b4933de368e672eae840f47.tar.gz cpython-7724a6c10c56a1b14b4933de368e672eae840f47.tar.bz2 |
Packaging cleanup: remove conditionals for < 2.6 support.
PEP 370 features and sys.dont_write_bytecode are always available
in 3.3; the distutils2 backport still has the conditionals.
I also renamed an internal misnamed method and fixed a few things
(“packaging2” name, stray print, unused import, fd leak).
Diffstat (limited to 'Lib/packaging/command/build_ext.py')
-rw-r--r-- | Lib/packaging/command/build_ext.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/Lib/packaging/command/build_ext.py b/Lib/packaging/command/build_ext.py index 2bffae3..4051a2d 100644 --- a/Lib/packaging/command/build_ext.py +++ b/Lib/packaging/command/build_ext.py @@ -3,6 +3,7 @@ import os import re import sys +import site import logging import sysconfig @@ -15,9 +16,6 @@ from packaging.util import newer_group from packaging.compiler.extension import Extension from packaging import logger -import site -HAS_USER_SITE = True - if os.name == 'nt': from packaging.compiler.msvccompiler import get_build_version MSVC_VERSION = int(get_build_version()) @@ -62,6 +60,8 @@ class build_ext(Command): ('inplace', 'i', "ignore build-lib and put compiled extensions into the source " + "directory alongside your pure Python modules"), + ('user', None, + "add user include, library and rpath"), ('include-dirs=', 'I', "list of directories to search for header files" + sep_by), ('define=', 'D', @@ -88,12 +88,8 @@ class build_ext(Command): "path to the SWIG executable"), ] - boolean_options = ['inplace', 'debug', 'force'] + boolean_options = ['inplace', 'debug', 'force', 'user'] - if HAS_USER_SITE: - user_options.append(('user', None, - "add user include, library and rpath")) - boolean_options.append('user') help_options = [ ('help-compiler', None, @@ -120,8 +116,7 @@ class build_ext(Command): self.compiler = None self.swig = None self.swig_opts = None - if HAS_USER_SITE: - self.user = None + self.user = None def finalize_options(self): self.set_undefined_options('build', @@ -270,7 +265,7 @@ class build_ext(Command): self.swig_opts = self.swig_opts.split(' ') # Finally add the user include and library directories if requested - if HAS_USER_SITE and self.user: + if self.user: user_include = os.path.join(site.USER_BASE, "include") user_lib = os.path.join(site.USER_BASE, "lib") if os.path.isdir(user_include): |