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
c5cbf5fd
Commit
c5cbf5fd
authored
Feb 09, 2014
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Normalize indentation and remove unused imports
parent
0eacd77e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
42 deletions
+33
-42
setuptools/command/build_ext.py
setuptools/command/build_ext.py
+33
-42
No files found.
setuptools/command/build_ext.py
View file @
c5cbf5fd
...
@@ -5,7 +5,8 @@ try:
...
@@ -5,7 +5,8 @@ try:
except
ImportError
:
except
ImportError
:
_build_ext
=
_du_build_ext
_build_ext
=
_du_build_ext
import
os
,
sys
import
os
import
sys
from
distutils.file_util
import
copy_file
from
distutils.file_util
import
copy_file
from
setuptools.extension
import
Library
from
setuptools.extension
import
Library
from
distutils.ccompiler
import
new_compiler
from
distutils.ccompiler
import
new_compiler
...
@@ -41,10 +42,6 @@ def if_dl(s):
...
@@ -41,10 +42,6 @@ def if_dl(s):
return
''
return
''
class
build_ext
(
_build_ext
):
class
build_ext
(
_build_ext
):
def
run
(
self
):
def
run
(
self
):
"""Build extensions in build directory, then copy if --inplace"""
"""Build extensions in build directory, then copy if --inplace"""
...
@@ -75,7 +72,6 @@ class build_ext(_build_ext):
...
@@ -75,7 +72,6 @@ class build_ext(_build_ext):
if
ext
.
_needs_stub
:
if
ext
.
_needs_stub
:
self
.
write_stub
(
package_dir
or
os
.
curdir
,
ext
,
True
)
self
.
write_stub
(
package_dir
or
os
.
curdir
,
ext
,
True
)
if
_build_ext
is
not
_du_build_ext
and
not
hasattr
(
_build_ext
,
'pyrex_sources'
):
if
_build_ext
is
not
_du_build_ext
and
not
hasattr
(
_build_ext
,
'pyrex_sources'
):
# Workaround for problems using some Pyrex versions w/SWIG and/or 2.4
# Workaround for problems using some Pyrex versions w/SWIG and/or 2.4
def
swig_sources
(
self
,
sources
,
*
otherargs
):
def
swig_sources
(
self
,
sources
,
*
otherargs
):
...
@@ -84,8 +80,6 @@ class build_ext(_build_ext):
...
@@ -84,8 +80,6 @@ class build_ext(_build_ext):
# Then do any actual SWIG stuff on the remainder
# Then do any actual SWIG stuff on the remainder
return
_du_build_ext
.
swig_sources
(
self
,
sources
,
*
otherargs
)
return
_du_build_ext
.
swig_sources
(
self
,
sources
,
*
otherargs
)
def
get_ext_filename
(
self
,
fullname
):
def
get_ext_filename
(
self
,
fullname
):
filename
=
_build_ext
.
get_ext_filename
(
self
,
fullname
)
filename
=
_build_ext
.
get_ext_filename
(
self
,
fullname
)
if
fullname
in
self
.
ext_map
:
if
fullname
in
self
.
ext_map
:
...
@@ -109,7 +103,7 @@ class build_ext(_build_ext):
...
@@ -109,7 +103,7 @@ class build_ext(_build_ext):
self
.
extensions
=
self
.
extensions
or
[]
self
.
extensions
=
self
.
extensions
or
[]
self
.
check_extensions_list
(
self
.
extensions
)
self
.
check_extensions_list
(
self
.
extensions
)
self
.
shlibs
=
[
ext
for
ext
in
self
.
extensions
self
.
shlibs
=
[
ext
for
ext
in
self
.
extensions
if
isinstance
(
ext
,
Library
)]
if
isinstance
(
ext
,
Library
)]
if
self
.
shlibs
:
if
self
.
shlibs
:
self
.
setup_shlib_compiler
()
self
.
setup_shlib_compiler
()
for
ext
in
self
.
extensions
:
for
ext
in
self
.
extensions
:
...
@@ -171,8 +165,6 @@ class build_ext(_build_ext):
...
@@ -171,8 +165,6 @@ class build_ext(_build_ext):
# hack so distutils' build_extension() builds a library instead
# hack so distutils' build_extension() builds a library instead
compiler
.
link_shared_object
=
link_shared_object
.
__get__
(
compiler
)
compiler
.
link_shared_object
=
link_shared_object
.
__get__
(
compiler
)
def
get_export_symbols
(
self
,
ext
):
def
get_export_symbols
(
self
,
ext
):
if
isinstance
(
ext
,
Library
):
if
isinstance
(
ext
,
Library
):
return
ext
.
export_symbols
return
ext
.
export_symbols
...
@@ -221,7 +213,8 @@ class build_ext(_build_ext):
...
@@ -221,7 +213,8 @@ class build_ext(_build_ext):
raise
DistutilsError
(
stub_file
+
" already exists! Please delete."
)
raise
DistutilsError
(
stub_file
+
" already exists! Please delete."
)
if
not
self
.
dry_run
:
if
not
self
.
dry_run
:
f
=
open
(
stub_file
,
'w'
)
f
=
open
(
stub_file
,
'w'
)
f
.
write
(
'
\
n
'
.
join
([
f
.
write
(
'
\
n
'
.
join
([
"def __bootstrap__():"
,
"def __bootstrap__():"
,
" global __bootstrap__, __file__, __loader__"
,
" global __bootstrap__, __file__, __loader__"
,
" import sys, os, pkg_resources, imp"
+
if_dl
(
", dl"
),
" import sys, os, pkg_resources, imp"
+
if_dl
(
", dl"
),
...
@@ -241,7 +234,8 @@ class build_ext(_build_ext):
...
@@ -241,7 +234,8 @@ class build_ext(_build_ext):
" os.chdir(old_dir)"
,
" os.chdir(old_dir)"
,
"__bootstrap__()"
,
"__bootstrap__()"
,
""
# terminal \n
""
# terminal \n
]))
])
)
f
.
close
()
f
.
close
()
if
compile
:
if
compile
:
from
distutils.util
import
byte_compile
from
distutils.util
import
byte_compile
...
@@ -261,8 +255,8 @@ if use_stubs or os.name=='nt':
...
@@ -261,8 +255,8 @@ if use_stubs or os.name=='nt':
def
link_shared_object
(
self
,
objects
,
output_libname
,
output_dir
=
None
,
def
link_shared_object
(
self
,
objects
,
output_libname
,
output_dir
=
None
,
libraries
=
None
,
library_dirs
=
None
,
runtime_library_dirs
=
None
,
libraries
=
None
,
library_dirs
=
None
,
runtime_library_dirs
=
None
,
export_symbols
=
None
,
debug
=
0
,
extra_preargs
=
None
,
export_symbols
=
None
,
debug
=
0
,
extra_preargs
=
None
,
extra_postargs
=
None
,
build_temp
=
None
,
target_lang
=
None
extra_postargs
=
None
,
build_temp
=
None
,
target_lang
=
None
):
):
self
.
link
(
self
.
link
(
self
.
SHARED_LIBRARY
,
objects
,
output_libname
,
self
.
SHARED_LIBRARY
,
objects
,
output_libname
,
output_dir
,
libraries
,
library_dirs
,
runtime_library_dirs
,
output_dir
,
libraries
,
library_dirs
,
runtime_library_dirs
,
export_symbols
,
debug
,
extra_preargs
,
extra_postargs
,
export_symbols
,
debug
,
extra_preargs
,
extra_postargs
,
...
@@ -275,8 +269,7 @@ else:
...
@@ -275,8 +269,7 @@ else:
def
link_shared_object
(
self
,
objects
,
output_libname
,
output_dir
=
None
,
def
link_shared_object
(
self
,
objects
,
output_libname
,
output_dir
=
None
,
libraries
=
None
,
library_dirs
=
None
,
runtime_library_dirs
=
None
,
libraries
=
None
,
library_dirs
=
None
,
runtime_library_dirs
=
None
,
export_symbols
=
None
,
debug
=
0
,
extra_preargs
=
None
,
export_symbols
=
None
,
debug
=
0
,
extra_preargs
=
None
,
extra_postargs
=
None
,
build_temp
=
None
,
target_lang
=
None
extra_postargs
=
None
,
build_temp
=
None
,
target_lang
=
None
):
):
# XXX we need to either disallow these attrs on Library instances,
# XXX we need to either disallow these attrs on Library instances,
# or warn/abort here if set, or something...
# or warn/abort here if set, or something...
#libraries=None, library_dirs=None, runtime_library_dirs=None,
#libraries=None, library_dirs=None, runtime_library_dirs=None,
...
@@ -294,5 +287,3 @@ else:
...
@@ -294,5 +287,3 @@ else:
self
.
create_static_lib
(
self
.
create_static_lib
(
objects
,
basename
,
output_dir
,
debug
,
target_lang
objects
,
basename
,
output_dir
,
debug
,
target_lang
)
)
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