mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +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
|
- name: Process licenses
|
||||||
run: |
|
run: |
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
python -m script.licenses
|
python -m script.licenses licenses.json
|
||||||
|
|
||||||
pylint:
|
pylint:
|
||||||
name: Check pylint
|
name: Check pylint
|
||||||
@ -819,7 +819,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ${{ fromJson(needs.info.outputs.python_versions) }}
|
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:
|
steps:
|
||||||
- name: Install additional OS dependencies
|
- name: Install additional OS dependencies
|
||||||
run: |
|
run: |
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from argparse import ArgumentParser
|
||||||
|
from collections.abc import Sequence
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
import json
|
import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@ -174,11 +176,24 @@ TODO = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def main() -> int:
|
def main(argv: Sequence[str] | None = None) -> int:
|
||||||
"""Run the main script."""
|
"""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
|
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:
|
for package in package_definitions:
|
||||||
previous_unapproved_version = TODO.get(package.name)
|
previous_unapproved_version = TODO.get(package.name)
|
||||||
approved = False
|
approved = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user