Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pip.conf with defaults #641

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@
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 \
requirements_${CPYTHON_ABI}.txt \
/usr/src/
RUN \

Check failure on line 22 in Dockerfile

View workflow job for this annotation

GitHub Actions / Hadolint

DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`
apk add --no-cache \
rsync \
openssh-client \
Expand All @@ -38,28 +41,27 @@
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
COPY 0001-Support-musllinux-armv6l.patch /usr/src/
RUN \

Check failure on line 51 in Dockerfile

View workflow job for this annotation

GitHub Actions / Hadolint

DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`
set -x \
&& git clone --depth 1 -b ${AUDITWHEEL_VERSION} \
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 \

Check failure on line 62 in Dockerfile

View workflow job for this annotation

GitHub Actions / Hadolint

DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`
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 @@

# 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