Merge pull request #270456 from mweinelt/hass-cleanup
home-assistant: some clean up
This commit is contained in:
commit
c76b72caa4
1 changed files with 26 additions and 37 deletions
|
@ -352,10 +352,32 @@ in python.pkgs.buildPythonApplication rec {
|
|||
};
|
||||
|
||||
nativeBuildInputs = with python.pkgs; [
|
||||
pythonRelaxDepsHook
|
||||
setuptools
|
||||
wheel
|
||||
];
|
||||
|
||||
pythonRelaxDeps = [
|
||||
"aiohttp"
|
||||
"attrs"
|
||||
"awesomeversion"
|
||||
"bcrypt"
|
||||
"ciso8601"
|
||||
"cryptography"
|
||||
"home-assistant-bluetooth"
|
||||
"httpx"
|
||||
"ifaddr"
|
||||
"orjson"
|
||||
"pip"
|
||||
"PyJWT"
|
||||
"pyOpenSSL"
|
||||
"PyYAML"
|
||||
"requests"
|
||||
"typing-extensions"
|
||||
"voluptuous-serialize"
|
||||
"yarl"
|
||||
];
|
||||
|
||||
# copy tests early, so patches apply as they would to the git repo
|
||||
prePatch = ''
|
||||
cp --no-preserve=mode --recursive ${gitSrc}/tests ./
|
||||
|
@ -374,33 +396,7 @@ in python.pkgs.buildPythonApplication rec {
|
|||
})
|
||||
];
|
||||
|
||||
postPatch = let
|
||||
relaxedConstraints = [
|
||||
"aiohttp"
|
||||
"attrs"
|
||||
"awesomeversion"
|
||||
"bcrypt"
|
||||
"ciso8601"
|
||||
"cryptography"
|
||||
"home-assistant-bluetooth"
|
||||
"httpx"
|
||||
"ifaddr"
|
||||
"orjson"
|
||||
"pip"
|
||||
"PyJWT"
|
||||
"pyOpenSSL"
|
||||
"PyYAML"
|
||||
"requests"
|
||||
"typing-extensions"
|
||||
"voluptuous-serialize"
|
||||
"yarl"
|
||||
];
|
||||
in ''
|
||||
sed -r -i \
|
||||
${lib.concatStringsSep "\n" (map (package:
|
||||
''-e 's/${package}[<>=]+.*/${package}",/g' \''
|
||||
) relaxedConstraints)}
|
||||
pyproject.toml
|
||||
postPatch = ''
|
||||
substituteInPlace tests/test_config.py --replace '"/usr"' '"/build/media"'
|
||||
|
||||
sed -i 's/setuptools[~=]/setuptools>/' pyproject.toml
|
||||
|
@ -436,6 +432,9 @@ in python.pkgs.buildPythonApplication rec {
|
|||
voluptuous
|
||||
voluptuous-serialize
|
||||
yarl
|
||||
# REQUIREMENTS in homeassistant/auth/mfa_modules/totp.py and homeassistant/auth/mfa_modules/notify.py
|
||||
pyotp
|
||||
pyqrcode
|
||||
# Implicit dependency via homeassistant/requirements.py
|
||||
setuptools
|
||||
];
|
||||
|
@ -462,16 +461,12 @@ in python.pkgs.buildPythonApplication rec {
|
|||
respx
|
||||
syrupy
|
||||
tomli
|
||||
# required through tests/auth/mfa_modules/test_otp.py
|
||||
pyotp
|
||||
# Sneakily imported in tests/conftest.py
|
||||
paho-mqtt
|
||||
] ++ lib.concatMap (component: getPackages component python.pkgs) [
|
||||
# some components are needed even if tests in tests/components are disabled
|
||||
"default_config"
|
||||
"hue"
|
||||
# for tests/test_config.py::test_merge_id_schema
|
||||
"qwikswitch"
|
||||
];
|
||||
|
||||
pytestFlagsArray = [
|
||||
|
@ -484,12 +479,6 @@ in python.pkgs.buildPythonApplication rec {
|
|||
"--showlocals"
|
||||
# AssertionError: assert 1 == 0
|
||||
"--deselect tests/test_config.py::test_merge"
|
||||
# AssertionError: assert 2 == 1
|
||||
"--deselect=tests/helpers/test_translation.py::test_caching"
|
||||
# AssertionError: assert None == RegistryEntry
|
||||
"--deselect=tests/helpers/test_entity_registry.py::test_get_or_create_updates_data"
|
||||
# AssertionError: assert 2 == 1
|
||||
"--deselect=tests/helpers/test_entity_values.py::test_override_single_value"
|
||||
# AssertionError: assert 'WARNING' not in '2023-11-10 ...nt abc[L]>\n'"
|
||||
"--deselect=tests/helpers/test_script.py::test_multiple_runs_repeat_choose"
|
||||
# tests are located in tests/
|
||||
|
|
Loading…
Reference in a new issue