Teaser for an unfortunately large code review comi...
# development
e
Teaser for an unfortunately large code review coming later today.
No
./pants
script:
Copy code
$ ls -l pants
ls: cannot access 'pants': No such file or directory
$ ls -ld pants*
drwxr-xr-x 3 jsirois jsirois 4096 Dec  8 12:47 pants-support
-rw-r--r-- 1 jsirois jsirois 1525 Dec  9 11:00 pants.toml
No
python
or much of anything else really:
Copy code
$ docker run --rm -it -w /code/tools/src -e pants=/code/dist/scie-pants-linux-x86_64 -v $PWD:/code ubuntu:22.04 sh -c 'apt update -qq >/dev/null 2>&1 && apt install -qq -y ca-certificates >/dev/null 2>&1 && RUST_LOG=info $pants fmt lint check test ::'
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
[INFO  scie_pants] Found Pants build root at /code
[INFO  scie_pants] The required Pants version is Some(PackageVersion { original: "2.14.0", local: None, dev: None, post: None, pre: None, release: ReleaseHeader { major: 2, minor: 14 }, epoch: None })
[INFO  scie_pants] Selected python3.9
[INFO  jump::installer] Loading cpython-3.9.15+20221106-x86_64-unknown-linux-gnu-install_only.tar.gz via "/root/.cache/nce/022ba7613a5161d70343e145a3e9d6172cadbaafe8a06a05e92faa18abc55ee5/ptex-linux-x86_64"...
Downloading <https://github.com/indygreg/python-build-standalone/releases/download/20221106/cpython-3.9.15+20221106-x86_64-unknown-linux-gnu-install_only.tar.gz>...
[00:00:04] [####################>---------] 17.61 MiB/25.53 MiB (eta: 1.6s)
Bootstrapping Pants 2.14.0 using cpython 3.9.15
Installing pantsbuild.pants==2.14.0 into a virtual environment at /root/.cache/nce/8293dce4feac81e501481d0d699917394caf20e77b6a2e25573cc437d2903e8a/bindings/venvs/2.14.0
New virtual environment successfully created at /root/.cache/nce/8293dce4feac81e501481d0d699917394caf20e77b6a2e25573cc437d2903e8a/bindings/venvs/2.14.0.
18:51:30.75 [INFO] Initializing scheduler...
18:51:30.92 [INFO] Scheduler initialized.
18:51:41.38 [INFO] Completed: Building black.pex from pants-support/tool-locks/black.lock
18:51:41.66 [INFO] Completed: Format with Black - black made no changes.
18:51:45.07 [INFO] Completed: Building isort.pex from pants-support/tool-locks/isort.lock
18:51:45.25 [INFO] Completed: Format with isort - isort made no changes.

✓ black made no changes.
✓ isort made no changes.

✓ black succeeded.
✓ isort succeeded.
18:51:45.44 [INFO] Canceled: Building mypy.pex from pants-support/tool-locks/mypy.lock
18:51:46.21 [INFO] Completed: Building extra_type_stubs.pex
18:51:56.66 [INFO] Completed: Building 4 requirements for requirements.pex from the tools/lock.json resolve: ansicolors==1.1.8, packaging==22.0, pytest==7.2.0, tomlkit==0.11.6
18:51:57.62 [INFO] Completed: Building mypy.pex from pants-support/tool-locks/mypy.lock
18:51:58.90 [INFO] Completed: Building requirements_venv.pex
18:52:04.02 [INFO] Completed: Typecheck using MyPy - mypy succeeded.
Success: no issues found in 8 source files



✓ mypy succeeded.
18:52:04.04 [ERROR] 1 Exception encountered:

  BinaryNotFoundError: Cannot find `unzip` on `['/bin', '/usr/bin', '/usr/local/bin']`. Please ensure that it is installed so that Pants can download the tools Pants needs to run.
🤯 2
❤️ 1
b
We're on the precipice of some very exciting changes to Pants
I'm just happy to have contributed, and to be riding the wave 🙂
e
This is not one of them, pretty boring. The new thing does nothing different from the old thing, just saves a ~5% footgun?
b
I very humbly disagree 🙂 Decoupling Pants from system Python is an amazing step forward for every Pants user.
1
Not to mention the capabilities of Pants' own code to use newer features
e
It can't be too amazing, we've survived 10 years without it ~just fine. It will certainly help some folks not get turned away though.
b
In a "lift by a thousand breezes" some breezes can certainly be stronger than others 😉
e
The hardest thing here was actually getting the scie-pants to build with pants. I initially used tox for the Python installer code it runs when it needs to do an install or run
PANTS_BOOTSTRAP_TOOLS
, etc. The transition from tox to Pants was a bit of a bear, but that was at least in part due to weird circular dogfooding and my tired brain.
w
If nothing else, this should save a handful of questions in Slack/issues/discussions about the fact that Pants requires certain python versions, but the user's code can use whatever.
1
🙌 1
f
I think this is huge for first-run and infrequent-user use cases. being able to have git or wget+tar as the only system dependency is so nice.