Fixed #6403 : package path usage for build_ext

This commit is contained in:
Tarek Ziadé 2009-07-03 08:22:56 +00:00
parent 50a2252851
commit 65ec61ed06
3 changed files with 43 additions and 10 deletions

View file

@ -644,17 +644,23 @@ class build_ext (Command):
"""
fullname = self.get_ext_fullname(ext_name)
modpath = fullname.split('.')
package = '.'.join(modpath[0:-1])
base = modpath[-1]
filename = self.get_ext_filename(base)
filename = self.get_ext_filename(modpath[-1])
if not self.inplace:
# no further work needed
# returning :
# build_dir/package/path/filename
filename = os.path.join(*modpath[:-1]+[filename])
return os.path.join(self.build_lib, filename)
# the inplace option requires to find the package directory
# using the build_py command
# using the build_py command for that
package = '.'.join(modpath[0:-1])
build_py = self.get_finalized_command('build_py')
package_dir = os.path.abspath(build_py.get_package_dir(package))
# returning
# package_dir/filename
return os.path.join(package_dir, filename)
def get_ext_fullname(self, ext_name):