feat(mirrors): support URL-only MIRRORS entries and keep git config clean

- Allow MIRRORS to contain plain URLs (one per line) in addition to legacy "NAME URL"
- Treat strings as single URLs to avoid iterable pitfalls
- Write PyPI URLs as metadata-only entries (never added to git config)
- Keep MIRRORS as the single source of truth for mirror setup
- Update integration test to assert URL-only MIRRORS output

https://chatgpt.com/share/6941a9aa-b8b4-800f-963d-2486b34856b1
This commit is contained in:
Kevin Veen-Birkenbach
2025-12-16 19:49:09 +01:00
parent f995e3d368
commit 3cb7852cb4
3 changed files with 51 additions and 14 deletions

View File

@@ -75,12 +75,12 @@ class TestCreateRepoPypiNotInGitConfig(unittest.TestCase):
mirrors_content = mirrors_file.read_text(encoding="utf-8")
self.assertIn(
"pypi https://pypi.org/project/repo/",
"https://pypi.org/project/repo/",
mirrors_content,
"PyPI mirror entry must exist in MIRRORS",
)
self.assertIn(
"origin git@github.com:acme/repo.git",
"git@github.com:acme/repo.git",
mirrors_content,
"origin SSH URL must exist in MIRRORS",
)