-
Notifications
You must be signed in to change notification settings - Fork 313
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
Register pyenv Python versions #706
Register pyenv Python versions #706
Conversation
With this commit we ensure that make file targets work with all supported Python versions by registering them in a project-specific file that `pyenv` will read during the build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a suggestion for a different strategy here.
Makefile
Outdated
@@ -36,6 +36,8 @@ prereq: make-requirements.txt | |||
pyenv install --skip-existing $(PY37) | |||
# pyenv global system $(PY34) $(PY35) $(PY36) $(PY37) | |||
pyenv global system $(PY35) $(PY36) $(PY37) | |||
@# Ensure all Python versions are registered for this project | |||
@eval "$$(pyenv init -)" && pyenv versions --bare > .python-version; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed makes sense to just use the already present make-requirements.txt
with something like awk -F'=' '{print $2}' make-requirements.txt >.python-version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I left a comment for an alternative approach.
Makefile
Outdated
@@ -37,7 +37,7 @@ prereq: make-requirements.txt | |||
# pyenv global system $(PY34) $(PY35) $(PY36) $(PY37) | |||
pyenv global system $(PY35) $(PY36) $(PY37) | |||
@# Ensure all Python versions are registered for this project | |||
@eval "$$(pyenv init -)" && pyenv versions --bare > .python-version; | |||
@awk -F'=' '{print $$2 > ".python-version"}' make-requirements.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, but IMHO it is a bit strange to do a file redirection inside awk for this use case;
would it be simpler to
@awk -F'=' '{print $$2}' make-requirements.txt >.python-version
i.e. redirect the final result of awk to .python-version
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!
Thanks for the review! :) |
With this commit we ensure that make file targets work with all
supported Python versions by registering them in a project-specific file
that
pyenv
will read during the build.