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

azure-cli: add pip resource #194884

Merged
merged 2 commits into from
Oct 18, 2024
Merged

azure-cli: add pip resource #194884

merged 2 commits into from
Oct 18, 2024

Conversation

p-linnane
Copy link
Member

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

azure-cli needs pip with Python 3.12+ in order for az extension add to work: Azure/azure-cli#29922

Signed-off-by: Patrick Linnane <[email protected]>
@github-actions github-actions bot added python Python use is a significant feature of the PR or issue rust Rust use is a significant feature of the PR or issue labels Oct 18, 2024
Copy link
Contributor

🤖 An automated task has requested bottles to be published to this PR.

@github-actions github-actions bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label Oct 18, 2024
@BrewTestBot BrewTestBot enabled auto-merge October 18, 2024 17:27
@BrewTestBot BrewTestBot added this pull request to the merge queue Oct 18, 2024
Merged via the queue into master with commit 4e09c95 Oct 18, 2024
15 checks passed
@BrewTestBot BrewTestBot deleted the azure-cli-pip branch October 18, 2024 17:34
@bebound
Copy link
Contributor

bebound commented Oct 21, 2024

@p-linnane Do you know why setuptools is not in the venv? It has been a dependency of azure-cli: Azure/azure-cli#27196

/home/linuxbrew/.linuxbrew/Cellar/azure-cli/2.65.0_1/libexec/bin/python -m pip list | grep setuptools returns empty.

@erik-bershel
Copy link

Hey @carlocab and @p-linnane!
Last couple of bottles of az cli are not usable with almost any extensions at the moment due to the bump to [email protected] which blocked image updates completely. Is it something you are aware of?

I also opened an issue in the initial repo:
Azure/azure-sdk-for-python#37979

@p-linnane
Copy link
Member Author

@erik-bershel It seems like we need to downgrade back to Python 3.11 despite 3.12 being listed as supported for packaging so that we can unblock you.

@bebound We aren't able to determine the correct resources with the current project set up:

╰─ brew update-python-resources -v azure-cli
==> Retrieving PyPI dependencies for "https://github.com/Azure/azure-cli/archive/refs/tags/azure-cli-2.65.0.tar.gz"...
ERROR: https://github.com/Azure/azure-cli/archive/refs/tags/azure-cli-2.65.0.tar.gz does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.

So the best thing we can do is run pipgrip under Python 3.12 and then manually update the resources.

@erik-bershel
Copy link

3.12 being listed as supported for packaging

Yeah, for now it seams to be very brave statement

@bebound
Copy link
Contributor

bebound commented Oct 22, 2024

@bebound We aren't able to determine the correct resources with the current project set up:

╰─ brew update-python-resources -v azure-cli
==> Retrieving PyPI dependencies for "https://github.com/Azure/azure-cli/archive/refs/tags/azure-cli-2.65.0.tar.gz"...
ERROR: https://github.com/Azure/azure-cli/archive/refs/tags/azure-cli-2.65.0.tar.gz does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.

So the best thing we can do is run pipgrip under Python 3.12 and then manually update the resources.

I don't know the logic of brew update-python-resources. azure-cli-2.65.0.tar.gz consists of 3 python projects, and there is no'setup.py' and 'pyproject.toml' in root folder.


Well, I figured out why setuptools is missing. Brew calls pip with --no-deps, we need to manually add setuptools and pip in resource.

https://github.com/Homebrew/brew/blob/cd651094878e88cb710bc24e253bff8b3595258e/Library/Homebrew/formula.rb#L1855

@bebound
Copy link
Contributor

bebound commented Oct 22, 2024

3.12 being listed as supported for packaging

Yeah, for now it seams to be very brave statement

We've already used 3.12 in Azure Linux 3. Including pip and setuptools in package is a bit tricky in Homebrew, so we don't bump to 3.12 in 2.65.0. 🥲

@branchvincent
Copy link
Member

I don't know the logic of brew update-python-resources. azure-cli-2.65.0.tar.gz consists of 3 python projects, and there is no 'setup.py' and 'pyproject.toml' in root folder.

I've opened #195315 to ensure azure-cli works with our brew update-python-resources by changing the formula url to the PyPI sdist azure-cli (which depends on the other 2 projects azure-cli-core and azure-cli-telemetry also on PyPI, meaning they are automatically included as a resource). With that change, you no longer need to generate the resources yourself or have a custom script to create version bump PR's, you can use brew bump instead. I think this is a far more maintainable solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. python Python use is a significant feature of the PR or issue rust Rust use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants