Search code examples
azure-devopsazure-pipelinesazure-devops-artifacts

Unable to publish python wheel in private DevOps Artifacts


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 enter image description here

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: enter image description here

Can someone help me to understand where the issue is?

Thanks in advance.


Solution

  • I just report the comment of Kevin who solved the issue:

    Can you check if you have set the Author email or Maintainer Email in pyproject.toml or setup.py? You can try to remove the email and run the pipeline again and check if it can work. Or you can try to upload the file on your local machine and check if it can work.

    Actually the issue was that authors in pyproject.toml was not reporting the email. As soon as I fixed it, the publication goes well