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

utils/pypi: allow only updating extra_packages #16753

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Feb 27, 2024

  • 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?

Goal of PR is to allow easier updating of Python resources for formulae that aren't Python packages. In future, may allow brew bump to automatically run this (currently not done for non-PyPI URLs).

To give an example, the resources within the python formula

  • Current state:

    brew update-python-resources [email protected]
    Error: Unable to determine metadata for "https://www.python.org/ftp/python/3.12.2/Python-3.12.2.tgz" because of a failure when running
    `/opt/homebrew/opt/[email protected]/libexec/bin/python -m pip install -q --no-deps --dry-run --ignore-installed --report /dev/stdout https://www.python.org/ftp/python/3.12.2/Python-3.12.2.tgz`.
    Please report this issue:
      https://docs.brew.sh/Troubleshooting
  • With PR, need to add diff to get subsequent output:

    diff --git a/pypi_formula_mappings.json b/pypi_formula_mappings.json
    index 9718573087a..619c6da0d48 100644
    --- a/pypi_formula_mappings.json
    +++ b/pypi_formula_mappings.json
    @@ -588,6 +588,7 @@
         "extra_packages": ["flit-core", "setuptools", "pip", "wheel"]
       },
       "[email protected]": {
    +    "package_name": "",
         "extra_packages": ["flit-core", "setuptools", "pip", "wheel"]
       },
       "python-build": {
    brew update-python-resources [email protected]
    ==> Retrieving PyPI dependencies for "flit-core setuptools pip wheel"...
    ==> Retrieving PyPI dependencies for excluded ""...
    ==> Getting PyPI info for "flit-core==3.9.0"
    ==> Getting PyPI info for "pip==24.0"
    ==> Getting PyPI info for "setuptools==69.1.1"
    ==> Getting PyPI info for "wheel==0.42.0"
    ==> Updating resource blocks

@p-linnane
Copy link
Member

cc @alex @branchvincent @timsutton and @woodruffw who may be interested in this.

@alex
Copy link
Contributor

alex commented Feb 27, 2024

I think this means that we could remove this: https://github.com/Homebrew/brew-pip-audit/blob/main/generate-prs.rb#L19-L20

It'd be able to automatically bump the python packages used by those formula, is that right?

Copy link
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

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

Makes sense to me, thanks @cho-m!

@woodruffw
Copy link
Member

It'd be able to automatically bump the python packages used by those formula, is that right?

That's my understanding!

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looks good so far! One tweak.

Co-authored-by: Mike McQuaid <[email protected]>
Copy link
Member

@branchvincent branchvincent left a comment

Choose a reason for hiding this comment

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

nice!

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks again @cho-m!

@MikeMcQuaid MikeMcQuaid merged commit 136c50a into Homebrew:master Feb 29, 2024
24 checks passed
alex added a commit to Homebrew/brew-pip-audit that referenced this pull request Feb 29, 2024
Should be possible now that Homebrew/brew#16753 is landed
@cho-m cho-m deleted the pypi-only-resources branch February 29, 2024 13:16
@github-actions github-actions bot added the outdated PR was locked due to age label Apr 3, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 2024
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.

6 participants