File tree Expand file tree Collapse file tree 4 files changed +581
-4
lines changed
Expand file tree Collapse file tree 4 files changed +581
-4
lines changed Original file line number Diff line number Diff line change 1+ name : Compile and Validate Components
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - main
7+ workflow_dispatch :
8+
9+ jobs :
10+ compile-check :
11+ runs-on : ubuntu-24.04
12+
13+ steps :
14+ - name : Checkout repository
15+ uses : actions/checkout@v4
16+
17+ - name : Set up Python
18+ uses : actions/setup-python@v5
19+ with :
20+ python-version : " 3.10"
21+
22+ - name : Install uv
23+ uses : astral-sh/setup-uv@v3
24+ with :
25+ enable-cache : true
26+ cache-dependency-glob : |
27+ pyproject.toml
28+ third_party/pyproject.toml
29+
30+ - name : Install dependencies
31+ run : |
32+ uv pip install --system . pytest packaging pyyaml
33+
34+ - name : Run compile check
35+ run : |
36+ python scripts/compile_check.py --tier all
37+
38+ - name : Run unit tests
39+ run : |
40+ python -m pytest scripts/test_compile_check.py
41+
Original file line number Diff line number Diff line change 99 from kubeflow.pipelines.components.pipelines import evaluation
1010"""
1111
12- # Import submodules to enable the convenient import patterns shown above
13- # These imports ensure reliable access to submodules and better IDE support
14- from . import components
15- from . import pipelines
12+ # Import submodules to enable the convenient import patterns shown above.
13+ # When this module is imported as part of the installed package the relative
14+ # imports below work naturally. During certain tooling scenarios (e.g. pytest
15+ # collecting this file directly from the repo root) Python treats this module
16+ # as top-level and `__package__` is empty, so we fall back to absolute imports.
17+ if __package__ in (None , "" ):
18+ from importlib import import_module
19+
20+ components = import_module ("kubeflow.pipelines.components.components" )
21+ pipelines = import_module ("kubeflow.pipelines.components.pipelines" )
22+ else :
23+ from . import components # type: ignore[F401] # re-export for consumers
24+ from . import pipelines # type: ignore[F401]
You can’t perform that action at this time.
0 commit comments