News for hackers. Stuff that matters.
Re:How to make a Python package in 2021 by darthrupert on Thursday April 08, 2021 @01:52AM (#26735506)
I actually think one should do the exact opposite to what you're suggesting. I've experienced modern package management through Cargo and anything below that level now seems like returning to stone age.

In the python ecosystem, poorly defined packages is a wide problem. You never know what you get in the next version upgrade.

So my suggestion: burn all the "simple" python packaging tools in a big fire and move eveything to Poetry today. It will be painful at start but will increase the quality of the ecosystem by a huge margin if just 50% of the projects do this.

Re:How to make a Python package in 2021 by hardwaresofton on Thursday April 08, 2021 @03:52AM (#26736161)
Bit of a side note but remember cargo learned a lot from generations of package managers, across languages. It essentially represents some of the best that package managers have to offer. You only get that kind of result by starting from scratch every few years (as in, rust started from scratch when the Node/NPM ecosystem had been around for years to steal ideas from, Haskell had been around for years to steal language design from, etc.).

Rust is incredibly lucky to have been created when it was because it benefits immensely from these things (I think it's the best new-to-middle-aged production-usable systems language out there today).

I agree with the idea but languages like Python and their ecosystems are really hard to move (remember python 2->3? is that even over?) -- it's a herculean and often impossible task.

Re:How to make a Python package in 2021 by lmm on Thursday April 08, 2021 @06:44AM (#26737202)
Cargo is not hugely different from Maven which has been working fine for over a decade. Yes, it takes some polished ideas from other systems, but Python has had more packaging tools come and go than several other ecosystems put together.
Re:How to make a Python package in 2021 by oblio on Thursday April 08, 2021 @07:19AM (#26737407)
+1 from Maven. And Maven was launched in 2004, 17 (!) years ago. It's almost old enough to vote.

A lot of ecosystems put on some solid horse blinders in order to avoid Java at all costs (Javascript/Node/NPM being another example). They've avoided good ideas from Java for more than a decade.

Re:How to make a Python package in 2021 by afarrell on Thursday April 08, 2021 @04:45AM (#26736499)
Migrating python2 -> python3 is hard because it requires rewriting code and because you can't really run python3 code if you depend upon python2.

If poetry create consume non-poetry packages and create packages which other package management systems can consume? If so, then:

1. Projects can move more effectively independently.

2. Projects can re-package as a single task rather than a massive rewrite effort.

Re:How to make a Python package in 2021 by say_it_as_it_is on Thursday April 08, 2021 @06:03AM (#26736977)
I was hoping to see this blog post highlight poetry usage. Any good resource for this? I've already seen the official page.
Re:How to make a Python package in 2021 by raphar on Thursday April 08, 2021 @03:08PM (#26742508)
I learned with this article. And it teaches how to combine Poetry with Pyenv effectively.

https://blog.jayway.com/2019/12/28/pyenv-poetry-saviours-in-...

Re:How to make a Python package in 2021 by alexgmcm on Thursday April 08, 2021 @10:55AM (#26739511)
I quite liked the series of blog posts called Hypermodern Python: https://cjolowicz.github.io/posts/hypermodern-python-01-setu...
Re:How to make a Python package in 2021 by schnitzelstoat on Thursday April 08, 2021 @10:54AM (#26739489)
Like the other commenter, I was also expecting them to use Poetry.

It's the best one I've tried so far.

Re:How to make a Python package in 2021 by avhception on Thursday April 08, 2021 @11:53AM (#26740295)
Came here to about how it would be better to use poetry, thanks for spelling it out for me.