Formally deprecate distro.linux_distribution()#296
Formally deprecate distro.linux_distribution()#296jdufresne merged 1 commit intopython-distro:masterfrom jdufresne:emit-warning
Conversation
|
There is a typo : s/compatability/compatibility/. |
Users should use distro.id(), distro.version(), and distro.name() instead. Refs #263
|
Thanks for the reviews. I addressed all feedback in the latest revision. |
sethmlarson
left a comment
There was a problem hiding this comment.
LGTM, pinging @nir0s as this is a big manifesto change. After this should we remove mentions to distro.linux_distribution() in the README, repository description, etc
|
Agreeing with @sethmlarson here. From my PoV this project (first) intended to be a drop-in replacement for the |
|
I'll hold off on merging until @nir0s has a chance to weigh in. |
|
Guys, I appreciate you holding off, but let's not make a habit out of it. If you feel like there's a huge change, and you want me to pitch in, I'll try. However, if you think that it makes sense to do something, and I'm unresponsive, go ahead and do it. Anyway, to address the comments:
Indeed we should.
It's only my opinion, but I see no reason why there's a need for a single function that returns a tuple with an unclear structure. What's the first part? Is it the full name? The same questions apply to the codename and the version. Given that explicit is better than implicit, I'd rather do something like: if distro.id() == "..." and distro.name() == "...":
...which also allows me to pass fields explicitly to the relevant function (e.g. Instead of: distro_info = distro.linux_distribution()
if distro_info[0] == "you get the point":
...I indeed think that the official Python documentation should be updated, and I don't mind deprecating this until distro v2.0 comes out, if only to give people a shitload of time to stop using it. Honestly, I'm not strongly opinionated about this. However, even if we do decide to keep it, we can push to update the official Python docs to encourage people to use Thoughts? |
|
Thanks.
This makes sense. The warning is a good start and there is no rush to remove or anything like that. |
|
@python-distro/maintainers Dear maintainers, I guess we should update the GitHub repository description now that this deprecation has been released. Any idea ? What about : - A much more elaborate, renewed alternative implementation for Python's platform.linux_distribution()
+ A much more elaborate replacement for removed Python's `platform.linux_distribution()` methodThanks 🙏 EDIT 2021-07-31 :
|
`distro.linux_distribution` was deprecated (python-distro/distro#296) in the release of `distro` at the end of last week. The deprecation is causing the `nopin` nightly tests to fail. This change migrates Certbot off that function. As far as I can tell, the Arch Linux edge case described in the code comments no longer happens, but better to be safe than sorry I think. * stop using deprecated distro.linux_distribution * update comment Co-authored-by: Brad Warren <bmw@users.noreply.github.com> Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
Users should use distro.id(), distro.version(), and distro.name()
instead.
Refs #263