typeshed-internal / stub_uploader

Scripts and actions to auto-upload typeshed stubs to PyPI
Apache License 2.0
21 stars 16 forks source link

Finish changing versioning scheme #60

Closed hauntsaninja closed 1 year ago

hauntsaninja commented 2 years ago

This change was removed from #57, so as to make that PR more a refactoring. The changes here accomplish two things:

First, allows us to change the specificity of how we pin versions in typeshed while ensuring that users who install without pinning versions still get the latest stub.

Second, incrementing the fourth position helps disambiguate "upstream version" from "types version", reducing user confusion. See my comment here: https://github.com/typeshed-internal/stub_uploader/pull/57#discussion_r956395229

We can wait longer if we're suspicious of #57, but there have been a half dozen stub uploads since then. Please let me know if there are any tests I could add that would be worthwhile.

hauntsaninja commented 1 year ago

I don't have permissions on this repo to merge, so one of you two would need to do it :-)

We test that all of the asserts hold when incrementing all currently existing package versions here: https://github.com/typeshed-internal/stub_uploader/blob/4588d577d7d1af180d2f0794437d1c1e78afeac3/tests/test_integration.py#L37

I also just locally added:

diff --git a/stub_uploader/get_version.py b/stub_uploader/get_version.py
index 9c5bfd1..c2c4bd7 100644
--- a/stub_uploader/get_version.py
+++ b/stub_uploader/get_version.py
@@ -139,4 +139,5 @@ def determine_incremented_version(metadata: Metadata) -> str:
     version = compute_incremented_version(
         metadata.version_spec, published_stub_versions
     )
+    print(f"{metadata.stub_distribution:<40}\t{str(version):<12} {str(metadata.version_spec):<10} {max(published_stub_versions)}")
     return str(version)

and ran pytest -s -k test_version_increment and the results all look expected to me