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

PythonVersions audit: test mixed runtime dependencies #18552

Closed

Conversation

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

I have been updating a formula in a 3rd-party tap that currently has a runtime dependency on [email protected] (no :build or :test annotations), and I'd like to update it to depend on multiple python versions in order to build bindings against multiple versions but still depend on one version as a runtime dependency, like the following:

  depends_on "[email protected]" => [:build, :test]
  depends_on "[email protected]"

The PythonVersions audit currently complains about this:

C: [Correctable] FormulaAudit/PythonVersions: References to [email protected] should match the specified python dependency ([email protected])
  depends_on "[email protected]" => [:build, :test]
             ^^^^^^^^^^^^^

If there isn't a problem with depending on a mix of runtime and non-runtime versions of python, I'd like to update the audit to allow this. I've opened this as a draft PR with a failing test that should pass once the audit is updated. Please let me know if this obviously won't be accepted before I spend time to try to update the audit.

The PythonVersions cop currently complains if a formula
depends on a mixed combination of runtime and non-runtime
python versions. This adds a test to demonstrate the
behavior.
@cho-m
Copy link
Member

cho-m commented Oct 12, 2024

I had an old PR on this where general opinion was against: #16119

EDIT: Though if the usage is only 3rd party tap, it could be up for discussion on whether some checks could be made core only.

@MikeMcQuaid
Copy link
Member

it could be up for discussion on whether some checks could be made core only.

I'd be fine with this 👍🏻

@scpeters
Copy link
Member Author

I've thought about it, and I'll switch our formulae

I had an old PR on this where general opinion was against: #16119

thanks for the reference to the prior discussion here. In the short-term, I'll just use [:build, :test] for all python versions in our tap.

it could be up for discussion on whether some checks could be made core only.

I'd be fine with this 👍🏻

thanks for the feedback. For now I will close this since I'm not planning to work on it immediately, but I will come back to it if it seems useful to our users

@scpeters scpeters closed this Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants