-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
Azure CLI 2.0 on Homebrew (with latest release 2.0.17) #17344
Conversation
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.
Need to create a version alias for the new formula as well:
Error: 1 problem in 1 formula
azure-cli:
- Formula has other versions so create a versioned alias:
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Aliases
ln -s ../Formula/azure-cli.rb azure-cli@2.0
@tamird thanks for the initial comments. I fixed that and some formatting of the formula also. |
This is a duplicate of #13198 and it appears to have the exact same issue that it's not building the dependencies from source. |
Hi @ilovezfs the main blocker with that PR was that there were dependency conflicts. Also, some dependencies do not have source packages (Python sdist) available. |
The product source code is built from source with https://azurecliprod.blob.core.windows.net/releases/azure-cli_packaged_2.0.15.tar.gz |
I mean the dependencies, not the product source code. |
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.
All dependencies need to be built from source not just the azure wheels themselves.
Regardless of whether the conflicts have or have not been resolved, I'm afraid we'll have to pass on this upgrade until everything can build from source. |
If you agree, it'd be nice to use this language-agnostic URL in |
@vszakats thanks now using the language-agnostic URL. |
Thank you @derekbekoe! |
@ilovezfs I am taking a look at building everything (including dependencies) from source. |
@ilovezfs I now build from source by specifying Now we build from source, it takes longer to build. Bottles states 'Bottles are created using the Brew Test Bot.' Is this a process I need to initiate? |
After the fix is ready, does installing Azure Cli through homebrew require Xcode on MacOs in advance? |
Once Azure CLI is available through Homebrew, |
@ilovezfs Can we get another look at the PR? |
Friendly ping on this. :) |
@derekbekoe FWIW bottles (and the associated |
Please recast this not to use virtualenv and to use |
@ilovezfs Can you provide an example or expand on this further? Currently we use This appears similar to these formulae. |
7266c38
to
974e54d
Compare
cython, ipython, jupyter, meson, protobuf, snakemake, etc. |
I will take a look at those examples though the current formula looks similar to these other formulae. |
Yes, I did those. They're for small, frequently updated cases where I tired of maintaining the resource blocks. It's a hack. |
974e54d
to
72db4b4
Compare
Formula/azure-cli.rb
Outdated
depends_on "openssl" | ||
depends_on "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.
should be :python3
not "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.
done.
Formula/azure-cli.rb
Outdated
system libexec/"bin/pip", "install", "--no-binary", ":all:", "--force-reinstall", "-U", "azure-nspkg", "azure-mgmt-nspkg", "-f", buildpath/"dist" | ||
# This replaces the `import pkg_resources` namespace imports from upstream | ||
# with empty string as the import is slow and not needed in this environment. | ||
File.open(site_packages/"azure/__init__.py", "w") |
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.
touch site_packages/"azure/__init__.py"
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 files already exist and contain these contents:
import pkg_resources
pkg_resources.declare_namespace(__name__)
I want to empty the contents of those files.
touch
would create the file if it didn't exist but doesn't empty its contents.
FYI, Homebrew has a policy against using patches "when patching something that will never be accepted upstream". The general recommendation is to instead use |
Where do Regarding the patch, I think we'll need to do without it if it's never going to be merged upstream. |
Extensions get installed into the user directory or The patch resolves Homebrew/brew#837 which is not an issue with upstream. If the patch is removed, the user experience is less than ideal. Without the patch,
The only workaround in this case is for a user to temporarily create the The patch does this for them. |
Then Homebrew/brew#837 would need to be fixed because a permanent patch isn't really OK. |
It should be okay to leave the patch in until Homebrew/brew#837 is resolved. |
Given Homebrew/brew#837 is closed, my assumption at this point has to be it will never be fixed, which means the patch is permanent, and therefore not acceptable. |
If Homebrew/brew#837 isn't going to be fixed and a patch for that is required for this formula, it makes sense to make an exception for this patch. |
Whether or not it makes sense from the perspective of functionality and user experience, I'm not willing to accept a patch that won't be upstreamed. |
We'd like this formula in homebrew as it's a highly requested installer. So if a patch to fix the user experience is not an option, what other option will you accept that can get this PR merged? I can add a caveat message that explains how to manually temporarily create the |
Would it not be possible to detect the installation is Homebrew, and handle it conditionally? |
I have reopened Azure/azure-cli#4428. Would like to get this PR merged. For the next release, I can include conditional logic for homebrew in Azure CLI. Sound good? |
Yup, thank you. The patch url is
|
Changed patch URL. |
Formula/azure-cli.rb
Outdated
export PYTHONPATH="#{ENV["PYTHONPATH"]}" | ||
python#{xy} -m azure.cli \"$@\" | ||
EOS | ||
(bin/"az").write az_exec |
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.
(bin/"az").write <<-EOS.undent
#!/usr/bin/env bash
export PYTHONPATH="#{ENV["PYTHONPATH"]}"
python#{xy} -m azure.cli \"$@\"
EOS
That said, it would be nice if this could use the write_env_script
DSL instead.
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.
okay changed this...
Formula/azure-cli.rb
Outdated
assert_equal azure_cloud["resourceManagerEndpointUrl"], "https://management.azure.com/" | ||
version_output = shell_output("#{bin}/az --version") | ||
assert_match "azure-cli", version_output | ||
system bin/"az", "account", "list" |
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.
Can we assert the output matches something here? I'd like to just get rid of the version test above, and have this do something a bit more involved to make sure things are working properly. See the tests in faas-cli
, jose
, jupyter
, and stubby
for some good examples.
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 added a different test.
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 is similar to https://github.com/Homebrew/homebrew-core/blob/master/Formula/azure-cli.rb#L35.
@ilovezfs Anything else? |
Please squash it down to one commit for |
bb6f654
to
f65bd07
Compare
@ilovezfs done. |
Thanks for your first contribution to Homebrew, @derekbekoe! (And for putting up with me.) |
Thanks for your cooperation @ilovezfs. |
Most anticipated, thanks for merging, and thanks @derekbekoe for making it happen :) |
I ran into an issue with this formula after installing with it not finding the python image: #18240 |
Move prev. azure cli to azure-cli@1.0.rb
Closes Support installation on OSX with Homebrew Azure/azure-cli#643
Have you followed the guidelines for contributing?
Have you checked that there aren't other open pull requests for the same formula update/change?
Have you built your formula locally with
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?Does your build pass
brew audit --strict <formula>
(after doingbrew install <formula>
)?