I’m setting a new CD pipeline with the target to update a python library on DevOps Artifacts Feed.
Here the pipeline, I’m using:
trigger:
- main
pool:
vmImage: ubuntu-latest
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'specific'
project: '12ba6212-0768-4c3d-b0d3-836b0423d9a4'
definition: '3055'
buildVersionToDownload: 'specific'
pipelineId: '141443'
artifactName: 'dev_package'
itemPattern: '*.whl'
targetPath: '$(Pipeline.Workspace)/build'
- script: |
echo '$(Pipeline.Workspace)'
ls '$(Pipeline.Workspace)/build'
- script: pip install twine
displayName: 'Install twine'
- task: TwineAuthenticate@1
inputs:
artifactFeed: 'ABC/FOTA_Utilities'
- script: |
python -m twine upload -r FOTA_Utilities --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/build/*.whl --verbose
displayName: 'Upload to feed'
To speed-up the pipeline tests, I stored the wheel file to upload as pipeline artifact.
Here the log of the execution of step TwineAuthenticate@1
Instead here the twine upload log:
python -m twine upload -r FOTA_Utilities --config-file /home/vsts/work/_temp/twineAuthenticate/DM3CO8/.pypirc /home/vsts/work/1/build/*.whl --verbose
========================== Starting Command Output ===========================
/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/192f1878-a08d-43c1-ba3d-dd3fd66aee68.sh
INFO Using configuration from
/home/vsts/work/_temp/twineAuthenticate/DM3CO8/.pypirc
Uploading distributions to
https://pkgs.dev.azure.com/ORG_NAME/PRJ_NAME/_packaging/FOTA_Utilities/pypi/upload
INFO /home/vsts/work/1/build/flash-0.1.0-py3-none-any.whl (37.5
KB)
INFO username set from config file
INFO password set from config file
INFO username: build
INFO password: <hidden>
Uploading dataset_reflash-0.1.0-py3-none-any.whl
25l
0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/43.9 kB • --:-- • ?
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.9/43.9 kB • 00:00 • 108.0 MB/s
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.9/43.9 kB • 00:00 • 108.0 MB/s
25hINFO Response from
https://pkgs.dev.azure.com/ORG_NAME/PRJ_NAME/_packaging/FOTA_Utilities/pypi/
upload:
400 Bad Request - The email 'Salvatore Musumeci [xxxx]' is
invalid. (DevOps Activity ID: 6BCEB4BD-CEED-4399-9280-AC4B876B604C)
INFO {"$id":"1","innerException":null,"message":"The email 'Salvatore
Musumeci [xxx]' is
invalid.","typeName":"Microsoft.VisualStudio.Services.Packaging.Shared.
WebApi.Exceptions.InvalidPackageException,
Microsoft.VisualStudio.Services.Packaging.Shared.WebApi","typeKey":"Inv
alidPackageException","errorCode":0,"eventId":3000}
ERROR HTTPError: 400 Bad Request from
https://pkgs.dev.azure.com/ORG_NAME/PRJ_NAME/_packaging/FOTA_Utilities/pypi/
upload
Bad Request - The email 'Salvatore Musumeci [xxx]' is invalid.
(DevOps Activity ID: 6BCEB4BD-CEED-4399-9280-AC4B876B604C)
##[error]Bash exited with code '1'.
Finishing: Upload to feed
Finally, below is reported the permission of the feed:
Can someone help me to understand where the issue is?
Thanks in advance.
2
Answers
I just report the comment of Kevin who solved the issue:
Actually the issue was that authors in pyproject.toml was not reporting the email. As soon as I fixed it, the publication goes well
When we deploy the Python Package to Azure Artifacts, it will read and validate the authors and maintainers information(Username and email) in the
pyproject.toml
file.For example:
We need to make sure the Authors and Maintainers information is correct. Then we can publish the package to Azure Artifacts successfully.