Skip to content

Commit e369e34

Browse files
committed
Add compile check tooling and CI workflow
Signed-off-by: sduvvuri1603 <sduvvuri@redhat.com>
1 parent a097968 commit e369e34

File tree

4 files changed

+581
-4
lines changed

4 files changed

+581
-4
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+

__init__.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@
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]

0 commit comments

Comments
 (0)