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

pypi: support updating resources for git clones #15831

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

branchvincent
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

This teaches brew update-python-resources how to handle a formula with a git url, like arcade-learning-environment.

Before:

$ brew update-python-resources arcade-learning-environment
Error: Unable to determine metadata for "https://github.com/mgbellemare/Arcade-Learning-Environment.git" because of a failure when running
`/opt/homebrew/opt/[email protected]/bin/python3 -m pip install -q --no-deps --dry-run --ignore-installed --report /dev/stdout https://github.com/mgbellemare/Arcade-Learning-Environment.git`.
Please report this issue:
  https://docs.brew.sh/Troubleshooting

After:

$ brew update-python-resources arcade-learning-environment
==> Retrieving PyPI dependencies for "git+https://github.com/mgbellemare/[email protected]"...
==> Getting PyPI info for "importlib-resources==6.0.0"
==> Getting PyPI info for "numpy==1.25.2"
==> Updating resource blocks

Copy link
Contributor

@apainintheneck apainintheneck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me.

As a side note, it looks like this isn't necessarily well described in the docs. The tag: and revision: options are only mentioned under the Unstable Versions (head) section which seems to imply that head blocks and these url options are somehow related even though you can use them in stable blocks as well. Maybe it'd be a good idea to add a specific section that talks about url options. Obviously this is completely unrelated to this PR. It just made me think of that.

@MikeMcQuaid
Copy link
Member

Maybe it'd be a good idea to add a specific section that talks about url options.

Good idea 👍🏻

@MikeMcQuaid MikeMcQuaid merged commit 6b773a3 into Homebrew:master Aug 7, 2023
24 checks passed
@MikeMcQuaid
Copy link
Member

Thanks again @branchvincent!

@drewfish
Copy link

drewfish commented Aug 9, 2023

BTW this broke a tap I was using for company-internal tools. (Yep, I know that's not a goal of homebrew, so I'm kinda on my own with that.) I was doing:

  url "git+ssh://[email protected]/mycompany/mypythontool.git",
     using:    :git,
     tag:      "1.2.3"

I was able to fix it by removing the git+ prefix. An example in Python-for-Formula-Authors would be helpful, even just a link to a formula. Oh nevermind, I see that the "Formula Cookbook" has been revised, thanks!

@github-actions github-actions bot added the outdated PR was locked due to age label Sep 9, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants