Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented Aug 5, 2025

This hopefully will help with failures like #2542 and main. Currently, we lose all constraints, even our base ones, when there's custom constraints. This adds any required constraints used to generate the constraint file to the constraints always.

@henryiii henryiii force-pushed the henryiii/fix/pyodidebase branch from 6fdea59 to 13cdb30 Compare August 5, 2025 21:09
@henryiii henryiii requested a review from Copilot August 8, 2025 20:03
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes constraint handling in the build environment to prevent losing base constraints when custom constraints are specified. It addresses failures like #2542 by ensuring base constraints are always applied alongside custom ones.

  • Changes constraint file generation to use persistent .in files instead of temporary files
  • Adds logic to merge custom constraints with base constraints from .in files
  • Creates new constraint input files for Pyodide Python versions 3.12 and 3.13

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
noxfile.py Updates constraint generation to write to persistent .in files instead of temporary files
cibuildwheel/util/resources.py Adds CONSTRAINTS_IN constant for the base constraints input file
cibuildwheel/util/packaging.py Implements logic to merge custom constraints with base constraints from .in files
cibuildwheel/resources/constraints-pyodide313.in New constraint input file for Python 3.13 Pyodide builds
cibuildwheel/resources/constraints-pyodide312.in New constraint input file for Python 3.12 Pyodide builds
Comments suppressed due to low confidence (2)

@joerick
Copy link
Contributor

joerick commented Aug 10, 2025

Hmmm. I don't follow this yet... why would adding more constraints fix the dependency resolve - it looks to me that pip tries to install a later version of pyodide-build but that doesn't satisfy the resolver for some reason...

@joerick
Copy link
Contributor

joerick commented Aug 11, 2025

I think I found a neater solution here - ddc285c

@joerick
Copy link
Contributor

joerick commented Aug 11, 2025

#2548 fixes the current problem. I think unless there's a strong reason to do something like this, I'd be opposed to a solution like this,

  • because of the increased complexity
  • because there's no way for a user to override constraints. I think this could become an issue down the line - say for example we have an upper bound in our base constraints, (like click<8.2 due to some bug that is fixed after our release), but a future requirement needs something in click>8.3. There would be no way for a user to override our built-in constraints.

@henryiii henryiii closed this Aug 11, 2025
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