-
Notifications
You must be signed in to change notification settings - Fork 20
Update how upload_to_pypi is defined #13
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
Update how upload_to_pypi is defined #13
Conversation
|
It might work if the condition is surrounded with |
|
Should we make the parameter a string and then somehow evaluate it as a boolean later in the pipeline for it to work? |
|
@ConorMacBride - I probably won't have time to try and dig deeper into this today so feel free to take over the PR if you like, if you agree that we should tweak this option. |
|
A string would work. I can take a look later. I'll make |
|
I guess the question is how would a user then specify that they want to upload on all tags, not just ones starting with 'v'? Basically we need a way for users to pass a completely custom condition? |
|
We could keep uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
with:
upload_to_pypi: ${ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') } |
|
If we do that I think we should make |
|
@ConorMacBride yes we might have to just make it required. @Cadair, what do you think? |
|
I've updated the upload_to_pypiWhether to upload to PyPI after successful builds. Alternatively, a string can be passed to match the start of a tag ref. |
|
Nice! Thank you! |
ConorMacBride
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge?
|
@ConorMacBride - could you rebase to resolve the conflict? Then feel free to merge. |
The always() is needed for the condition to be evaluated in the case an optional dependency skips.
This is incase the `targets` job fails and the `upload_pypi` job runs anyway with no wheels to upload (as the builds are both skipped and technically not failed).
...because bool(str(false)) is true
ee945cf to
8c24e1d
Compare
Prior to this PR, I think upload_to_pypi was potentially counter-intuitive because upload_to_pypi: false still means that sometimes things are uploaded to PyPI. I think it would be cleaner to simply specify that it is a boolean condition for the upload, defaulting to true if a v* tag is pushed.
I'm not sure if this will work though, as I don't know if a condition can be given as the default for the parameter. But I do think we should try and make it behave somehow like it is here, meaning that upload_to_pypi: false would never upload anything.