How to make a Python package in 2021
antonz.org
How to make a Python package in 2021
1–10 of 215 posts
Re: How to make a Python package in 2021
#2https://github.com/takluyver/flit/graphs/contributors
With a title like this, I'd be expecting to see an article describing the latest tools and recommendations from the PyPA, which are here:
https://packaging.python.org/tutorials/packaging-projects/
(In short, it's setup.cfg + pyproject.toml, `python3 -m build` to build, twine to upload.)
Re: How to make a Python package in 2021
#3Re: How to make a Python package in 2021
#4I hadn't heard of flit, it does seem like it's not brand new on the scene, however it is primarily a single author, so expect a tool which is opinionated and for which the opinions may not necessarily reflect a broad consensus: https://github.com/takluyver/flit/graphs/contributors With a title like this, I'd be expecting to see an article describing the latest tools and recommendations from the PyPA, which are here:…
Re: How to make a Python package in 2021
#5Just use Poetry [1]. It's popular and works well. [1] https://python-poetry.org/
Re: How to make a Python package in 2021
#6I do feel like tox gets a bad rap despite having a complete feature set. I think a part of it is that the documentation is complete but not organized in the "Tox user"'s perspective, so for someone who shows up on a project using it, it's hard to figure out the quickstart( though the "general tips and tricks" page gets somewhere [1])
Anyways yeah, would not recommend Make over just leaning into tox more here.
EDIT: also, this article reminded me of how much I really dislike Github Action's configuration syntax. Just balls of mud on top of the Docker "ball of mud" strategy. I will re-iterate my belief that a CI system where the configuration system isn't declarative but just like..... procedural Lua will be a billion dollar business. CI is about running commands one after another! If you want declarative DAGs use Bazel
[0]: https://tox.readthedocs.io/en/latest/example/pytest.html?hig... [1]: https://tox.readthedocs.io/en/latest/example/general.html
Re: How to make a Python package in 2021
#7Just use Poetry [1]. It's popular and works well. [1] https://python-poetry.org/
I just published a repo today[0] using Poetry and it didn’t take me more than 5 minutes. Poetry build && poetry publish
Re: How to make a Python package in 2021
#8Are you writing a simple library? Create a setup.py. Copy paste an existing setup.py and modify it to suit your purposes. Now you have a working, pip installable python package.
Want to publish to PyPI? Use twine. It's standard and it's simple.
You don't need complicated tooling for simple projects.
Re: How to make a Python package in 2021
#9The number of extra tools used in this article boggles my mind. Are you writing a simple library? Create a setup.py. Copy paste an existing setup.py and modify it to suit your purposes. Now you have a working, pip installable python package. Want to publish to PyPI? Use twine. It's standard and it's simple. You don't need complicated tooling for simple projects.
Re: How to make a Python package in 2021
#10I hadn't heard of flit, it does seem like it's not brand new on the scene, however it is primarily a single author, so expect a tool which is opinionated and for which the opinions may not necessarily reflect a broad consensus: https://github.com/takluyver/flit/graphs/contributors With a title like this, I'd be expecting to see an article describing the latest tools and recommendations from the PyPA, which are here:…
Though `python -m build` only works _if_ you use something like flit or setup.py in the backend to do build the package and hence why you can set flit as a build-backend.
So yes, flit is one of the latest tool, and yes it is one of the things that push for the ability to use pyproject.toml+python3 -m build, you just seem to miss some subtleties of the toolchain.