by ThePhysicist · 5y ago · 0 comments
- Write a simple setup.py file.
- Generate a source or binary release by e.g. running "python setup.py sdist"
- You're done!
Adding a setup.py file is already enough to make your library pip-installable, so you could argue that this is a package already. The files generated by "setup.py" can also be pip-imported, so they are also packages. Now you might want to upload your package to a repository, for which there are different tools available. The simplest one being twine. Again, you just install it and run "twine upload -r dist/*" and your packages get uploaded to PyPi (it will ask for a username and password). So why complicate things?
(flit install does wrap pip, however)
If you've never run into setuptools compatibility problems, you've either been much luckier than me, or you haven't done much with Python packages.
Vanilla ubuntu used to come with a version of setuptools which didn't work for installing many recent packages.