2023-11-08 22:28:49 -05:00
|
|
|
// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
|
|
|
// ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
|
|
|
|
|
// ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
|
|
|
|
|
// ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
|
|
|
|
|
// ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
|
|
|
|
|
// ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
|
|
|
|
|
// ┃ Copyright (c) 2017, the Perspective Authors. ┃
|
|
|
|
|
// ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
|
|
|
|
|
// ┃ This file is part of the Perspective library, distributed under the terms ┃
|
|
|
|
|
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
|
|
|
|
|
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
|
|
|
|
|
|
|
|
/// Use this script to update the `requirements-*.txt` files in the
|
|
|
|
|
/// `python/perspective` directory. This only needs to be done when the actual
|
|
|
|
|
/// dependencies _or_ supported Python versions change - to update these deps
|
|
|
|
|
/// otherwise is to invite the wrath of the CI gods.
|
|
|
|
|
|
|
|
|
|
import * as fs from "fs";
|
|
|
|
|
|
2025-09-27 22:13:38 -04:00
|
|
|
import "zx/globals";
|
|
|
|
|
|
2023-11-08 22:28:49 -05:00
|
|
|
const VERSIONS = [
|
|
|
|
|
// "3.7",
|
|
|
|
|
"3.8",
|
|
|
|
|
"3.9",
|
|
|
|
|
"3.10",
|
|
|
|
|
"3.11",
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
for (const version of VERSIONS) {
|
2025-09-27 22:13:38 -04:00
|
|
|
$.sync`
|
2023-11-01 16:24:40 -07:00
|
|
|
pip3 install "python/perspective[dev]"
|
2023-11-08 22:28:49 -05:00
|
|
|
--dry-run
|
|
|
|
|
--report=report.json
|
2023-11-01 16:24:40 -07:00
|
|
|
--python-version=${version}
|
|
|
|
|
--only-binary=:all:
|
|
|
|
|
--platform=manylinux_2_12_x86_64
|
|
|
|
|
--platform=manylinux_2_17_x86_64
|
|
|
|
|
--ignore-installed
|
2023-11-08 22:28:49 -05:00
|
|
|
--target=.
|
|
|
|
|
`.runSync();
|
|
|
|
|
|
|
|
|
|
const data = JSON.parse(fs.readFileSync("report.json"));
|
|
|
|
|
let output = "";
|
2023-11-01 16:24:40 -07:00
|
|
|
const sortedInstalls = data.install.toSorted((a, b) => {
|
|
|
|
|
if (a.metadata.name < b.metadata.name) return -1;
|
|
|
|
|
if (a.metadata.name > b.metadata.name) return 1;
|
|
|
|
|
return 0;
|
|
|
|
|
});
|
2023-11-17 15:50:46 -05:00
|
|
|
|
2023-11-08 22:28:49 -05:00
|
|
|
for (const {
|
|
|
|
|
metadata: { version, name },
|
2023-11-01 16:24:40 -07:00
|
|
|
} of sortedInstalls) {
|
2023-11-17 15:50:46 -05:00
|
|
|
if (name !== "perspective-python") {
|
|
|
|
|
output += `${name}==${version}\n`;
|
|
|
|
|
}
|
2023-11-08 22:28:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fs.writeFileSync(
|
|
|
|
|
`python/perspective/requirements/requirements-${version.replace(
|
|
|
|
|
".",
|
2025-09-28 13:56:29 -04:00
|
|
|
"",
|
2023-11-08 22:28:49 -05:00
|
|
|
)}.txt`,
|
2025-09-28 13:56:29 -04:00
|
|
|
output,
|
2023-11-08 22:28:49 -05:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fs.rmSync("report.json");
|