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

Package version incorrectly inferred when bulding wheels via CI. #952

Closed
zoj613 opened this issue Oct 4, 2023 · 10 comments
Closed

Package version incorrectly inferred when bulding wheels via CI. #952

zoj613 opened this issue Oct 4, 2023 · 10 comments

Comments

@zoj613
Copy link

zoj613 commented Oct 4, 2023

I have a package I have been trying to make a release for but it won't upload to PyPI because the version on the wheel is not correctly inferred. Building the wheels locally using cibuildwheel the versioning is correct. What could be possibly wrong with my workflow steps?

Here is the CI job: https://github.com/zoj613/polyagamma/actions/runs/6401828361/job/17377514857#step:5:12306

the package version is supposed to be 1.3.6 but it is shown as 0.1. Locally it is inferred correctly. Here is the corresponding workflow file: https://github.com/zoj613/polyagamma/actions/runs/6401828361/workflow . The issue persists even if I skip the QEMU step. Any suggestions?

@zoj613 zoj613 changed the title Package version is wrongly inferred when bulding wheels. Package version incorrectly inferred when bulding wheels via CI. Oct 4, 2023
@RonnyPfannschmidt
Copy link
Contributor

Does it's create the tag before or after the release publishing

I believe the pipeline needs to run on the tag event on top of the tagged commit

There is no support for inferring more details from GitHub ci

@zoj613
Copy link
Author

zoj613 commented Oct 4, 2023

Does it's create the tag before or after the release publishing

I believe the pipeline needs to run on the tag event on top of the tagged commit

There is no support for inferring more details from GitHub ci

I believe the workflow is ran after a manual tagged release has been made. The workflow worked just fine a few months ago when the current version was release here: https://github.com/zoj613/polyagamma/actions/runs/4380135801 with correctly versioned wheels: https://pypi.org/project/polyagamma/#files

i'm not sure what could have caused setuptools-scm to now use an incorrect version when running the CI job but still work correctly when run locally.

@RonnyPfannschmidt
Copy link
Contributor

If the checkout action goes for plain commit no tags land in the checkout

@zoj613
Copy link
Author

zoj613 commented Oct 4, 2023

If the checkout action goes for plain commit no tags land in the checkout

I tried adding

      - uses: actions/checkout@v3
        with:
          ref: ${{  github.ref_name }}
          fetch-tags: 'true'

in there but it still changes nothing: https://github.com/zoj613/polyagamma/actions/runs/6409235631/job/17400001083 . The wheels are versioned as 0.1.dev...

@zoj613
Copy link
Author

zoj613 commented Oct 6, 2023

@RonnyPfannschmidt any other ideas I could try to resolve this? I'm not even sure if this is a bug in setuptools-scm or im just not doing things correctly.

@RonnyPfannschmidt
Copy link
Contributor

Set the SETUOTOOLS_SCM_DEBUG env variable and get the output added

@zoj613
Copy link
Author

zoj613 commented Oct 7, 2023

Set the SETUOTOOLS_SCM_DEBUG env variable and get the output added

I added the variable, here is a CI run with it enabled: https://github.com/zoj613/polyagamma/actions/runs/6442982408/job/17494400442#step:5:1

@RonnyPfannschmidt
Copy link
Contributor

Ok, the checkout has no tags your need to make Git fetch them

@zoj613
Copy link
Author

zoj613 commented Oct 7, 2023

Ok, the checkout has no tags your need to make Git fetch them

The workflow file has these lines: https://github.com/zoj613/polyagamma/actions/runs/6442982408/workflow#L26-L30
is there something on top of that need to ensure tags are fetched. It seems like these options are not enough.

@zoj613
Copy link
Author

zoj613 commented Oct 8, 2023

@RonnyPfannschmidt It looks like the source of the problem is that actions/checkout introduced a breaking change as explained at actions/checkout#1471 where the tags no longer get fetched using the default settings. I had to set fetch-depth=0 in order for all tags to be fetched. Introducing this "fix" results in setuptools-scm versioning the wheels correctly.

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

No branches or pull requests

2 participants