Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grab latest version from GitHub Release tag #225

Merged
merged 8 commits into from
Jul 12, 2023
Merged

Conversation

thejcannon
Copy link
Member

As discussed in the latest Pants meetup and this proposal, we're going to move off of PyPI for distribution, and instead leverage GitHub Releases.

Some reasons given for this pivot:

  • People ought not to pip install pantsbuild.pants
  • We ought not to continue eating up PyPI space, which we're already hitting the ceiling for
  • We plan on having scie-pants use a PEX in the future, and PyPI wouldn't support that workflow
  • We want to abstract away, as much is reasonable, that Pants is implemented in Python. And treat it like a black box, where possible.

Currently the latest version is expected to be set by hand. Although that's unlikely to be wrong, we're also changing to have the "latest" marker be automated. Therefore we should be able to rely on it with confidence.

Tested and both before/after yielded the same string (with the GitHub URL performing slightly faster)

@thejcannon thejcannon requested review from jsirois and huonw July 12, 2023 01:55
"version"
]

latest_tag = ptex.fetch_json("https://github.com/pantsbuild/pants/releases/latest", Accept="application/json")["tag_name"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The good news is this is a normal public URL, and therefore (I assume) doesn't participate in the anonymous API rate limiting 🎉

@jsirois
Copy link
Contributor

jsirois commented Jul 12, 2023

I'll bow out. @kaos is a good reviewer for this I think.

@thejcannon thejcannon requested review from kaos and removed request for jsirois July 12, 2023 02:13
Copy link
Member

@kaos kaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

Left a few notes for your consideration.

tools/src/scie_pants/pants_version.py Outdated Show resolved Hide resolved
tools/src/scie_pants/pants_version.py Outdated Show resolved Hide resolved
Copy link
Member

@kaos kaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@thejcannon thejcannon merged commit bfae71a into main Jul 12, 2023
13 checks passed
@thejcannon thejcannon deleted the jcannon-latest-version branch July 12, 2023 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants