No boilerplate way to create (executable) source packages for Python modules.
$ python -m pypack appvey.py
[*] Packing appvey.py into appvey-1234.zip
[*] Making appvey-1234.zip executable
[*] Making appvey-1234.zip installable
[*] Making appvey-1234.zip uploadable to PyPI
See also:
- No packaging boilerplate
- Executable
.zipfile if module providesmain()function - Command line script entry for the
main()function requirements.txtdetected and included
1.0- Python 3 compatibility fix
Necessary package fields are read from the .py module, without imporing it:
name- extracted from the module filename__author____version____url__
Also detects and restores these optional fields:
__license__description- first line of module docstring
Python packaging still relies on setup.py, so it is created
automatically (but this may change with PEP-517 and PEP-518).
requirements.txt should use safe setuptools subset
pypa/setuptools#1080 (comment)
main() function is required to enable executable features.
-
Pack your module into .zip archive
pypack.py <module.py> -
Write changelog
-
Tag release
git tag -a git push --follow-tags -
Upload archive to PyPI
twine upload <package.zip>