-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
black 18.6b4 (new formula) #29382
black 18.6b4 (new formula) #29382
Conversation
Formula/black.rb
Outdated
end | ||
|
||
def install | ||
virtualenv_create(libexec, "python3") |
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.
Black requires at least Python 3.6, but I don't see anything in this file that prevents Homebrew from installing it under an earlier version of Python 3. Does something special need to be done?
I'm not familiar with Homebrew, so my apologies if this is not actually an issue.
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.
@JelleZijlstra That's a good point - I'm not a Homebrew expert and was unsure myself of whether this is an issue. After some research I couldn't find any way to ensure a certain version of a Homebrew formula dependency, but I finally stumbled upon the Homebrew FAQ (probably the first place I should've looked, but oh well) which states, on the subject of pinning package versions:
Note that pinned, outdated formulae that are depended on by another formula need to be upgraded when required as we do not allow formulae to be built against non-latest versions.
So long story short, installing Black via brew should automatically install and use Python 3.6 if it's not already installed.
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 will use Homebrew's python, which is currently 3.6.5 and will very soon be 3.7.0
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.
@fxcoudert Is this line necessary now that Homebrew's python
is Python 3? According to the Python for Formula Authors
docs you have to specify python3 when creating a virtualenv but it seems like that might be outdated.
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 you need python3
there
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 entire line is redundant and should be deleted.
Formula/black.rb
Outdated
class Black < Formula | ||
include Language::Python::Virtualenv | ||
|
||
desc "The uncompromising Python code formatter" |
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.
Python code formatter
is better: we want factual descriptions, not slogans :)
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 point, I'll fix that!
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.
@orn688 it looks like this line was not changed.
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.
Oops! Not sure how I messed that up. Thanks for catching it!
Formula/black.rb
Outdated
end | ||
|
||
def install | ||
virtualenv_create(libexec, "python3") |
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 will use Homebrew's python, which is currently 3.6.5 and will very soon be 3.7.0
@fxcoudert Sorry to bother you, is there anything else I need to do before this can be merged? |
@ilovezfs Thanks for the feedback, I removed the unnecessary line. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
@Stale Awaiting review. |
@BrewTestBot test this please |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install <formula>
)?Adds a formula for Black, the uncompromising Python code formatter, addressing Black's issue #362.