NASA-PDS/template-repo-python

Unstable build fails per issue with versioning

Closed this issue · 3 comments

🐛 Describe the bug

See https://github.com/NASA-PDS/pds-template-repo-python/runs/2979922244?check_suite_focus=true#step:4:144

📜 To Reproduce

Steps to reproduce the behavior:

  1. Push to pds-template-repo-python to kick off unstable CI/CD to see the failure:
DEBUG:pds.roundup.util:🏃‍♀️ Running «['twine', 'upload', '--username', '***', '--password', '***', '--non-interactive', '--comment', '🤠 Yee-haw! This here ar-tee-fact got done uploaded by the Roundup!', '--skip-existing', '--disable-progress-bar', '--repository-url', 'https://test.pypi.org/legacy/', '/github/workspace/dist/pds.template.package-1.0.0.post0.dev25.post0.dev3-py3-none-any.whl']»
CRITICAL:pds.roundup.util:💥 Process with command line ['twine', 'upload', '--username', '***', '--password', '***', '--non-interactive', '--comment', '🤠 Yee-haw! This here ar-tee-fact got done uploaded by the Roundup!', '--skip-existing', '--disable-progress-bar', '--repository-url', 'https://test.pypi.org/legacy/', '/github/workspace/dist/pds.template.package-1.0.0.post0.dev25.post0.dev3-py3-none-any.whl'] failed with status 1
CRITICAL:pds.roundup.util:🪵 Stdout = «Uploading distributions to https://test.pypi.org/legacy/
Uploading pds.template.package-1.0.0.post0.dev25.post0.dev3-py3-none-any.whl
NOTE: Try --verbose to see response content.
»
CRITICAL:pds.roundup.util:📚 Stderr = «HTTPError: 400 Bad Request from https://test.pypi.org/legacy/
'1.0.0.post0.dev25.post0.dev3' is an invalid value for Version. Error: Start and end with a letter or numeral containing only ASCII numeric and '.', '_' and '-'. See https://packaging.python.org/specifications/core-metadata for more information.
»
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pds.roundup-0.0.0-py3.8.egg/pds/roundup/util.py", line 52, in invoke
  File "/usr/local/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['twine', 'upload', '--username', '***', '--password', '***', '--non-interactive', '--comment', '🤠 Yee-haw! This here ar-tee-fact got done uploaded by the Roundup!', '--skip-existing', '--disable-progress-bar', '--repository-url', 'https://test.pypi.org/legacy/', '/github/workspace/dist/pds.template.package-1.0.0.post0.dev25.post0.dev3-py3-none-any.whl']' returned non-zero exit status 1.

This can also be seen in pds-deep-archive failure:

CRITICAL:pds.roundup.util:📚 Stderr = «HTTPError: 400 Bad Request from https://test.pypi.org/legacy/
'0+untagged.1.g42dc251' is an invalid value for Version. Error: Can't use PEP 440 local versions. See https://packaging.python.org/specifications/core-metadata for more information.

🕵️ Expected behavior

It executes successfully

Argh, more mid-sprint tickets in the currently-due sprint!? 😮

It looks like the issue is this works the first time when there are no other tags for git-describe to describe, but then fails when there's at least one pre-release tag. If I delete all the local tags and then let Versioneer do its work, it makes a PEP-440-compliant version string.

Which suggests the workaround: delete all the local tags before computing the version.

However, I think this might be an issue in Versioneer, actually. It looks like Versioneer has been updated recently, though, so I'm going to experiment with that.

@nutjob4life we can table this to next sprint if you can't get to it. Just added it more to at least triage the issue to see if it was a quick fix or not

No need @jordanpadams I'm already on it! 🏃‍♂️