diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 26a6a7e..bb2fa60 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -35,6 +35,7 @@ jobs: - name: Run packaging step env: UV_PYTHON: "3.12" + UV_PYTHON_PREFERENCE: only-managed ISIC_CLI_SENTRY_DSN: ${{ secrets.ISIC_CLI_SENTRY_DSN }} run: | uv run tox -e package @@ -71,6 +72,11 @@ jobs: uv run tox -e package env: ISIC_CLI_SENTRY_DSN: ${{ secrets.ISIC_CLI_SENTRY_DSN }} + # the runners ship a python.org build of Python on PATH, which uv picks over downloading + # a managed one. python.org builds split the stdlib into ~50 separate extension modules, + # and on macOS every freshly extracted shared library costs ~120ms per launch of the + # onefile binary. python-build-standalone compiles them into libpython. + UV_PYTHON_PREFERENCE: only-managed - name: Zip and upload binary run: | .github/zip_and_upload_package.sh ${{ runner.os }} ${{ github.event.release.tag_name }} diff --git a/tox.ini b/tox.ini index 32c910f..4ac6edc 100644 --- a/tox.ini +++ b/tox.ini @@ -45,6 +45,12 @@ passenv = ISIC_CLI_SENTRY_DSN dependency_groups = package +# charset_normalizer ships mypyc-compiled extensions with pure python fallbacks. on macOS, each +# shared library extracted by the onefile binary costs ~120ms per launch, so build it from source +# to get the pure python version instead. +uv_sync_flags = + --no-binary-package + charset-normalizer commands = python scripts/write_sentry_dsn_module.py {env_tmp_dir}/sentry_dsn/_isic_cli_sentry_dsn.py pyinstaller \