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

SpecifierSets that contains arbitrary equality but two different versions evaluates as equal #768

Open
notatallshaw opened this issue Jan 7, 2024 · 0 comments

Comments

@notatallshaw
Copy link
Member

notatallshaw commented Jan 7, 2024

As discussed previously (#762), I am working on an exhaustive set of tests against the boundry conditions of SpecifierSet.

I would make the assumption that the following would always be true:

version1 = {valid_version1}
version2 = {valid_version2}
operator = {valid_operator}

specifier1 =  SpecifierSet(f'{operator}{valid_version1}')
specifier2 =  SpecifierSet(f'{operator}{valid_version2}')

if (
    specifier1.contains(version1) != specifier2.contains(version1)
    or specifier1.contains(version2) != specifier2.contains(version2)
):
    assert specifier1 != specifier2

However this does now pass for "1", "1.0", and "===":

>>> SpecifierSet('===1').contains("1") 
True
>>> SpecifierSet('===1.0').contains("1") 
False

>>> SpecifierSet('===1').contains("1.0") 
False
>>> SpecifierSet('===1.0').contains("1.0") 
True

>>> SpecifierSet('===1.0') == SpecifierSet('===1')
True

Is this a bug or expected behavior?

@notatallshaw notatallshaw changed the title SpecifierSet that contains arbitary equality of two different versions evaluate as equal SpecifierSet that contains arbitary equality of two different versions evaluates as equal Jan 7, 2024
@notatallshaw notatallshaw changed the title SpecifierSet that contains arbitary equality of two different versions evaluates as equal SpecifierSet that contains arbitrary equality of two different versions evaluates as equal Jan 7, 2024
@notatallshaw notatallshaw changed the title SpecifierSet that contains arbitrary equality of two different versions evaluates as equal SpecifierSets that contains arbitrary equality but two different versions evaluates as equal Jan 7, 2024
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