Skip to content

Conversation

sage-etcher
Copy link
Member

Here we replace distutils with pkg_resources as the previous is:

  • painfully obsolete,
  • removed from python 3.12 onward,
  • panics when faced with modern pip package versioning, like 0.37.0rc1.

I opted to use pkg_resources and not packaging because it is pre-installed on the base gobo system.

The available_versions() try-except would always fail as it was calling sort() on a dict_keys object, with a cast to list we can sort it as intended.

In Alien.py we call Alien-NNN and read the results from stdout, however we read it as a byte-array and not as a string, now we decode the byte-array as a "UTF-8" string so that we can properly compare it against the returned list of versions. This may cause issues with other locales, I'm unaware of how to detect the encoding used. I'm open to suggestions.

@sage-etcher
Copy link
Member Author

This is in response to gobolinux/Recipes#278

@sage-etcher
Copy link
Member Author

sage-etcher commented Jul 29, 2025

On second thought, I dont know that locale issues are a reasonable concern at least from Alien-PIP's getinstallversion() since it queries https://pypi.org/pypi/PKGNAME/json directly for the json package data.

@nuc1eon
Copy link
Member

nuc1eon commented Jul 29, 2025

Well done and thanks! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants