Skip to content

Commit

Permalink
Use custom packages in CI as dependnecies
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Dec 19, 2024
1 parent 33287b7 commit 18b1372
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions scripts/check_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,19 @@
]

LOCAL_DEPENDENCIES = {
"types-aiobotocore-lite": ["types_aiobotocore_lite_package", "types_aiobotocore_package"],
"types-aioboto3-lite": ["types_aioboto3_lite_package", "types_aioboto3_package"],
"types-aiobotocore-lite": [
"types_aioboto3_custom_package",
"types_aiobotocore_custom_package",
"types_aiobotocore_lite_package",
"types_aiobotocore_package",
],
"types-aioboto3-lite": [
"types_aioboto3_custom_package",
"types_aioboto3_lite_package",
"types_aioboto3_package",
],
"types-boto3-lite": [
"types_boto3_custom_package",
"types_boto3_lite_package",
"types_boto3_package",
"boto3_stubs_lite_package",
Expand Down Expand Up @@ -362,7 +372,7 @@ def run_import(path: Path) -> None:
if not (path / "__main__.py").exists():
return

run_cmd = [
cmd = [
"uv",
"run",
"-q",
Expand All @@ -373,8 +383,9 @@ def run_import(path: Path) -> None:
"-c",
f"import {path.name}",
]
Config.logger.debug(f"Running subprocess: {' '.join(cmd)}")
try:
subprocess.check_call(run_cmd, stdout=subprocess.DEVNULL)
subprocess.check_call(cmd, stdout=subprocess.DEVNULL)
except subprocess.CalledProcessError as e:
raise CheckError(path, f"Cannot be imported: {e}") from None

Expand Down Expand Up @@ -426,14 +437,16 @@ def get_package_paths() -> tuple[Path, ...]:
if not directory.name.endswith("_package"):
continue

if Config.args.filter and not any(
s in directory.relative_to(Config.args.path).as_posix() for s in Config.args.filter
):
continue
for package_path in directory.iterdir():
if not is_package_dir(package_path):
continue
if Config.args.filter and not any(
i in package_path.as_posix() for i in Config.args.filter
):
continue

result.append(package_path)

result.extend(
package_path for package_path in directory.iterdir() if is_package_dir(package_path)
)
result.sort(key=lambda x: x.name)
return tuple(result)

Expand Down

0 comments on commit 18b1372

Please sign in to comment.