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

Inline dependency-versions syntax #2122

Merged
merged 12 commits into from
Mar 10, 2025
Merged

Inline dependency-versions syntax #2122

merged 12 commits into from
Mar 10, 2025

Conversation

joerick
Copy link
Contributor

@joerick joerick commented Jan 5, 2025

To help with #2002, I propose a way to specify dependency version constraints inline, without the extra file. This would eliminate the need for an additional CIBW_PYODIDE_BUILD_VERSION option, while being consistent with our existing version management system.

This would allow setting the pyodide-build version like:

CIBW_DEPENDENCY_VERSIONS_PYODIDE: "packages: pyodide-build==0.29.1"

So far, no implementation yet, just docs for discussion.

@joerick joerick marked this pull request as draft January 5, 2025 14:48
@joerick
Copy link
Contributor Author

joerick commented Jan 27, 2025

Having reviewed #2002 again, I think this would be a useful feature. Specifically, there's a check for compatible versions between pyodide and pyodide-build - if we provide an option for CIBW_PYODIDE_VERSION, and we don't have this, changing pyodide version becomes a bit hassle, because you need to make a constraints file as well.

@joerick joerick force-pushed the dependency-version-inline branch from 1912c7a to 870a1dd Compare January 31, 2025 13:22
@joerick joerick marked this pull request as ready for review February 23, 2025 12:10
@joerick
Copy link
Contributor Author

joerick commented Feb 23, 2025

This should be ready to go, pending review.

@joerick joerick requested a review from henryiii February 28, 2025 12:48
@henryiii
Copy link
Contributor

Two questions:

  • packages = [] would avoid pinning?
  • How does this interact with inherit? Can you inherit from a file and add a package?

@henryiii
Copy link
Contributor

I've managed to make some conflicts due to #2276. I can rebase if you prefer, sorry!

@joerick
Copy link
Contributor Author

joerick commented Mar 1, 2025

  • packages = [] would avoid pinning?

Good point. I think that should be equivalent to 'latest', as in it pins nothing. I'll make sure that's covered with a test case.

  • How does this interact with inherit? Can you inherit from a file and add a package?

It doesn't inherit. I considered including it but because of the backwards-compatibility requirements1 it's awkward to implement (the syntax is different from the other table-style options). Also, I couldn't think of a situation it might be useful. What do you think?

Footnotes

  1. the existing string-form (just a path) means that if we start using the table-form, characters like ;: will be parsed differently. I'm sure it could be worked around somehow, but it might require some messy code, didn't seem worth the effort/complexity.

joerick added 3 commits March 7, 2025 10:41
And, remove some optionals to reduce the problem space
…line

# Conflicts:
#	cibuildwheel/options.py
#	cibuildwheel/util/packaging.py
#	test/test_dependency_versions.py
#	unit_test/dependency_constraints_test.py
@joerick
Copy link
Contributor Author

joerick commented Mar 10, 2025

This is ready for another review, the empty packages case is now covered.

@joerick joerick merged commit 25f2d3f into main Mar 10, 2025
25 checks passed
@joerick joerick deleted the dependency-version-inline branch March 10, 2025 21:45
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.

2 participants