-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
cmd/pyenv-sync: add new command. #15507
Conversation
Library/Homebrew/cmd/pyenv-sync.rb
Outdated
ensure | ||
pyenv_sync_running.unlink if pyenv_sync_running.exist? |
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.
Would this not also end up calling unlink
after a
return if pyenv_sync_running.exist?
from above? If so, then that's probably not the desired behaviour here.
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'm following the pattern here:
brew/Library/Homebrew/cmd/rbenv-sync.rb
Lines 46 to 47 in c5f4d04
ensure | |
rbenv_sync_running.unlink if rbenv_sync_running.exist? |
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.
Yes, but we probably don't want to follow that since it calls unlink
even when not desired. You can avoid this by wrapping the relevant bits in a begin
... end
block. See suggestion below.
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.
Should I open a PR to fix this in the other sync commands?
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.
@johndbritton could just do that in this PR I reckon
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.
fair enough, will update
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.
Addressed the same issue in rbenv-sync
and nodenv-sync
in 24c014b.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Took another pass at this, let me know if there are any other concerns. |
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.
Outside of a couple small tweaks (suggestions below), this looks to be in line with the existing nodenv-sync
and rbenv-sync
commands. I haven't tested the functionality but this approach makes more sense to me 👍
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.
The suggestions below should fix the brew style
failures.
I had fixed these, but I guess I forgot to push them, should be fixed now |
Library/Homebrew/cmd/pyenv-sync.rb
Outdated
ensure | ||
pyenv_sync_running.unlink if pyenv_sync_running.exist? |
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.
Yes, but we probably don't want to follow that since it calls unlink
even when not desired. You can avoid this by wrapping the relevant bits in a begin
... end
block. See suggestion below.
Similar to `rbenv-sync` and `nodenv-sync`, but for use with `pyenv`. Python has separate formulae for minor Python versions, as such this will symlink all patch versions to the latest minor version.
@carlocab I made the requested changes. |
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; nice work!
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.
Did some quick testing and it seems to work as described, so it looks good to me. Thanks!
Thanks so much for your first contribution! Without people like you submitting PRs we couldn't run this project. You rock, @johndbritton! |
Similar to
rbenv-sync
andnodenv-sync
, but for use withpyenv
.Python has separate formulae for minor Python versions, as such this will symlink all patch versions to the latest minor version.
Following the style in #14972, didn't see any example tests.
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?