Skip to content
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

License is installed to /usr #120

Closed
0x9fff00 opened this issue Nov 9, 2019 · 3 comments
Closed

License is installed to /usr #120

0x9fff00 opened this issue Nov 9, 2019 · 3 comments

Comments

@0x9fff00
Copy link

0x9fff00 commented Nov 9, 2019

Commit dadd5a4, suggested by #57, added LICENSE to data_files. It appears that this was intended to add the license to the source distribution, however it also causes it to be installed in /usr when python setup.py install is run. This is incorrect as /usr should only contain the subdirectories specified in the Filesystem Hierarchy Standard, and no files.

@viniciuschiele
Copy link
Owner

viniciuschiele commented Nov 11, 2019

Thanks for pointing this out, would you know what is the correct way to include extra files like LICENSE, CHANGELOGS in the pypi package?

@guru-florida
Copy link
Contributor

I am getting this as well. The "data_files" property is for files you want to put under the install prefix (/usr ex) like icons, desktop shortcuts, etc. For this LICENSE file and other files that should be installed in the package dir it should use "package_data" property and set the include_package_data=True flag.

Lots of related discussion here:
https://stackoverflow.com/questions/11235820/setup-py-not-installing-data-files

Example:

setup(
   name='myapp',
   packages=find_packages(),
   package_data={
      'myapp': ['data/*.txt'],
   },
   include_package_data=True,
   zip_safe=False,
   install_requires=['distribute'],
)

package_data is specifically for package releases, which I think is what we want here. More details:
https://stackoverflow.com/questions/7522250/how-to-include-package-data-with-setuptools-distutils

@viniciuschiele
Copy link
Owner

I released a new version 1.12.3, thank you all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants