Skip to content

Commit

Permalink
Add pip.conf with defaults (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Oct 18, 2023
1 parent a4cb9e5 commit 9e3f7f1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ignored:
- DL3018
- DL3003
- DL3006
- DL3013
- DL3003
- SC2155
- DL3018
- DL3042
- SC2086
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ ARG \
BUILD_ARCH \
CPYTHON_ABI \
QEMU_CPU \
AUDITWHEEL_VERSION=5.1.2
AUDITWHEEL_VERSION=5.1.2 \
PIP_EXTRA_INDEX_URL=https://wheels.home-assistant.io/musllinux-index/ \

WORKDIR /usr/src

SHELL ["/bin/bash", "-exo", "pipefail", "-c"]

COPY rootfs /

# Install requirements
COPY \
requirements.txt \
Expand Down Expand Up @@ -38,10 +41,9 @@ RUN \
apk add --no-cache --virtual .build-dependencies2 \
openblas-dev; \
fi \
&& pip3 install --no-cache-dir \
&& pip3 install \
-r /usr/src/requirements.txt \
-r /usr/src/requirements_${CPYTHON_ABI}.txt \
--extra-index-url "https://wheels.home-assistant.io/musllinux-index/" \
&& rm -rf /usr/src/*

# Install auditwheel
Expand All @@ -52,14 +54,14 @@ RUN \
https://github.com/pypa/auditwheel \
&& cd auditwheel \
&& git apply /usr/src/0001-Support-musllinux-armv6l.patch \
&& pip install --no-cache-dir . \
&& pip install . \
&& rm -rf /usr/src/*

# Install builder
COPY . /usr/src/builder/
RUN \
set -x \
&& pip3 install --no-cache-dir /usr/src/builder/ \
&& pip3 install /usr/src/builder/ \
&& rm -rf /usr/src/*

# Set build environment information
Expand All @@ -69,6 +71,5 @@ ENV \

# Runtime
WORKDIR /data
COPY rootfs /

ENTRYPOINT [ "run-builder.sh" ]
8 changes: 4 additions & 4 deletions builder/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def build_wheels_package(
constraint_cmd = f"--constraint {constraint}" if constraint else ""

run_command(
f'pip3 wheel --disable-pip-version-check --progress-bar off --no-clean --no-binary "{skip_binary}" --wheel-dir {output} --extra-index-url {index} {constraint_cmd} "{package}"',
f'pip3 wheel --no-clean --no-binary "{skip_binary}" --wheel-dir {output} --extra-index-url {index} {constraint_cmd} "{package}"',
env=build_env,
timeout=timeout,
)
Expand All @@ -50,7 +50,7 @@ def build_wheels_requirement(
constraint_cmd = f"--constraint {constraint}" if constraint else ""

run_command(
f'pip3 wheel --disable-pip-version-check --progress-bar off --no-clean --no-binary "{skip_binary}" --wheel-dir {output} --extra-index-url {index} {constraint_cmd} --requirement {requirement}',
f'pip3 wheel --no-clean --no-binary "{skip_binary}" --wheel-dir {output} --extra-index-url {index} {constraint_cmd} --requirement {requirement}',
env=build_env,
timeout=timeout,
)
Expand All @@ -68,7 +68,7 @@ def build_wheels_local(
build_env["MAKEFLAGS"] = f"-j{cpu}"

run_command(
f"pip3 wheel --disable-pip-version-check --progress-bar off --no-clean --wheel-dir {output} --extra-index-url {index} .",
f"pip3 wheel --no-clean --wheel-dir {output} --extra-index-url {index} .",
env=build_env,
)

Expand Down Expand Up @@ -119,5 +119,5 @@ def install_pips(index: str, pips: str) -> None:
packages = " ".join(pips.split(";"))

run_command(
f"pip install --disable-pip-version-check --progress-bar off --upgrade --no-cache-dir --prefer-binary --extra-index-url {index} {packages}",
f"pip install --upgrade --extra-index-url {index} {packages}",
)
7 changes: 7 additions & 0 deletions rootfs/etc/pip.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[global]
disable-pip-version-check = true
progress-bar = off

[install]
no-cache-dir = false
prefer-binary = true

0 comments on commit 9e3f7f1

Please sign in to comment.