Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stopped using pkg_resources, as it's deprecated. #432

Merged
merged 3 commits into from
Jun 11, 2024

Conversation

facundobatista
Copy link
Member

The replacement is the packaging module, but it's not exactly the same. It provides a Requirement object but it's different from the previous one, and there's no Dependency so to match versions we need to play with Requirement.specifiers.

The VCSDependency object we had grew in complexity, as it needs a new VCSSpecifier to mimic the new Requirement. Similarly, I added a NameVerDependency to be able to compare objects with name and version.

While working on this I found that in check_pypi_updates we were comparing versions as strings ("2.3" is greater than "1.3", but it is smaller than "10.2"... and if you compare the strings that is broken). I added a test for this and fixed it by using packaging.Version which compare as they should.

Finally, I removed all traces of "setuptools" and "pkg_resources" as a dependency needed to run.

@facundobatista facundobatista merged commit dabe656 into master Jun 11, 2024
38 checks passed
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.

1 participant