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

feat: Detect Vyper version from source #23

Merged
merged 20 commits into from
Sep 16, 2024

Conversation

DanielSchiavini
Copy link
Contributor

@DanielSchiavini DanielSchiavini commented Sep 6, 2024

What I did

  • Add two functions that allow to:
    • Detect the version specifier in the pragma given some source code
    • Detect the best version given the specifier
  • Add tests

How I did it

How to verify it

  • tests are included

Checklist

  • I have confirmed that my PR passes all linting checks
  • I have included test cases
  • I have updated the documentation (README.md)
  • I have added an entry to the changelog

vvm/main.py Outdated Show resolved Hide resolved
@DanielSchiavini DanielSchiavini changed the title feat: detect_vyper_version_from_source feat: Detect Vyper version from source Sep 10, 2024
vvm/main.py Outdated Show resolved Hide resolved
vvm/main.py Outdated
---------
specifier : SpecifierSet
Specifier to pick a version for.
prereleases : bool, optional
Copy link
Member

@charles-cooper charles-cooper Sep 10, 2024

Choose a reason for hiding this comment

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

either default to false (kosher, since False is not a mutable in python), or add a line in the function body like if prereleases is None: prereleases = False

Copy link
Contributor Author

@DanielSchiavini DanielSchiavini Sep 10, 2024

Choose a reason for hiding this comment

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

the packaging lib will only choose prereleases when they are the only ones available

Copy link
Member

Choose a reason for hiding this comment

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

i'm more talking about the default value -- no need to pick between None, True and False

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think None is the correct value here

vvm/__init__.py Outdated Show resolved Hide resolved
Copy link
Member

@charles-cooper charles-cooper 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, left some small style comments

vvm/install.py Outdated Show resolved Hide resolved
vvm/install.py Outdated Show resolved Hide resolved
Co-authored-by: Charles Cooper <cooper.charles.m@gmail.com>
@charles-cooper charles-cooper merged commit c9a294b into vyperlang:master Sep 16, 2024
8 of 10 checks passed
@DanielSchiavini DanielSchiavini deleted the detect-version branch September 17, 2024 10:48
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.

2 participants