Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
!.github
!empty
!Dockerfile
!hatch_build.py

# This folder is for you if you want to add any packages to the docker context when you build your own
# docker image. most of other files and any new folder you add will be excluded by default
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ COPY generated/* ${AIRFLOW_SOURCES}/generated/
COPY constraints/* ${AIRFLOW_SOURCES}/constraints/
COPY LICENSE ${AIRFLOW_SOURCES}/LICENSE
COPY dev/airflow_pre_installed_providers.txt ${AIRFLOW_SOURCES}/dev/airflow_pre_installed_providers.txt
COPY dev/hatch_build.py ${AIRFLOW_SOURCES}/dev/hatch_build.py
COPY hatch_build.py ${AIRFLOW_SOURCES}/
COPY --from=scripts install_airflow.sh /scripts/docker/

# The goal of this line is to install the dependencies from the most current pyproject.toml from sources
Expand Down
6 changes: 3 additions & 3 deletions dev/hatch_build.py → hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
log_level = logging.getLevelName(os.getenv("CUSTOM_AIRFLOW_BUILD_LOG_LEVEL", "INFO"))
log.setLevel(log_level)

AIRFLOW_ROOT_PATH = Path(__file__).parent.parent.resolve()
AIRFLOW_ROOT_PATH = Path(__file__).parent.resolve()
GENERATED_PROVIDERS_DEPENDENCIES_FILE = AIRFLOW_ROOT_PATH / "generated" / "provider_dependencies.json"
DEV_DIR_PATH = AIRFLOW_ROOT_PATH / "dev"
PREINSTALLED_PROVIDERS_FILE = DEV_DIR_PATH / "airflow_pre_installed_providers.txt"
Expand Down Expand Up @@ -84,7 +84,7 @@ def clean(self, directory: str, versions: Iterable[str]) -> None:
run(cmd, cwd=work_dir.as_posix(), check=True, shell=True)

def get_version_api(self) -> dict[str, Callable[..., str]]:
"""Custom build target for standard package preparation."""
"""Get custom build target for standard package preparation."""
return {"standard": self.build_standard}

def build_standard(self, directory: str, artifacts: Any, **build_data: Any) -> str:
Expand Down Expand Up @@ -149,7 +149,7 @@ class CustomBuildHook(BuildHookInterface[BuilderConfig]):

def initialize(self, version: str, build_data: dict[str, Any]) -> None:
"""
This occurs immediately before each build.
Initialize hook immediately before each build.

Any modifications to the build data will be seen by the build target.
"""
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1221,13 +1221,13 @@ features = []
path = "airflow/__init__.py"

[tool.hatch.build.targets.wheel.hooks.custom]
path = "./dev/hatch_build.py"
path = "./hatch_build.py"

[tool.hatch.build.hooks.custom]
path = "./dev/hatch_build.py"
path = "./hatch_build.py"

[tool.hatch.build.targets.custom]
path = "./dev/hatch_build.py"
path = "./hatch_build.py"

[tool.hatch.build.targets.sdist]
include = [
Expand Down