Skip to content

Commit 664e490

Browse files
authored
Update base image to 2023.10.0 (home-assistant#102126)
1 parent 1b73219 commit 664e490

File tree

7 files changed

+8
-60
lines changed

7 files changed

+8
-60
lines changed

.hadolint.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ ignored:
33
- DL3008
44
- DL3013
55
- DL3018
6+
- DL3042

Dockerfile

+2-14
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,29 @@ COPY requirements.txt homeassistant/
1414
COPY homeassistant/package_constraints.txt homeassistant/homeassistant/
1515
RUN \
1616
pip3 install \
17-
--no-cache-dir \
1817
--only-binary=:all: \
19-
--index-url "https://wheels.home-assistant.io/musllinux-index/" \
2018
-r homeassistant/requirements.txt
2119

2220
COPY requirements_all.txt home_assistant_frontend-* home_assistant_intents-* homeassistant/
2321
RUN \
2422
if ls homeassistant/home_assistant_frontend*.whl 1> /dev/null 2>&1; then \
25-
pip3 install \
26-
--no-cache-dir \
27-
--no-index \
28-
homeassistant/home_assistant_frontend-*.whl; \
23+
pip3 install homeassistant/home_assistant_frontend-*.whl; \
2924
fi \
3025
&& if ls homeassistant/home_assistant_intents*.whl 1> /dev/null 2>&1; then \
31-
pip3 install \
32-
--no-cache-dir \
33-
--no-index \
34-
homeassistant/home_assistant_intents-*.whl; \
26+
pip3 install homeassistant/home_assistant_intents-*.whl; \
3527
fi \
3628
&& \
3729
LD_PRELOAD="/usr/local/lib/libjemalloc.so.2" \
3830
MALLOC_CONF="background_thread:true,metadata_thp:auto,dirty_decay_ms:20000,muzzy_decay_ms:20000" \
3931
pip3 install \
40-
--no-cache-dir \
4132
--only-binary=:all: \
42-
--index-url "https://wheels.home-assistant.io/musllinux-index/" \
4333
-r homeassistant/requirements_all.txt
4434

4535
## Setup Home Assistant Core
4636
COPY . homeassistant/
4737
RUN \
4838
pip3 install \
49-
--no-cache-dir \
5039
--only-binary=:all: \
51-
--index-url "https://wheels.home-assistant.io/musllinux-index/" \
5240
-e ./homeassistant \
5341
&& python3 -m compileall \
5442
homeassistant/homeassistant

build.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
image: ghcr.io/home-assistant/{arch}-homeassistant
22
build_from:
3-
aarch64: ghcr.io/home-assistant/aarch64-homeassistant-base:2023.09.0
4-
armhf: ghcr.io/home-assistant/armhf-homeassistant-base:2023.09.0
5-
armv7: ghcr.io/home-assistant/armv7-homeassistant-base:2023.09.0
6-
amd64: ghcr.io/home-assistant/amd64-homeassistant-base:2023.09.0
7-
i386: ghcr.io/home-assistant/i386-homeassistant-base:2023.09.0
3+
aarch64: ghcr.io/home-assistant/aarch64-homeassistant-base:2023.10.0
4+
armhf: ghcr.io/home-assistant/armhf-homeassistant-base:2023.10.0
5+
armv7: ghcr.io/home-assistant/armv7-homeassistant-base:2023.10.0
6+
amd64: ghcr.io/home-assistant/amd64-homeassistant-base:2023.10.0
7+
i386: ghcr.io/home-assistant/i386-homeassistant-base:2023.10.0
88
codenotary:
99
1010
base_image: [email protected]

homeassistant/requirements.py

-3
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,8 @@ def pip_kwargs(config_dir: str | None) -> dict[str, Any]:
8585
is_docker = pkg_util.is_docker_env()
8686
kwargs = {
8787
"constraints": os.path.join(os.path.dirname(__file__), CONSTRAINT_FILE),
88-
"no_cache_dir": is_docker,
8988
"timeout": PIP_TIMEOUT,
9089
}
91-
if "WHEELS_LINKS" in os.environ:
92-
kwargs["find_links"] = os.environ["WHEELS_LINKS"]
9390
if not (config_dir is None or pkg_util.is_virtual_env()) and not is_docker:
9491
kwargs["target"] = os.path.join(config_dir, "deps")
9592
return kwargs

homeassistant/util/package.py

-6
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ def install_package(
6767
upgrade: bool = True,
6868
target: str | None = None,
6969
constraints: str | None = None,
70-
find_links: str | None = None,
7170
timeout: int | None = None,
72-
no_cache_dir: bool | None = False,
7371
) -> bool:
7472
"""Install a package on PyPi. Accepts pip compatible package strings.
7573
@@ -81,14 +79,10 @@ def install_package(
8179
args = [sys.executable, "-m", "pip", "install", "--quiet", package]
8280
if timeout:
8381
args += ["--timeout", str(timeout)]
84-
if no_cache_dir:
85-
args.append("--no-cache-dir")
8682
if upgrade:
8783
args.append("--upgrade")
8884
if constraints is not None:
8985
args += ["--constraint", constraints]
90-
if find_links is not None:
91-
args += ["--find-links", find_links, "--prefer-binary"]
9286
if target:
9387
assert not is_virtual_env()
9488
# This only works if not running in venv

tests/test_requirements.py

-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ async def test_requirement_installed_in_venv(hass: HomeAssistant) -> None:
4242
"package==0.0.1",
4343
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
4444
timeout=60,
45-
no_cache_dir=False,
4645
)
4746

4847

@@ -64,7 +63,6 @@ async def test_requirement_installed_in_deps(hass: HomeAssistant) -> None:
6463
target=hass.config.path("deps"),
6564
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
6665
timeout=60,
67-
no_cache_dir=False,
6866
)
6967

7068

@@ -379,10 +377,8 @@ async def test_install_with_wheels_index(hass: HomeAssistant) -> None:
379377

380378
assert mock_inst.call_args == call(
381379
"hello==1.0.0",
382-
find_links="https://wheels.hass.io/test",
383380
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
384381
timeout=60,
385-
no_cache_dir=True,
386382
)
387383

388384

@@ -406,7 +402,6 @@ async def test_install_on_docker(hass: HomeAssistant) -> None:
406402
"hello==1.0.0",
407403
constraints=os.path.join("ha_package_path", CONSTRAINT_FILE),
408404
timeout=60,
409-
no_cache_dir=True,
410405
)
411406

412407

tests/util/test_package.py

-27
Original file line numberDiff line numberDiff line change
@@ -194,33 +194,6 @@ def test_install_constraint(mock_sys, mock_popen, mock_env_copy, mock_venv) -> N
194194
assert mock_popen.return_value.communicate.call_count == 1
195195

196196

197-
def test_install_find_links(mock_sys, mock_popen, mock_env_copy, mock_venv) -> None:
198-
"""Test install with find-links on not installed package."""
199-
env = mock_env_copy()
200-
link = "https://wheels-repository"
201-
assert package.install_package(TEST_NEW_REQ, False, find_links=link)
202-
assert mock_popen.call_count == 2
203-
assert mock_popen.mock_calls[0] == call(
204-
[
205-
mock_sys.executable,
206-
"-m",
207-
"pip",
208-
"install",
209-
"--quiet",
210-
TEST_NEW_REQ,
211-
"--find-links",
212-
link,
213-
"--prefer-binary",
214-
],
215-
stdin=PIPE,
216-
stdout=PIPE,
217-
stderr=PIPE,
218-
env=env,
219-
close_fds=False,
220-
)
221-
assert mock_popen.return_value.communicate.call_count == 1
222-
223-
224197
async def test_async_get_user_site(mock_env_copy) -> None:
225198
"""Test async get user site directory."""
226199
deps_dir = "/deps_dir"

0 commit comments

Comments
 (0)