Skip to content

Add support for CIBW_ENVIRONMENT #149

Closed

Description

@pllim

Activity

  1. ConorMacBride commented on Aug 19, 2023

    @ConorMacBride
    Member

    I think this should already be possible with the env option. Please let me know if that works

  2. pllim commented on Aug 19, 2023

    @pllim
    ContributorAuthor

    Indeed, env works. Thanks!

  3. pllim commented on Aug 19, 2023

    @pllim
    ContributorAuthor

    So while this works, it also un-discriminatorily pulls down numpy 1.26b for everything, not just the cp312 stuff. This also breaks all the win32 jobs because I guess this new numpy does not ship win32 wheels no more.

          env: |
            CIBW_ENVIRONMENT: PIP_PRE=1

    What is the best way to tell the workflow to only do it for certain Python version here? Or do I need a totally separate workflow just for cp312.

  4. ConorMacBride commented on Aug 19, 2023

    @ConorMacBride
    Member

    You could try:

    env: |
        CIBW_ENVIRONMENT: 'PIP_PRE=$( if [ "${CIBW_BUILD:0:5}" = "cp312" ]; then echo 1; else echo 0; fi )'

    A neater solution might be to configure CIBW_BEFORE_ALL, either as an env var or in pyproject.yaml. It could call a script that sets env vars.

  5. pllim commented on Aug 19, 2023

    @pllim
    ContributorAuthor

    Alas, something isn't quite right in the if-else syntax you provided. The "else" seems to work but "then" failed to assign 1 to the variable. I get this:

    e476a803-2995-460c-b317-5d3068b425a5.sh: 3: Bad substitution
    {
      "CIBW_ENVIRONMENT": "PIP_PRE="
    }
    ...
    CIBW_ENVIRONMENT: PIP_PRE=
    CIBW_BUILD: cp312-manylinux_x86_64
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions