diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2016-01-16 06:33:04 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-01-16 06:33:04 -0500 |
commit | 0f590c0d72709128f32c23437fe0183386c69d1c (patch) | |
tree | 485d9ef16f9f9ae960bf91637040f506a04a63ca | |
parent | ddfbfa731e2cf73dc03b5a3345996afac843441e (diff) | |
download | external_python_setuptools-0f590c0d72709128f32c23437fe0183386c69d1c.tar.gz external_python_setuptools-0f590c0d72709128f32c23437fe0183386c69d1c.tar.bz2 external_python_setuptools-0f590c0d72709128f32c23437fe0183386c69d1c.zip |
Prefer relpath to string slicing for computing a path relative to a base. Fixes #341.
-rw-r--r-- | CHANGES.txt | 6 | ||||
-rw-r--r-- | setuptools/command/build_py.py | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index e8106c40..c8a9f8ab 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,12 @@ CHANGES ======= +19.3.1 +------ + +* Issue #341: Correct error in path handling of package data + files in ``build_py`` command when package is empty. + ---- 19.3 ---- diff --git a/setuptools/command/build_py.py b/setuptools/command/build_py.py index 5021bd1f..0c1026aa 100644 --- a/setuptools/command/build_py.py +++ b/setuptools/command/build_py.py @@ -84,12 +84,10 @@ class build_py(orig.build_py, Mixin2to3): # Compute package build directory build_dir = os.path.join(*([self.build_lib] + package.split('.'))) - # Length of path to strip from found files - plen = len(src_dir) + 1 - # Strip directory from globbed filenames filenames = [ - file[plen:] for file in self.find_data_files(package, src_dir) + os.path.relpath(file, src_dir) + for file in self.find_data_files(package, src_dir) ] return package, src_dir, build_dir, filenames |