Earlier quoted context omitted.
From memory, there was a whole thing where pipenv, created by Kenneth Reitz of requests fame, was misaccurately portrayed as the official successor to pip when that wasn't true
I recall this, but I wasn’t quite clear on what the issue was with pipenv itself (other than questionable behaviour from the author)
How to make a Python package in 2021
111–120 of 215 posts
Re: How to make a Python package in 2021
#112Earlier quoted context omitted.
I don't see how your version is easier than the sequence of commands in the first few steps of the article, which is basically `pip install flit; flit init; flit publish`. Flit is just as easy to install as twine, but you save yourself the hassle of having to write a setup.py.
Maybe I'm too old-fashioned then. But I like that you don't have any dependencies when using distutils/setuputils with a `setup.py` file, so if you don't distribute your code you're already done. I'm also not a fan of tools that are just wrappers around other tools.
(flit install does wrap pip, however)
Re: How to make a Python package in 2021
#113Earlier quoted context omitted.
That's a 72MB download, and yet another way to fragment the ecosystem. Not something I'd get just to make a package when a default Python setup has recommended tools and everything I need to make and/or install packages.
Default way is pip freeze which I feel is too verbose, is tracking every dependency of django worth it?
Re: How to make a Python package in 2021
#114The recommendation to set up a Makefile on top of tox is a bit odd to be honest. Tox basically "just works", and you can do things like pass stuff to `pytest` by setting up `{posargs}` in the tox config (see [0]) I 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…
Re: How to make a Python package in 2021
#115I 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
#116The 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
#117The recommendation to set up a Makefile on top of tox is a bit odd to be honest. Tox basically "just works", and you can do things like pass stuff to `pytest` by setting up `{posargs}` in the tox config (see [0]) I 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…
I’d argue the counterpoint actually: Writing Makefile targets for common commands significantly improves usability and ergonomics, especially when they follow common idioms (make test, make build, make install, ...). The recipes for each target describe not only how a project intends to run each tool, but which tools it intends to run. Instead of having to know that this project runs tests under tox, while that one r…
I generally agree with your sentiment, though. I’m usually limiting myself to Python stuff so don’t have much exposure to make, it’s always felt like a less powerful task runner than other stuff
Re: How to make a Python package in 2021
#118Earlier quoted context omitted.
It's also not ready yet, missing critical features like editable installs. Right now, you still need a shim setup.py. Until pyproject.toml can actually replace setupy.py, I see little incentive to start using it: It's just one more file to add. The one exception is if the package actually has build requirements, e.g. for Cython modules.
The only reason we use pyproject.toml is because of the stupid black formatter that refuses to support setup.cfg, which every other python tool under the sun supports.
Re: How to make a Python package in 2021
#119Earlier quoted context omitted.
I recall this, but I wasn’t quite clear on what the issue was with pipenv itself (other than questionable behaviour from the author)
It was buggy. It was slow. It didn't even try to support developing libraries.
Re: How to make a Python package in 2021
#120Earlier quoted context omitted.
I think the time has passed, both in terms of there no longer being a BDFL, as well as Python passing a point where the call can be made.
Sadly I bet you’re right on this. My small sliver of hope is that Guido van Rossum’s ideas to “make using Python better” [1] include better packaging. [1]: https://news.ycombinator.com/item?id=25071847
But with or without a BDFL, one packaging tool to rule them all is a pretty tall order. The needs of a package like scipy, which incorporates C & Fortran code, are pretty different from something like requests. And different communities using Python have their own entrenched tools and techniques. It takes more than someone saying "Foo is officially blessed" to shift that, even if everyone respects the person saying that.