mirror of
https://github.com/home-assistant/core.git
synced 2026-08-03 20:24:55 +02:00
Remove requirements_test_all file (#171530)
This commit is contained in:
@@ -19,7 +19,6 @@ machine/* linguist-generated=true
|
|||||||
mypy.ini linguist-generated=true
|
mypy.ini linguist-generated=true
|
||||||
requirements.txt linguist-generated=true
|
requirements.txt linguist-generated=true
|
||||||
requirements_all.txt linguist-generated=true
|
requirements_all.txt linguist-generated=true
|
||||||
requirements_test_all.txt linguist-generated=true
|
|
||||||
requirements_test_pre_commit.txt linguist-generated=true
|
requirements_test_pre_commit.txt linguist-generated=true
|
||||||
script/hassfest/docker/Dockerfile linguist-generated=true
|
script/hassfest/docker/Dockerfile linguist-generated=true
|
||||||
.github/workflows/*.lock.yml linguist-generated=true
|
.github/workflows/*.lock.yml linguist-generated=true
|
||||||
|
|||||||
Vendored
+3
-3
@@ -132,7 +132,7 @@
|
|||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "Install all Requirements",
|
"label": "Install all production Requirements",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "uv pip install -r requirements_all.txt",
|
"command": "uv pip install -r requirements_all.txt",
|
||||||
"group": {
|
"group": {
|
||||||
@@ -146,9 +146,9 @@
|
|||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "Install all Test Requirements",
|
"label": "Install all (test & production) Requirements",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "uv pip install -r requirements.txt -r requirements_test_all.txt",
|
"command": "uv pip install -r requirements_all.txt -r requirements_test.txt",
|
||||||
"group": {
|
"group": {
|
||||||
"kind": "build",
|
"kind": "build",
|
||||||
"isDefault": true
|
"isDefault": true
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -9,7 +9,8 @@ cd "$(realpath "$(dirname "$0")/..")"
|
|||||||
echo "Installing development dependencies..."
|
echo "Installing development dependencies..."
|
||||||
uv pip install \
|
uv pip install \
|
||||||
-e . \
|
-e . \
|
||||||
-r requirements_test_all.txt \
|
-r requirements_all.txt \
|
||||||
|
-r requirements_test.txt \
|
||||||
colorlog \
|
colorlog \
|
||||||
--upgrade \
|
--upgrade \
|
||||||
--config-settings editable_mode=compat
|
--config-settings editable_mode=compat
|
||||||
|
|||||||
@@ -262,19 +262,6 @@ IGNORE_PRE_COMMIT_HOOK_ID = (
|
|||||||
PACKAGE_REGEX = re.compile(r"^(?:--.+\s)?([-_\.\w\d]+).*==.+$")
|
PACKAGE_REGEX = re.compile(r"^(?:--.+\s)?([-_\.\w\d]+).*==.+$")
|
||||||
|
|
||||||
|
|
||||||
def has_tests(module: str) -> bool:
|
|
||||||
"""Test if a module has tests.
|
|
||||||
|
|
||||||
Module format: homeassistant.components.hue
|
|
||||||
Test if exists: tests/components/hue/__init__.py
|
|
||||||
"""
|
|
||||||
path = (
|
|
||||||
Path(module.replace(".", "/").replace("homeassistant", "tests", 1))
|
|
||||||
/ "__init__.py"
|
|
||||||
)
|
|
||||||
return path.exists()
|
|
||||||
|
|
||||||
|
|
||||||
def explore_module(package: str, explore_children: bool) -> list[str]:
|
def explore_module(package: str, explore_children: bool) -> list[str]:
|
||||||
"""Explore the modules."""
|
"""Explore the modules."""
|
||||||
module = importlib.import_module(package)
|
module = importlib.import_module(package)
|
||||||
@@ -511,31 +498,6 @@ def requirements_all_action_output(reqs: dict[str, list[str]], action: str) -> s
|
|||||||
return "".join(output)
|
return "".join(output)
|
||||||
|
|
||||||
|
|
||||||
def requirements_test_all_output(reqs: dict[str, list[str]]) -> str:
|
|
||||||
"""Generate output for test_requirements."""
|
|
||||||
output = [
|
|
||||||
"# Home Assistant tests, full dependency set\n",
|
|
||||||
GENERATED_MESSAGE,
|
|
||||||
"-r requirements_test.txt\n",
|
|
||||||
]
|
|
||||||
|
|
||||||
filtered = {
|
|
||||||
requirement: modules
|
|
||||||
for requirement, modules in reqs.items()
|
|
||||||
if any(
|
|
||||||
# Always install requirements that are not part of integrations
|
|
||||||
not mdl.startswith("homeassistant.components.")
|
|
||||||
or
|
|
||||||
# Install tests for integrations that have tests
|
|
||||||
has_tests(mdl)
|
|
||||||
for mdl in modules
|
|
||||||
)
|
|
||||||
}
|
|
||||||
output.append(generate_requirements_list(filtered))
|
|
||||||
|
|
||||||
return "".join(output)
|
|
||||||
|
|
||||||
|
|
||||||
def requirements_pre_commit_output() -> str:
|
def requirements_pre_commit_output() -> str:
|
||||||
"""Generate output for pre-commit dependencies."""
|
"""Generate output for pre-commit dependencies."""
|
||||||
source = ".pre-commit-config.yaml"
|
source = ".pre-commit-config.yaml"
|
||||||
@@ -609,7 +571,6 @@ def main(validate: bool, ci: bool) -> int:
|
|||||||
action: requirements_all_action_output(data, action)
|
action: requirements_all_action_output(data, action)
|
||||||
for action in OVERRIDDEN_REQUIREMENTS_ACTIONS
|
for action in OVERRIDDEN_REQUIREMENTS_ACTIONS
|
||||||
}
|
}
|
||||||
reqs_test_all_file = requirements_test_all_output(data)
|
|
||||||
# Always calling requirements_pre_commit_output is intentional to ensure
|
# Always calling requirements_pre_commit_output is intentional to ensure
|
||||||
# the code is called by the pre-commit hooks.
|
# the code is called by the pre-commit hooks.
|
||||||
reqs_pre_commit_file = requirements_pre_commit_output()
|
reqs_pre_commit_file = requirements_pre_commit_output()
|
||||||
@@ -619,7 +580,6 @@ def main(validate: bool, ci: bool) -> int:
|
|||||||
("requirements.txt", reqs_file),
|
("requirements.txt", reqs_file),
|
||||||
("requirements_all.txt", reqs_all_file),
|
("requirements_all.txt", reqs_all_file),
|
||||||
("requirements_test_pre_commit.txt", reqs_pre_commit_file),
|
("requirements_test_pre_commit.txt", reqs_pre_commit_file),
|
||||||
("requirements_test_all.txt", reqs_test_all_file),
|
|
||||||
("homeassistant/package_constraints.txt", constraints),
|
("homeassistant/package_constraints.txt", constraints),
|
||||||
]
|
]
|
||||||
if ci:
|
if ci:
|
||||||
|
|||||||
Reference in New Issue
Block a user