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
ae2382ce
Commit
ae2382ce
authored
Jun 29, 2009
by
Tarek Ziadé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed 6365: wrong inplace location for build_ext if the extension had dots
parent
b7c54cd2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
command/build_ext.py
command/build_ext.py
+4
-4
tests/test_build_ext.py
tests/test_build_ext.py
+15
-3
No files found.
command/build_ext.py
View file @
ae2382ce
...
...
@@ -643,16 +643,16 @@ class build_ext (Command):
(inplace option).
"""
fullname
=
self
.
get_ext_fullname
(
ext_name
)
filename
=
self
.
get_ext_filename
(
fullname
)
modpath
=
fullname
.
split
(
'.'
)
package
=
'.'
.
join
(
modpath
[
0
:
-
1
])
base
=
modpath
[
-
1
]
filename
=
self
.
get_ext_filename
(
base
)
if
not
self
.
inplace
:
# no further work needed
return
os
.
path
.
join
(
self
.
build_lib
,
filename
)
# the inplace option requires to find the package directory
# using the build_py command
modpath
=
fullname
.
split
(
'.'
)
package
=
'.'
.
join
(
modpath
[
0
:
-
1
])
base
=
modpath
[
-
1
]
build_py
=
self
.
get_finalized_command
(
'build_py'
)
package_dir
=
os
.
path
.
abspath
(
build_py
.
get_package_dir
(
package
))
return
os
.
path
.
join
(
package_dir
,
filename
)
...
...
tests/test_build_ext.py
View file @
ae2382ce
...
...
@@ -339,10 +339,9 @@ class BuildExtTestCase(support.TempdirManager,
# inplace = 0, cmd.package = 'bar'
cmd
.
package
=
'bar'
path
=
cmd
.
get_ext_fullpath
(
'foo'
)
# checking that the last directory is
ba
r
# checking that the last directory is
the build_di
r
path
=
os
.
path
.
split
(
path
)[
0
]
lastdir
=
os
.
path
.
split
(
path
)[
-
1
]
self
.
assertEquals
(
lastdir
,
cmd
.
package
)
self
.
assertEquals
(
path
,
cmd
.
build_lib
)
# inplace = 1, cmd.package = 'bar'
cmd
.
inplace
=
1
...
...
@@ -358,6 +357,19 @@ class BuildExtTestCase(support.TempdirManager,
lastdir
=
os
.
path
.
split
(
path
)[
-
1
]
self
.
assertEquals
(
lastdir
,
cmd
.
package
)
def
test_build_ext_inplace
(
self
):
etree_c
=
os
.
path
.
join
(
self
.
tmp_dir
,
'lxml.etree.c'
)
etree_ext
=
Extension
(
'lxml.etree'
,
[
etree_c
])
dist
=
Distribution
({
'name'
:
'lxml'
,
'ext_modules'
:
[
etree_ext
]})
cmd
=
build_ext
(
dist
)
cmd
.
inplace
=
1
cmd
.
distribution
.
package_dir
=
{
''
:
'src'
}
cmd
.
distribution
.
packages
=
[
'lxml'
,
'lxml.html'
]
curdir
=
os
.
getcwd
()
wanted
=
os
.
path
.
join
(
curdir
,
'src'
,
'lxml'
,
'etree.so'
)
path
=
cmd
.
get_ext_fullpath
(
'lxml.etree'
)
self
.
assertEquals
(
wanted
,
path
)
def
test_suite
():
src
=
_get_source_filename
()
if
not
os
.
path
.
exists
(
src
):
...
...
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