-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Accidentally passing package_data a str value triggers error on Windows but not Linux #1459
Comments
As @agitter discovered, the issue was with the forward-slash path separator. In other words,
In the case, of a cross-platform So I guess this issue could be updated to be "package_data does not accept forward-slash separated paths on Windows". I'm not sure whether this is intentional or a bug. |
Indeed, I would be happy to know how to resolve/work around this issue. |
This is very puzzling, but it does not sound like deliberate behavior. Possibly an over-zealous regex somewhere? |
I recently met with this problem as well where a module wasn't installing, and i had to download the module to manually install it. As a stopgap measure to change the absolute paths being defined, what i did was to alter the _manifest_normalize function in egg_info.py to null replace all paths to produce the relative paths instead, and assign that to self.filelist.files. On the other hand this might not be a good thing if self.filelist.files is not be altered. It appears that, at least in my case, while .egg-info/SOURCES.txt is written, unfortunately setuptools relies on the in memory set of files to carry on with the setup instead of rereading the .egg-info/SOURCES.txt. |
@aschmied looks like passing a list as a value rather than a raw string fixed the issue on Windows: see manubot/manubot#111.
setuptools/setuptools/command/build_py.py Lines 220 to 235 in a94ccbf
Therefore, what I think was happening is that each character of But now I'm confused as to why Linux works. In fact, it seems that Linux may include the package data file regardless of whether For |
Looks like the validation of the Lines 307 to 322 in 3adda96
|
package_data and exclude_package_data expect to receive a dictionary whose values are lists rather than strings. Previousely, passing a str value did not cause any warning or error, which is dangerous because users accidentally input a glob/path that then gets iterated into individual characters. Refs pypa#1459
Merges #111 Refs pypa/setuptools#1459 Follows up on #51 * Use setup.py package_data rather than MANIFEST.in Hat tip: Anthony Schmieder https://setuptools.readthedocs.io/en/latest/setuptools.html#including-data-files * Fix manubot.cite.tests.test_web_query failure https://bigthink.com/neurobonkers/a-pirate-bay-for-science Title on website has changed to "Meet the Robin Hood of Science, Alexandra Elbakyan"
Due to the following fix, package_data's dict must to be list. pypa/setuptools@8f848bd pypa/setuptools#1459
This is an old error, but was there any solution suggested eventually? Having the same issue on Mac apparently. |
As part of manubot/manubot#51, I specified the
package_data
argument ofsetuptools.setup()
in oursetup.py
:The Linux Travis CI build passes, but the Windows AppVeyer builds error when attempting
pip install .
. Here is the error:In summary, this line in
distutils.util.convert_path
is throwing the following error:So at some point, it seems that the package_data relative path is converted to absolute triggering this error. Any advice on how to resolve this issue would be greatly appreciated! This is occurring with pip-18.0 in Python 3.6 & 3.7.
The text was updated successfully, but these errors were encountered: