https://github.com/cirosantilli/python-sample-package-with-data
How to distribute a Python package with data: https://stackoverflow.com/questions/3596979/manifest-in-ignored-on-python-setup-py-install-no-data-files-installed/60735402#60735402
https://github.com/cirosantilli/python-sample-package-with-data
Last synced: 7 days ago
JSON representation
How to distribute a Python package with data: https://stackoverflow.com/questions/3596979/manifest-in-ignored-on-python-setup-py-install-no-data-files-installed/60735402#60735402
- Host: GitHub
- URL: https://github.com/cirosantilli/python-sample-package-with-data
- Owner: cirosantilli
- Created: 2020-03-18T07:45:11.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-28T08:05:41.000Z (over 4 years ago)
- Last Synced: 2025-05-07T09:04:34.779Z (7 days ago)
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 12
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python sample package with data
How to distribute a Python package with data.
https://stackoverflow.com/questions/3596979/manifest-in-ignored-on-python-setup-py-install-no-data-files-installed/60735402#60735402
Tested on Ubuntu 19.10, Python 3.7.5, wheel==0.32.3, setuptools==41.1.0, twine==3.1.1.
How end users use the package from :
```
python3 -m pip install --user python-sample-package-with-data
python-sample-package-with-data
```Expected output:
```
hello data
```which are the contents of our test data file [python_sample_package_with_data/mydata.txt](python_sample_package_with_data/mydata.txt) that was distributed with `pip`.
How maintainers publish it:
```
# One time setup.
python3 -m pip install --user setuptools wheel twine# Every time you want to publish.
python setup.py sdist bdist_wheel
twine upload dist/*
rm -rf build dist *.egg-info
```Bibliography:
- https://stackoverflow.com/questions/47577762/how-do-i-distribute-my-pip-package-with-data-files-correctly
- https://stackoverflow.com/questions/47817944/python-pkg-resources-and-file-access-in-packages
- https://stackoverflow.com/questions/39104/finding-a-file-in-a-python-module-distribution
- https://stackoverflow.com/questions/14211575/any-python-function-to-get-data-files-root-directory
- https://stackoverflow.com/questions/14422340/manifest-in-package-data-and-data-files-clarification
- https://stackoverflow.com/questions/11235820/setup-py-not-installing-data-files