Skip to content

Commit

Permalink
fix: make builds go fast again (#109)
Browse files Browse the repository at this point in the history
A recent pip/setuptools update made pep517 isolated builds the default. That's really good and I would like to use it but also it makes the builds incredibly slow: pypa/pip#10060 We need to keep pep517 because it's what allows pyproject tomls to specify build deps, but by preinstalling those build deps and turning off build isolation we can make it fast again. This isn't a good general purpose solution and it will surely break at some point when we add some new package but we can cross that bridge when we come to it
  • Loading branch information
sfoster1 authored Oct 2, 2023
1 parent f6b8779 commit 685c398
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions layers/meta-opentrons/classes/pipenv_app_bundle.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -149,24 +149,44 @@ PIP_ARGS := "--no-compile \
--no-binary :all: \
--progress-bar off \
--force-reinstall \
--no-deps \
-t ${PIPENV_APP_BUNDLE_SOURCE_VENV}"

do_compile () {
${PIP_ENVARGS} ${PYTHON} -m pip install \
mkdir -p ${B}/pip-buildenv

bbnote "Installing pypi packages"

${PYTHON} -m pip install \
-t ${B}/pip-buildenv \
hatchling flit flit-core setuptools==65.6.3 setuptools-scm[toml]==7.1.0 wheel==0.38.4 \


${PIP_ENVARGS} PYTHONPATH=${B}/pip-buildenv:${PYTHONPATH} ${PYTHON} -m pip install \
${PIP_ARGS} \
--no-build-isolation \
-r ${B}/pypi.txt \
${PIP_ARGS}


bbnote "Building and installing local packages"

${PIP_ENVARGS} ${PYTHON} -m pip install \
-r ${B}/local.txt \
--no-use-pep517 \
${PIP_ARGS} \
--no-deps \
--use-feature=in-tree-build
--use-feature=in-tree-build \


bbnote "Building and installing true source packages"

${PIP_ENVARGS} ${PYTHON} -m pip install \
${PIPENV_APP_BUNDLE_PROJECT_ROOT} \
--no-use-pep517 \
--use-feature=in-tree-build \
--no-deps \
${PIP_ARGS}
${PIP_ARGS} \


bbnote "Done installing python packages"
}

do_compile[vardeps] += "PIPENV_APP_BUNDLE_EXTRA_PIP_ENVARGS"
Expand Down

0 comments on commit 685c398

Please sign in to comment.