From 85a42c3a418d59d55fc30945215bce3e453a2a52 Mon Sep 17 00:00:00 2001 From: Owen Rafferty Date: Wed, 27 Dec 2023 19:24:35 -0600 Subject: [PATCH] python-installer: new at 0.7.0 --- extra/python-installer/build | 11 ++++++++ extra/python-installer/checksums | 2 ++ extra/python-installer/depends | 1 + .../patches/default-bytecode-levels.patch | 26 +++++++++++++++++++ extra/python-installer/sources | 2 ++ extra/python-installer/version | 1 + 6 files changed, 43 insertions(+) create mode 100755 extra/python-installer/build create mode 100644 extra/python-installer/checksums create mode 100644 extra/python-installer/depends create mode 100644 extra/python-installer/patches/default-bytecode-levels.patch create mode 100644 extra/python-installer/sources create mode 100644 extra/python-installer/version diff --git a/extra/python-installer/build b/extra/python-installer/build new file mode 100755 index 00000000..bfd2fbea --- /dev/null +++ b/extra/python-installer/build @@ -0,0 +1,11 @@ +#!/bin/sh -e + +sitedir="$(python3 -c 'import site;print(site.getsitepackages()[0])')" + +unzip -d build installer-$2-py3-none-any.whl + +(cd build; patch -p1 < default-bytecode-levels.patch) + +mkdir -p "$1/$sitedir" +cp -pR build/installer* "$1/$sitedir" +python -m compileall "$1/$sitedir" diff --git a/extra/python-installer/checksums b/extra/python-installer/checksums new file mode 100644 index 00000000..fed1e0ab --- /dev/null +++ b/extra/python-installer/checksums @@ -0,0 +1,2 @@ +72790531eb73009974eca65759a7088ed1398cd009b85e5a243d1ea22102179bbc +8d93b38e8b441cfac476787bd834230c9dfb59f23ab6a4927ea127e07ad0a2543a diff --git a/extra/python-installer/depends b/extra/python-installer/depends new file mode 100644 index 00000000..fdc793e7 --- /dev/null +++ b/extra/python-installer/depends @@ -0,0 +1 @@ +python diff --git a/extra/python-installer/patches/default-bytecode-levels.patch b/extra/python-installer/patches/default-bytecode-levels.patch new file mode 100644 index 00000000..d588e66f --- /dev/null +++ b/extra/python-installer/patches/default-bytecode-levels.patch @@ -0,0 +1,26 @@ +the previous default of 0, 1 causes opt-1 bytecode to also be generated, +which is not used without passing `-O` to `python3` anyway, and doubles +the size of the resulting package + +diff --git a/installer/__main__.py b/installer/__main__.py +index 51014b9..2a389e8 100644 +--- a/installer/__main__.py ++++ b/installer/__main__.py +@@ -36,7 +36,7 @@ def _get_main_parser() -> argparse.ArgumentParser: + metavar="level", + type=int, + choices=[0, 1, 2], +- help="generate bytecode for the specified optimization level(s) (default=0, 1)", ++ help="generate bytecode for the specified optimization level(s) (default=0)", + ) + parser.add_argument( + "--no-compile-bytecode", +@@ -81,7 +81,7 @@ def _main(cli_args: Sequence[str], program: Optional[str] = None) -> None: + if args.no_compile_bytecode: + bytecode_levels = [] + elif not bytecode_levels: +- bytecode_levels = [0, 1] ++ bytecode_levels = [0] + + with WheelFile.open(args.wheel) as source: + destination = SchemeDictionaryDestination( diff --git a/extra/python-installer/sources b/extra/python-installer/sources new file mode 100644 index 00000000..c60fab83 --- /dev/null +++ b/extra/python-installer/sources @@ -0,0 +1,2 @@ +https://files.pythonhosted.org/packages/py3/i/installer/installer-0.7.0-py3-none-any.whl +patches/default-bytecode-levels.patch build diff --git a/extra/python-installer/version b/extra/python-installer/version new file mode 100644 index 00000000..a26a6e9a --- /dev/null +++ b/extra/python-installer/version @@ -0,0 +1 @@ +0.7.0 1