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
5 changes: 2 additions & 3 deletions .github/workflows/test-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ jobs:
echo "Installing Papermill and Jupyter"
pip install papermill==2.6.0 jupyter==1.1.1 ipykernel==6.29.5

echo "Installing Kubeflow SDK locally from ./python"
# This path (./python) is relative to the *main* repository checkout (kubeflow/sdk)
pip install ./python
echo "Installing Kubeflow SDK locally"
pip install .
working-directory: . # Ensure pip runs from the SDK repo root

- name: Setup cluster
Expand Down
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ repos:
rev: v0.4.4
hooks:
- id: ruff
args: [--select=E,F,W]
exclude: |
(?x)^(
python/kubeflow/trainer/__init__.py|
python/kubeflow/trainer/api/__init__.py|
python/kubeflow/trainer/models/.*|
kubeflow/trainer/__init__.py|
kubeflow/trainer/api/__init__.py|
kubeflow/trainer/models/.*|
)$
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ source .venv/bin/activate

Install dependencies in editable mode:
```sh
cd python
pip install -e .
```

Expand Down
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec

PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))

PY_DIR := $(PROJECT_DIR)/python
VENV_DIR := $(PROJECT_DIR)/.venv

##@ General
Expand Down Expand Up @@ -54,8 +52,8 @@ ruff: ## Install Ruff

.PHONY: verify
verify: uv uv-venv ruff ## install all required tools
@cd $(PY_DIR) && uv lock --check
@cd $(PY_DIR) && uvx ruff check --show-fixes
@uv lock --check
@uvx ruff check --show-fixes

.PHONY: uv-venv
uv-venv:
Expand All @@ -69,8 +67,8 @@ uv-venv:
# make test-python will produce html coverage by default. Run with `make test-python report=xml` to produce xml report.
.PHONY: test-python
test-python: uv-venv
@uv pip install -e "$(PY_DIR)[dev]"
@uv run coverage run --source=kubeflow.trainer.api.trainer_client,kubeflow.trainer.utils.utils -m pytest ./python/kubeflow/trainer/api/trainer_client_test.py
@uv pip install -e ".[dev]"
@uv run coverage run --source=kubeflow.trainer.api.trainer_client,kubeflow.trainer.utils.utils -m pytest ./kubeflow/trainer/api/trainer_client_test.py
@uv run coverage report -m kubeflow/trainer/api/trainer_client.py kubeflow/trainer/utils/utils.py
ifeq ($(report),xml)
@uv run coverage xml
Expand Down
15 changes: 15 additions & 0 deletions kubeflow/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2025 The Kubeflow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.1.0"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

from __future__ import absolute_import

__version__ = "0.1.0"

# Import the Kubeflow Trainer client.
from kubeflow.trainer.api.trainer_client import TrainerClient # noqa: F401

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 4 additions & 5 deletions python/pyproject.toml → pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ requires-python = ">=3.9"
authors = [
{ name = "The Kubeflow Authors", email = "kubeflow-discuss@googlegroups.com" },
]
license = { file = "../LICENSE" }
license = "Apache-2.0"
license-files = ["LICENSE"]
description = "Kubeflow Python SDK to manage ML workloads and to interact with Kubeflow APIs."
readme = "../README.md"
readme = "README.md"
keywords = ["kubeflow", "trainer", "model training", "llm", "ai"]
classifiers = [
"Intended Audience :: Developers",
Expand Down Expand Up @@ -46,7 +47,7 @@ Documentation = "https://www.kubeflow.org/docs/components"
Source = "https://github.com/kubeflow/sdk"

[tool.hatch.version]
path = "kubeflow/trainer/__init__.py"
path = "kubeflow/__init__.py"

[tool.ruff]
line-length = 100
Expand All @@ -55,8 +56,6 @@ line-length = 100
select = ["E", "F", "W"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we also move version file to: kubeflow/__init__.py ?

sdk/pyproject.toml

Lines 49 to 50 in 1c115c6

[tool.hatch.version]
path = "kubeflow/trainer/__init__.py"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that makes sense!

ignore = ["E203"]



[tool.uv]
package = true

Expand Down
Empty file.
File renamed without changes.