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

Add Node Version Error Handling #159

Merged
merged 6 commits into from
Dec 22, 2022
Merged

Add Node Version Error Handling #159

merged 6 commits into from
Dec 22, 2022

Conversation

Alek99
Copy link
Member

@Alek99 Alek99 commented Dec 22, 2022

No description provided.

@Alek99 Alek99 requested a review from picklelo December 22, 2022 00:21
@Alek99 Alek99 changed the title Check if the min node version is high enough raise and error if not. Add Node Version Error Handling Dec 22, 2022
pynecone/utils.py Outdated Show resolved Hide resolved
pynecone/utils.py Outdated Show resolved Hide resolved
)
# The output will be in the form "vX.Y.Z", so we can split it on the "v" character and take the second part
version = result.stdout.decode().strip().split("v")[1]
# Split the version string on the "." character and convert each part to an integer
Copy link
Contributor

Choose a reason for hiding this comment

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

Right here I think you can just

return version.split(".") > min_version.split(".")

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah good catch, gpt complicated it

["node", "-v"], stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
# The output will be in the form "vX.Y.Z", so we can split it on the "v" character and take the second part
version = result.stdout.decode().strip().split("v")[1]
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need this line either if we don't cast to int

Copy link
Member Author

Choose a reason for hiding this comment

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

I actually need this line because the output has v

Copy link
Contributor

@picklelo picklelo left a comment

Choose a reason for hiding this comment

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

Sweet

@Alek99 Alek99 merged commit 429b212 into main Dec 22, 2022
@Alek99 Alek99 deleted the alek/minnode branch December 28, 2022 07:28
ACucos1 pushed a commit to ACucos1/rd-pynecone that referenced this pull request Feb 28, 2023
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