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

Arbitrary equality not matching when a prerelease? Even with prereleases=True #766

Open
notatallshaw opened this issue Jan 6, 2024 · 3 comments

Comments

@notatallshaw
Copy link
Member

notatallshaw commented Jan 6, 2024

As part of my question (#762) I am writing an exhaustive set of tests for if something is contained within a specifier set, however this confused me:

SpecifierSet('===1.a1', prereleases=True).contains("1.a1")

This returns False, which is not how I understand arbitrary equality. Is this a bug or expected behavior?

@pradyunsg
Copy link
Member

Ah, this is definitely a bug.

The specifier's version (1.a1) ends up being normalised (1a1) before being passed into the comparator, and that's why the comparision fails here.

@notatallshaw
Copy link
Member Author

The specifier's version (1.a1) ends up being normalised (1a1) before being passed into the comparator, and that's why the comparision fails here.

Thanks for the info! For my use case of writing an exhaustive set of tests for the boundry conditions of SpecifierSet.contains I can just normalize all the version numbers ahead of time.

@pradyunsg
Copy link
Member

I expect we'd break that workflow once this is actually fixed, FWIW.

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

No branches or pull requests

2 participants