python / release-tools

Scripts for making (C)Python releases
39 stars 33 forks source link

Fix getting GitHub owner for remote origin with https:// #141

Closed hugovk closed 4 months ago

hugovk commented 4 months ago

First, refactor the code into its own function, so it can be easily unit tested, and add tests for existing functionality:

Second, fix the error I get below:

✅  Create tag
✅  Push new tags and branches to private fork
💥  Start the builds for source and docs artifacts
Traceback (most recent call last):
  File "/Users/hugo/github/release-tools/run_release.py", line 1235, in <module>
    main()
  File "/Users/hugo/github/release-tools/run_release.py", line 1231, in main
    automata.run()
  File "/Users/hugo/github/release-tools/run_release.py", line 254, in run
    raise e from None
  File "/Users/hugo/github/release-tools/run_release.py", line 251, in run
    self.current_task(self.db)
  File "/Users/hugo/github/release-tools/run_release.py", line 189, in __call__
    return getattr(self, "function")(db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hugo/github/release-tools/run_release.py", line 769, in start_build_of_source_and_docs
    raise ReleaseException(
ReleaseException: Could not parse GitHub owner from 'origin' remote URL: https://github.com/hugovk/cpython.git

My clone has an origin like https://github.com/hugovk/cpython.git, which is what I get with GitHub HTTPS or GitHub CLI clones.

So allow an https:// prefix for HTTPS remotes.