New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bdist gives cant copy error for package_data file which exists #341

Closed
bb-migration opened this Issue Jan 30, 2015 · 3 comments

Comments

Projects
None yet
1 participant
@bb-migration

bb-migration commented Jan 30, 2015

Originally reported by: rogermarsh (Bitbucket: rogermarsh, GitHub: Unknown)


python setup.py bdist gives:

error: can't copy 'icence.txt': doesn't exist or not a regular file

where current directory is swiggedapi and licence.txt exists in this directory.

The package related arguments to setup() are:

    package_dir={'swiggedapi':''},
    packages=['swiggedapi'],
    package_data={'': ['licence.txt', '_swigged.pyd']},

@bb-migration

This comment has been minimized.

bb-migration commented Feb 1, 2015

Original comment by rogermarsh (Bitbucket: rogermarsh, GitHub: Unknown):


Sample project attached

@bb-migration

This comment has been minimized.

bb-migration commented Jan 16, 2016

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Prefer relpath to string slicing for computing a path relative to a base. Fixes #341.

@bb-migration

This comment has been minimized.

bb-migration commented Jan 16, 2016

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Although I have included a patch to avoid the off-by-one error (truncation of the first character of the filenames), the issue was encountered by the empty string in the key of package_data. According to the docs, "the value must be a mapping from package name to a list of relative path names that should be copied into the package." I suspect that the empty string isn't a valid package name.

luanthe added a commit to probcomp/Venturecxx that referenced this issue Jul 22, 2016

Remove trailing slashes from package_dir paths.
This causes issues with setuptools <= 19.3, which uses a buggy method to
get the relative paths of files [1]. The symptom is that when adding a
.vnt file in one of these directories, setup.py accidentally cuts off
the first character of the filename, then complains that it doesn't
exist. For example:

$ SKIP_PUMA_BACKEND=1 python setup.py build
running build
running build_py
error: can't copy 'backend/mite/relude.vnt': doesn't exist or not a regular file

[1]: pypa/setuptools#341
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment