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

Fix for NpmVersionRange.from_native and README #34

Merged
merged 2 commits into from
Feb 16, 2022

Conversation

keshav-space
Copy link
Member

@keshav-space keshav-space commented Jan 29, 2022

1. Fix README

  • Import versions instead version
     [❌] from univers.version import PypiVersion
     [✅] from univers.versions import PypiVersion
  • Use relative-path to execute configure script

2. Fix NpmVersionRange

  • NpmVersionRange.from_native was returning a tuple containing list of VersionConstraint

  • Instead it must return a tuple containing VersionConstraint

    • Earlier NpmVersionRange.from_native("^1.0.2") would return constraints as
      ([VersionConstraint(comparator='<', version=SemverVersion(string='2.0.0')), VersionConstraint(comparator='>=', version=SemverVersion(string='1.0.2'))],)
    • After Fix
      (VersionConstraint(comparator='>=', version=SemverVersion(string='1.0.2')), VersionConstraint(comparator='<', version=SemverVersion(string='2.0.0')))
  • Fixes: NpmVersionRange.from_native isn't returning constraints as intended #35

3. Add test for NpmVersionRange

  • test_NpmVersionRange_from_native_with_compatible_with_version_operator
  • test_NpmVersionRange_from_native_with_approximately_equal_to_operator

4. Don't do black codestyle test for docs and etc

Signed-off-by: keshav-space [email protected]

@keshav-space keshav-space changed the title Fix typos in Example and Deployment Fix NpmVersionRange.from_native and README Jan 30, 2022
@keshav-space keshav-space changed the title Fix NpmVersionRange.from_native and README Fix for NpmVersionRange.from_native and README Jan 30, 2022
Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent catch!
Thanks... can you add a test or two?

@keshav-space
Copy link
Member Author

Excellent catch! Thanks... can you add a test or two?

Done !!

@Hritik14
Copy link
Collaborator

Hritik14 commented Feb 7, 2022

@keshav-space codestyle tests are failing. Please run python -m black -l 100 setup.py etc src tests docs to fix this.

Copy link
Collaborator

@Hritik14 Hritik14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice catch! I've added some suggestions for you to consider

tests/test_version_range.py Outdated Show resolved Hide resolved
tests/test_version_range.py Outdated Show resolved Hide resolved
tests/test_version_range.py Outdated Show resolved Hide resolved
tests/test_version_range.py Outdated Show resolved Hide resolved
tests/test_version_range.py Show resolved Hide resolved
Copy link
Collaborator

@Hritik14 Hritik14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a few changes to go

tests/test_version_range.py Outdated Show resolved Hide resolved
tests/test_version_range.py Outdated Show resolved Hide resolved
tests/test_version_range.py Outdated Show resolved Hide resolved
@Hritik14
Copy link
Collaborator

@keshav-space LGTM!
Please squash your commits in two parts - black formatting and the fix.

README:
- Import `versions` instead of `version`
- Use relative path to execute `configure` script

version_range:
- `NpmVersionRange.form_native` should generate tuple of `VersionConstraint`
- Fixes: aboutcode-org#35

test_version_range:
- Add test for NpmVersionRange.from_native

Signed-off-by: keshav-space <[email protected]>
@keshav-space keshav-space force-pushed the main branch 2 times, most recently from 1e46e46 to fd9d341 Compare February 15, 2022 13:25
- codestyle test for `etc`, will be handled by `skeleton`
- see: aboutcode-org/skeleton#54

Signed-off-by: keshav-space <[email protected]>
Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!
Merging!

@pombredanne pombredanne merged commit 73ff686 into aboutcode-org:main Feb 16, 2022
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.

NpmVersionRange.from_native isn't returning constraints as intended
3 participants