<#18145 Package Pants as ~scie.> Issue created by ...
# github-notifications
q
#18145 Package Pants as ~scie. Issue created by jsirois Currently, and for most of its life, Pants has been distributed as one or more Python projects distributed on PyPI. Pants v2 has settled on the `pantsbuild.pants` project to deliver the
pants
console script and the `pantsbuild.pants.testutils` test infrastructure project for writing plugins whose code lives outside the https://github/com/pantsbuild/pants repo. The `./pants` script has been checked into Pants-using repos and used to install
pantsbuild.pants
in a venv and forward to its
pants
console script as the primary means of installing and running the right version of Pants in the right way in a repo. Recently, migration from the
./pants
script to the `scie-pants` binary has begun. The
scie-pants
binary works with the
pantsbuild.pants
PyPI project to maintain the status quo for installing and executing current and older Pants version but it also provides an avenue to alter: 1. Pants primary distribution channel (PyPI). 2. Pants secondary / utility distribution channel via our self-paid-for S3 bucket at binaries.pantsbuild.org. 3. Pants assembly as a primary Python distribution with embedded rust C-extension + a transitive dependency set. It's desirable to alter 1 - our primary PyPI distribution - to take load off PyPI's storage and transfer costs. We're currently in the top 50 users of storage space (31st using 36.5GB as of today, but see: https://pypi.org/stats/). Its desirable to alter 2 - our self-paid-for S3 bucket for similar reasons but for the Pantsbuild non-profit organization itself. If we alter 3 - Pants assembly - to a single or few file format, we can cut down on flaky transfers (one or few connections tends to be better in this regard) and gain easier insight into what makes up a Pants release. The natural alternative here is distribution as a PEX. Pants already does release a PEX via (GitHub Releases](https://github.com/pantsbuild/pants/releases), but it seems to be a little used facility. This is probably partially due to the current PEX being very large (it's multi-platform), partially to the https://pantsbuild.org docs not recommending it front and center and partially due to it being non-optimal - it adds latency over a pure venv. The scie-pants launcher could be altered to handle Pants released as a PEX on GitHub releases since it implements complex install logic efficiently and isolated from the hot path of a Pants run. One way of doing this would be to release a Pants.pex per supported platform (today: {Linux, Mac} x {x86_64, aarch64} along with a sha256 checksum of each of these PEXes. This would obviate the need for either PyPI (1) releases or pantsbuild.binaries.org (2) releases and - currently - cost the Pantsbuild organization nothing since GitHub releases are currently free without limits for OSS projects. To be clear, there is no magic here, we'd be getting away with murder and costing the world just as much in storage and transfer costs; we'd just be letting Microsoft foot the bill until we're forced to reconsider. If we transition to only releasing Pants as a PEX that is installed by
scie-pants
we can eliminate the pantsbuild.pants wheels and just directly add the Pants code to the PEX via
-D src/python
. This eliminates some BUILD jank partially tracked in #7344. It also allows us to eventually ship the Pants native client as a separate binary with sha256 checksums via GitHub Releases and use it as the hot-path executable scie-pants invokes. pantsbuild/pants