Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix CI problems after PR 44744 to compile www assets #45058

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions scripts/ci/pre_commit/compile_www_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from __future__ import annotations

import hashlib
import importlib.util
import os
import re
import shutil
Expand Down Expand Up @@ -75,17 +74,13 @@ def compile_assets(www_directory: Path, www_hash_file_name: str):
www_hash_file.write_text(new_hash)


def is_fab_provider_installed() -> bool:
return importlib.util.find_spec("airflow.providers.fab") is not None


if __name__ == "__main__":
# Compile assets for main
main_www_directory = AIRFLOW_SOURCES_PATH / "airflow" / "www"
compile_assets(main_www_directory, "hash.txt")
if is_fab_provider_installed():
# Compile assets for fab provider
fab_provider_www_directory = (
AIRFLOW_SOURCES_PATH / "providers" / "src" / "airflow" / "providers" / "fab" / "www"
)
# Compile assets for fab provider
fab_provider_www_directory = (
AIRFLOW_SOURCES_PATH / "providers" / "src" / "airflow" / "providers" / "fab" / "www"
)
if fab_provider_www_directory.exists():
compile_assets(fab_provider_www_directory, "hash_fab.txt")
Loading