cdklabs / publib

A unified toolchain for publishing libraries to popular package managers (formally jsii-release)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Twine upload errors don't provide any detail

maafk opened this issue · comments

During a projen "Publish to Pypi" action I got the following error

Uploading enterprise_utils-0.0.0-py3-none-any.whl
25l
  0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/30.3 kB • --:-- • ?
  0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/30.3 kB • --:-- • ?
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 30.3/30.3 kB • 00:00 • 84.9 MB/s
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 30.3/30.3 kB • 00:00 • 84.9 MB/s
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 30.3/30.3 kB • 00:00 • 84.9 MB/s
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 30.3/30.3 kB • 00:00 • 84.9 MB/s
25hWARNING  Error during upload. Retry with the --verbose option for more details. 
Error: Process completed with exit code 1.

There was no option for --verbose, so I included publib as a project dependency, adjusted bin/publib-pypi to use

python3 -m twine upload --verbose --skip-existing *

Here I got a more helpful error of

INFO     Response from https://upload.pypi.org/legacy/:                                                                              
         400 'git@github.com:professionalaf/enterprise-utils.git' is an invalid value for Home-Page. Error: Invalid URI See          
         https://packaging.python.org/specifications/core-metadata for more information.                                             
INFO     <html>                                                                                                                      
          <head>                                                                                                                     
           <title>400 'git@github.com:professionalaf/enterprise-utils.git' is an invalid value for Home-Page. Error: Invalid URI See 
         https://packaging.python.org/specifications/core-metadata for more information.</title>                                     
          </head>                                                                                                                    
          <body>                                                                                                                     
           <h1>400 'git@github.com:professionalaf/enterprise-utils.git' is an invalid value for Home-Page. Error: Invalid URI See    
         https://packaging.python.org/specifications/core-metadata for more information.</h1>                                        
           The server could not comply with the request since it is either malformed or otherwise incorrect.<br/><br/>               
         &#x27;git@github.com:professionalaf/enterprise-utils.git&#x27; is an invalid value for Home-Page. Error: Invalid URI See    
         https://packaging.python.org/specifications/core-metadata for more information.                                             
                                                                                                                                     
                                                                                                                                     
          </body>                                                                                                                    
         </html>

Which prompted me to adjust my publishToPypi options to include

publishToPypi: {
    distName: 'enterprise-utils',
    module: 'enterprise_utils',
    homepage: 'https://github.com/professionalaf/enterprise-utils',  // Added this
  },

Doing a successful twine upload with --verbose doesn't add any additional logging, so adding this flag should only assist with debugging errors