mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Allow passing filename to licenses script [ci] (#126951)
This commit is contained in:
parent
39a9634a5c
commit
317b73ffaf
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
@ -645,7 +645,7 @@ jobs:
|
||||
- name: Process licenses
|
||||
run: |
|
||||
. venv/bin/activate
|
||||
python -m script.licenses
|
||||
python -m script.licenses licenses.json
|
||||
|
||||
pylint:
|
||||
name: Check pylint
|
||||
@ -819,7 +819,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ${{ fromJson(needs.info.outputs.python_versions) }}
|
||||
name: Split tests for full run ${{ matrix.python-version }}
|
||||
name: Split tests for full run Python ${{ matrix.python-version }}
|
||||
steps:
|
||||
- name: Install additional OS dependencies
|
||||
run: |
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from collections.abc import Sequence
|
||||
from dataclasses import dataclass
|
||||
import json
|
||||
from pathlib import Path
|
||||
@ -174,11 +176,24 @@ TODO = {
|
||||
}
|
||||
|
||||
|
||||
def main() -> int:
|
||||
def main(argv: Sequence[str] | None = None) -> int:
|
||||
"""Run the main script."""
|
||||
raw_licenses = json.loads(Path("licenses.json").read_text())
|
||||
package_definitions = [PackageDefinition.from_dict(data) for data in raw_licenses]
|
||||
exit_code = 0
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument(
|
||||
"path",
|
||||
nargs="?",
|
||||
metavar="PATH",
|
||||
default="licenses.json",
|
||||
help="Path to json licenses file",
|
||||
)
|
||||
|
||||
argv = argv or sys.argv[1:]
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
raw_licenses = json.loads(Path(args.path).read_text())
|
||||
package_definitions = [PackageDefinition.from_dict(data) for data in raw_licenses]
|
||||
for package in package_definitions:
|
||||
previous_unapproved_version = TODO.get(package.name)
|
||||
approved = False
|
||||
|
Loading…
x
Reference in New Issue
Block a user