PyPIで配布するための圧縮ファイルなどを作成する。
情報源
手順
python setup.py sdist
dist
{package_name}-{version}.tar.gz
{package_name}.egg-info
以下ログ。
$ python setup.py sdist running sdist running egg_info creating mypack.egg-info writing mypack.egg-info/PKG-INFO writing top-level names to mypack.egg-info/top_level.txt writing dependency_links to mypack.egg-info/dependency_links.txt writing manifest file 'mypack.egg-info/SOURCES.txt' reading manifest file 'mypack.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files found matching '.gitignore' warning: no previously-included files found matching 'release.sh' writing manifest file 'mypack.egg-info/SOURCES.txt' running check creating mypack-0.0.2 creating mypack-0.0.2/mypack creating mypack-0.0.2/mypack.egg-info creating mypack-0.0.2/tests copying files to mypack-0.0.2... copying CHANGES.md -> mypack-0.0.2 copying LICENSE.txt -> mypack-0.0.2 copying MANIFEST.in -> mypack-0.0.2 copying README.ja.md -> mypack-0.0.2 copying README.md -> mypack-0.0.2 copying setup.py -> mypack-0.0.2 copying tests.sh -> mypack-0.0.2 copying mypack/__init__.py -> mypack-0.0.2/mypack copying mypack/mypack.py -> mypack-0.0.2/mypack copying mypack.egg-info/PKG-INFO -> mypack-0.0.2/mypack.egg-info copying mypack.egg-info/SOURCES.txt -> mypack-0.0.2/mypack.egg-info copying mypack.egg-info/dependency_links.txt -> mypack-0.0.2/mypack.egg-info copying mypack.egg-info/top_level.txt -> mypack-0.0.2/mypack.egg-info copying tests/__init__.py -> mypack-0.0.2/tests copying tests/example.py -> mypack-0.0.2/tests copying tests/tests_mypack.py -> mypack-0.0.2/tests Writing mypack-0.0.2/setup.cfg creating dist Creating tar archive removing 'mypack-0.0.2' (and everything under it)
所感
以下のようにPython3でやったらどうなるの? Py2とPy3のコードに互換性がないとき、別名でアップせねばならないの?
python3 setup.py sdist
対象環境
- Raspbierry pi 4 Model B
- Raspbian buster 10.0 2019-09-26 ※
- bash 5.0.3(1)-release
$ uname -a Linux raspberrypi 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux