commit | bc39453c8aa8c6bbe8c971fcf07d3fbbd01d2df2 | [log] [tgz] |
---|---|---|
author | Oliver Newman <olivernewman@google.com> | Mon Apr 19 14:49:42 2021 -0700 |
committer | Oliver Newman <olivernewman@google.com> | Mon Apr 19 15:17:11 2021 -0700 |
tree | 59dc08b22521a1496008c50874e3cce603abc234 | |
parent | 2bce9a0360673151bc2db0fc67db200d610a5c03 [diff] |
[black] Stop using PyOxidizer Distributing Black with PyOxidizer is great when it works well, but has a number of issues: - It's difficult to build a distributable version of the tool that works on any version of Linux (requires running on a bot with an old version of glibc). - Black uses multiprocessing to parallelize formatting of multiple files, and PyOxidizer doesn't support multiprocessing very well, especially on Mac and Linux (https://github.com/indygreg/PyOxidizer/issues/111). - Requires installing the Rust toolchain locally in order to build Black. After spending several hours today trying to get it working in order to publish the latest version of Black, I gave up and created a sort of ad-hoc packaging scheme where we bundle a pip-installed Black along with a prebuilt Python. So it's not a single executable file, but it's at least self-contained. It would *probably* be fine to not even bundle a python prebuilt and use system python instead, which would also slim down the package size. However, probably best not to assume that the user has a compatible version of Python locally. Test (a run of the tricium-recipes builder using the updated version): https://ci.chromium.org/swarming/task/5304dd1ee8a4cf10 Bug: 74877 Change-Id: I0819fce71a1602b0bbc7a7c6dcbad317dd45f308
This contains configuration useful in updating the black package in CIPD.
On both a Mac machine and a Linux machine, checkout this repository and update the pinned version of Black in publish.sh
. Then run ./publish.sh
, which will download and package all of Black's dependencies (including a prebuilt Python interpreter) and publish the results to CIPD.