Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
81bcf5c2
Commit
81bcf5c2
authored
Aug 23, 2011
by
Éric Araujo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to fix packaging tests using build_ext on Windows (#12678)
parent
961b5324
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
19 deletions
+18
-19
Lib/packaging/tests/support.py
Lib/packaging/tests/support.py
+18
-11
Lib/packaging/tests/test_command_build_ext.py
Lib/packaging/tests/test_command_build_ext.py
+0
-8
No files found.
Lib/packaging/tests/support.py
View file @
81bcf5c2
...
...
@@ -306,23 +306,29 @@ def _get_xxmodule_path():
def
fixup_build_ext
(
cmd
):
"""Function needed to make build_ext tests pass
on shared builds
.
"""Function needed to make build_ext tests pass.
When Python was build with --enable-shared, -L. is not good enough to find
the libpython<blah>.so. This is because regrtest runs it under a tempdir,
not in the top level where the .so lives. By the time we've gotten here,
Python's already been chdir'd to the tempdir. This function work arounds
that. Example use:
When Python was build with --enable-shared on Unix, -L. is not good
enough to find the libpython<blah>.so. This is because regrtest runs
it under a tempdir, not in the top level where the .so lives. By the
time we've gotten here, Python's already been chdir'd to the tempdir.
When Python was built with in debug mode on Windows, build_ext commands
need their debug attribute set, and it is not done automatically for
some reason.
This function handles both of these things. Example use:
cmd = build_ext(dist)
support.fixup_build_ext(cmd)
cmd.ensure_finalized()
"""
# To further add to the fun, we can't just add library_dirs to the
# Extension() instance because that doesn't get plumbed through to the
# final compiler command.
if
(
sysconfig
.
get_config_var
(
'Py_ENABLE_SHARED'
)
and
not
sys
.
platform
.
startswith
(
'win'
)):
if
os
.
name
==
"nt"
:
cmd
.
debug
=
sys
.
executable
.
endswith
(
"_d.exe"
)
elif
sysconfig
.
get_config_var
(
'Py_ENABLE_SHARED'
):
# To further add to the shared builds fun on Unix, we can't just add
# library_dirs to the Extension() instance because that doesn't get
# plumbed through to the final compiler command.
runshared
=
sysconfig
.
get_config_var
(
'RUNSHARED'
)
if
runshared
is
None
:
cmd
.
library_dirs
=
[
'.'
]
...
...
@@ -330,6 +336,7 @@ def fixup_build_ext(cmd):
name
,
equals
,
value
=
runshared
.
partition
(
'='
)
cmd
.
library_dirs
=
value
.
split
(
os
.
pathsep
)
try
:
from
test.support
import
skip_unless_symlink
except
ImportError
:
...
...
Lib/packaging/tests/test_command_build_ext.py
View file @
81bcf5c2
...
...
@@ -40,11 +40,6 @@ class BuildExtTestCase(support.TempdirManager,
dist
.
package_dir
=
self
.
tmp_dir
cmd
=
build_ext
(
dist
)
support
.
fixup_build_ext
(
cmd
)
if
os
.
name
==
"nt"
:
# On Windows, we must build a debug version iff running
# a debug build of Python
cmd
.
debug
=
sys
.
executable
.
endswith
(
"_d.exe"
)
cmd
.
build_lib
=
self
.
tmp_dir
cmd
.
build_temp
=
self
.
tmp_dir
...
...
@@ -236,9 +231,6 @@ class BuildExtTestCase(support.TempdirManager,
cmd
.
ensure_finalized
()
self
.
assertEqual
(
len
(
cmd
.
get_outputs
()),
1
)
if
os
.
name
==
"nt"
:
cmd
.
debug
=
sys
.
executable
.
endswith
(
"_d.exe"
)
cmd
.
build_lib
=
os
.
path
.
join
(
self
.
tmp_dir
,
'build'
)
cmd
.
build_temp
=
os
.
path
.
join
(
self
.
tmp_dir
,
'tempt'
)
...
...
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