Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
15ea2f25
Commit
15ea2f25
authored
Sep 06, 2014
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove various dead version checks (closes #22349)
Patch from Thomas Kluyver.
parent
01dbd70d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
45 deletions
+16
-45
command/build_ext.py
command/build_ext.py
+4
-13
sysconfig.py
sysconfig.py
+3
-21
tests/test_build_ext.py
tests/test_build_ext.py
+9
-11
No files found.
command/build_ext.py
View file @
15ea2f25
...
...
@@ -14,13 +14,7 @@ from distutils.extension import Extension
from
distutils.util
import
get_platform
from
distutils
import
log
# this keeps compatibility from 2.3 to 2.5
if
sys
.
version
<
"2.6"
:
USER_BASE
=
None
HAS_USER_SITE
=
False
else
:
from
site
import
USER_BASE
HAS_USER_SITE
=
True
from
site
import
USER_BASE
if
os
.
name
==
'nt'
:
from
distutils.msvccompiler
import
get_build_version
...
...
@@ -97,14 +91,11 @@ class build_ext(Command):
"list of SWIG command line options"
),
(
'swig='
,
None
,
"path to the SWIG executable"
),
(
'user'
,
None
,
"add user include, library and rpath"
)
]
boolean_options
=
[
'inplace'
,
'debug'
,
'force'
,
'swig-cpp'
]
if
HAS_USER_SITE
:
user_options
.
append
((
'user'
,
None
,
"add user include, library and rpath"
))
boolean_options
.
append
(
'user'
)
boolean_options
=
[
'inplace'
,
'debug'
,
'force'
,
'swig-cpp'
,
'user'
]
help_options
=
[
(
'help-compiler'
,
None
,
...
...
sysconfig.py
View file @
15ea2f25
...
...
@@ -151,10 +151,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
if
standard_lib
:
return
os
.
path
.
join
(
prefix
,
"Lib"
)
else
:
if
get_python_version
()
<
"2.2"
:
return
prefix
else
:
return
os
.
path
.
join
(
prefix
,
"Lib"
,
"site-packages"
)
return
os
.
path
.
join
(
prefix
,
"Lib"
,
"site-packages"
)
else
:
raise
DistutilsPlatformError
(
"I don't know where Python installs its library "
...
...
@@ -244,12 +241,8 @@ def get_config_h_filename():
inc_dir
=
_sys_home
or
project_base
else
:
inc_dir
=
get_python_inc
(
plat_specific
=
1
)
if
get_python_version
()
<
'2.2'
:
config_h
=
'config.h'
else
:
# The name of the config.h file changed in 2.2
config_h
=
'pyconfig.h'
return
os
.
path
.
join
(
inc_dir
,
config_h
)
return
os
.
path
.
join
(
inc_dir
,
'pyconfig.h'
)
def
get_makefile_filename
():
...
...
@@ -461,17 +454,6 @@ def _init_posix():
if python_build:
g['LDSHARED'] = g['BLDSHARED']
elif get_python_version() < '2.1':
# The following two branches are for 1.5.2 compatibility.
if sys.platform == 'aix4': # what about AIX 3.x ?
# Linker script is in the config directory, not in Modules as the
# Makefile says.
python_lib = get_python_lib(standard_lib=1)
ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix')
python_exp = os.path.join(python_lib, 'config', 'python.exp')
g['LDSHARED'] = "
%
s
%
s
-
bI
:
%
s
" % (ld_so_aix, g['CC'], python_exp)
global _config_vars
_config_vars = g
...
...
tests/test_build_ext.py
View file @
15ea2f25
...
...
@@ -31,12 +31,11 @@ class BuildExtTestCase(TempdirManager,
self
.
tmp_dir
=
self
.
mkdtemp
()
self
.
sys_path
=
sys
.
path
,
sys
.
path
[:]
sys
.
path
.
append
(
self
.
tmp_dir
)
if
sys
.
version
>
"2.6"
:
import
site
self
.
old_user_base
=
site
.
USER_BASE
site
.
USER_BASE
=
self
.
mkdtemp
()
from
distutils.command
import
build_ext
build_ext
.
USER_BASE
=
site
.
USER_BASE
import
site
self
.
old_user_base
=
site
.
USER_BASE
site
.
USER_BASE
=
self
.
mkdtemp
()
from
distutils.command
import
build_ext
build_ext
.
USER_BASE
=
site
.
USER_BASE
def
test_build_ext
(
self
):
global
ALREADY_TESTED
...
...
@@ -84,11 +83,10 @@ class BuildExtTestCase(TempdirManager,
support
.
unload
(
'xx'
)
sys
.
path
=
self
.
sys_path
[
0
]
sys
.
path
[:]
=
self
.
sys_path
[
1
]
if
sys
.
version
>
"2.6"
:
import
site
site
.
USER_BASE
=
self
.
old_user_base
from
distutils.command
import
build_ext
build_ext
.
USER_BASE
=
self
.
old_user_base
import
site
site
.
USER_BASE
=
self
.
old_user_base
from
distutils.command
import
build_ext
build_ext
.
USER_BASE
=
self
.
old_user_base
super
(
BuildExtTestCase
,
self
).
tearDown
()
def
test_solaris_enable_shared
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment