-
Notifications
You must be signed in to change notification settings - Fork 239
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
Issue with package upload to GitLab Package Registry after upgrade to 8.x.x: UserWarning: upload_dists is not supported by Gitlab #802
Comments
Is this related to the removal of Twine? Is it because GitLab Package Registries are the same as PyPi Simple? But then why were only PyPi and GitLab removed while the rest remained functional? It was nice that there was one config file to rule them all (Poetry, Semantic Release and uploading packages). Now when I have to manually tinker with Twine, define additional variables or create more configurations, it feels like a step backwards to me. |
I believe so. Please review the Migration Doc v7 to v8 and it explains why and what is different. In short, it was becoming cumbersome to provide every config option for a twine option pass through. The design decision was to leave twine usage to the user.
I would not say this but effectively python semantic-release doesn't handle publishing to registries anymore.
Other people required additional manipulation of twine which was not easily manageable. Python Semantic Release's true effort is in version determination and ultimately twine did all the publishing. That's why this was a breaking change. It's a change in design that would help keep it maintainable. It is not seen that twine is that much of a configuration change which is why the trade-off was made. GitLab provides documentation examples on how to complete twine publishing. |
Inside your GitLab Job, you need to add a call to twine between diff a/.gitLab-ci.yml b/.gitlab-ci.yml
variables:
GITLAB_CI: 'true'
GITLAB_TOKEN: ${GL_TOKEN}
hvcs: 'gitlab'
+ TWINE_PASSWORD: ${CI_JOB_TOKEN}
+ TWINE_USERNAME: gitlab-ci-token
script:
- git config user.name xxx
- git config user.email ${REPOSITORY_USERNAME}@noreply.gitlab.xxx
- git branch --force $CI_COMMIT_BRANCH $CI_COMMIT_SHA
- git checkout $CI_COMMIT_BRANCH
- semantic-release -vv version
+ - twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
- semantic-release -vv publish |
But why is there a config option for artifacts upload if publishing to registries is removed? Is this abandoned? Also I get an error with twine. This seems to be a GitLab issue, but it was working with the old version of semantic versioning. Is there a possiblity to generate the twine command executed by the old version?
|
@rosaLux161, Python Semantic Release does not define artifacts upload as the same as registry publishing. Our definition comes from the fact the Version Control Systems (VCS) consider a registry and the release assets separately. It's easier to think about as the Releases page is for humans and registries are for computers.
Please note this project was designed around GitHub and has increased support over the years for alternative VCS's but does not have all functionality implemented either due to time/effort or actual non-compatibility issues. The compatibility for uploading assets to a GitLab Release (the All in all, the artifacts upload config option is still available and valid even though registry publishing is deprecated. |
This error is because twine cannot find any files to upload under I glanced back at your config. You seemed to have commented out your
Not really... I looked and we had imported the |
Thanks. But this is not the problem, in my current pyproject the build command is set and I still get the error. Thats my actual
Thats the pipeline output with ls:
So the dist is created and at the correct place. |
I just copied this without rechecking twine docs. It must be:
Thanks for your clarifications and help! |
@rosaLux161, sorry about the typo, should have just copied and pasted rather than retyped from memory. I'm glad it's working for you now. I updated the code snippet above too. |
There is one more point I still don't understand: I now have a
Upload to registry is working through twine, fine. But I still have a release of the new version on the GitLab releases page. Why this? I thought this should happen in |
I don't have an answer for you. I was not around for the migration to v8. I do find it a bit misplaced to have the If you want to turn this functionality off, add |
But what does publish do now? Apart from reporting that upload_dists is not supported by GitLab?
As I understand it, it's just an empty construct? |
No, it's not an empty construct. Publish uploads file assets to a VCS release, if supported by the VCS and implemented by our code. Since you use GitLab, nothing happens. |
Issue with package upload to GitLab Package Registry after upgrade to 8.x.x: UserWarning: upload_dists is not supported by Gitlab
Description:
Since the update from version 7.34.6 to 8.7.0, the package upload to the GitLab Package Registry is not working in the GitLab-CI.
Error Message:
Previous Working Configuration (with Version 7.34.6):
pyproject.toml
:gitlab-ci.yml
:Attempted Changes for Version 8.x:
Modified
pyproject.toml
andgitlab-ci.yml
as per the updates in version 8.x. Used information fromsemantic-release generate-config -f toml --pyproject
, documentation, and this comment.pyproject.toml
:gitlab-ci.yml
:Current Status:
Observations:
upload_dists
function in the GitLab class (documentation link).Confusion:
I am confused as it worked previously with version 7.34.6, and now it fails in a newer version. The documentation mentions that not all features are supported for all HVCS providers, but does this imply that GitLab is no longer supported?
The text was updated successfully, but these errors were encountered: