From 7fb227fd44ce09d9b71e8c73c9f2d8a6fbc7f580 Mon Sep 17 00:00:00 2001 From: kramaranya Date: Fri, 1 Aug 2025 08:43:50 +0100 Subject: [PATCH 1/7] update testing info in CONTRIBUTING.md Signed-off-by: kramaranya --- CONTRIBUTING.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 24671919..634dc60e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,6 +52,14 @@ To run the unit tests (if present), execute: pytest ``` +#### Development Testing +For development and before submitting PRs, run: +```sh +make test-python-dev +``` + +This tests against latest master branch dependencies to catch integration issues early. + ### Code Coverage To run tests and measure coverage: ```sh From f2402ae804faff8fe99dc73ac8c252751f9c5dc1 Mon Sep 17 00:00:00 2001 From: kramaranya Date: Wed, 6 Aug 2025 23:58:02 +0100 Subject: [PATCH 2/7] move pyproject to the root dict Signed-off-by: kramaranya --- .github/workflows/test-e2e.yaml | 5 ++--- .pre-commit-config.yaml | 1 - CONTRIBUTING.md | 1 - Makefile | 10 ++++------ python/pyproject.toml => pyproject.toml | 13 ++++++------- python/uv.lock => uv.lock | 0 6 files changed, 12 insertions(+), 18 deletions(-) rename python/pyproject.toml => pyproject.toml (91%) rename python/uv.lock => uv.lock (100%) diff --git a/.github/workflows/test-e2e.yaml b/.github/workflows/test-e2e.yaml index 1a2fb6f3..85176384 100644 --- a/.github/workflows/test-e2e.yaml +++ b/.github/workflows/test-e2e.yaml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 357f28c7..11f20319 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,6 @@ repos: rev: v0.4.4 hooks: - id: ruff - args: [--select=E,F,W] exclude: | (?x)^( python/kubeflow/trainer/__init__.py| diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 634dc60e..3fc186bb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,7 +24,6 @@ source .venv/bin/activate Install dependencies in editable mode: ```sh -cd python pip install -e . ``` diff --git a/Makefile b/Makefile index e8f5eb37..2d1f5b68 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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: @@ -69,9 +67,9 @@ 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 pip install -e ".[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 run coverage report -m kubeflow/trainer/api/trainer_client.py kubeflow/trainer/utils/utils.py + @uv run coverage report -m python/kubeflow/trainer/api/trainer_client.py python/kubeflow/trainer/utils/utils.py ifeq ($(report),xml) @uv run coverage xml else diff --git a/python/pyproject.toml b/pyproject.toml similarity index 91% rename from python/pyproject.toml rename to pyproject.toml index 6f0e8aa9..274309bf 100644 --- a/python/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -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 = "python/kubeflow/trainer/__init__.py" [tool.ruff] line-length = 100 @@ -55,8 +56,6 @@ line-length = 100 select = ["E", "F", "W"] ignore = ["E203"] - - [tool.uv] package = true @@ -64,8 +63,8 @@ package = true requires = ["hatchling"] build-backend = "hatchling.build" -[tool.hatch.build.targets] -packages = ["kubeflow"] +[tool.hatch.build.targets.wheel] +sources = ["python"] [tool.hatch.metadata] allow-direct-references = true diff --git a/python/uv.lock b/uv.lock similarity index 100% rename from python/uv.lock rename to uv.lock From 92dd3b0e8216506e7caa158626e1fa9e9bc9f2cb Mon Sep 17 00:00:00 2001 From: kramaranya Date: Thu, 7 Aug 2025 00:05:37 +0100 Subject: [PATCH 3/7] update CONTRIBUTING Signed-off-by: kramaranya --- CONTRIBUTING.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3fc186bb..05117859 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,14 +51,6 @@ To run the unit tests (if present), execute: pytest ``` -#### Development Testing -For development and before submitting PRs, run: -```sh -make test-python-dev -``` - -This tests against latest master branch dependencies to catch integration issues early. - ### Code Coverage To run tests and measure coverage: ```sh From 72fd16c9e01d33e38e8b0098ba02ba4b27dfcd05 Mon Sep 17 00:00:00 2001 From: kramaranya Date: Thu, 7 Aug 2025 07:41:35 +0100 Subject: [PATCH 4/7] remove python directory Signed-off-by: kramaranya --- .pre-commit-config.yaml | 6 +++--- Makefile | 4 ++-- {python/kubeflow => kubeflow}/__init__.py | 0 {python/kubeflow => kubeflow}/py.typed | 0 {python/kubeflow => kubeflow}/trainer/__init__.py | 0 {python/kubeflow => kubeflow}/trainer/api/__init__.py | 0 {python/kubeflow => kubeflow}/trainer/api/trainer_client.py | 0 .../trainer/api/trainer_client_test.py | 0 {python/kubeflow => kubeflow}/trainer/constants/__init__.py | 0 .../kubeflow => kubeflow}/trainer/constants/constants.py | 0 {python/kubeflow => kubeflow}/trainer/types/__init__.py | 0 {python/kubeflow => kubeflow}/trainer/types/types.py | 0 {python/kubeflow => kubeflow}/trainer/utils/__init__.py | 0 {python/kubeflow => kubeflow}/trainer/utils/utils.py | 0 pyproject.toml | 6 +++--- 15 files changed, 8 insertions(+), 8 deletions(-) rename {python/kubeflow => kubeflow}/__init__.py (100%) rename {python/kubeflow => kubeflow}/py.typed (100%) rename {python/kubeflow => kubeflow}/trainer/__init__.py (100%) rename {python/kubeflow => kubeflow}/trainer/api/__init__.py (100%) rename {python/kubeflow => kubeflow}/trainer/api/trainer_client.py (100%) rename {python/kubeflow => kubeflow}/trainer/api/trainer_client_test.py (100%) rename {python/kubeflow => kubeflow}/trainer/constants/__init__.py (100%) rename {python/kubeflow => kubeflow}/trainer/constants/constants.py (100%) rename {python/kubeflow => kubeflow}/trainer/types/__init__.py (100%) rename {python/kubeflow => kubeflow}/trainer/types/types.py (100%) rename {python/kubeflow => kubeflow}/trainer/utils/__init__.py (100%) rename {python/kubeflow => kubeflow}/trainer/utils/utils.py (100%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 11f20319..e5f678b4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: ruff 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/.*| )$ diff --git a/Makefile b/Makefile index 2d1f5b68..9f303bca 100644 --- a/Makefile +++ b/Makefile @@ -68,8 +68,8 @@ uv-venv: .PHONY: test-python test-python: uv-venv @uv pip install -e ".[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 run coverage report -m python/kubeflow/trainer/api/trainer_client.py python/kubeflow/trainer/utils/utils.py + @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 else diff --git a/python/kubeflow/__init__.py b/kubeflow/__init__.py similarity index 100% rename from python/kubeflow/__init__.py rename to kubeflow/__init__.py diff --git a/python/kubeflow/py.typed b/kubeflow/py.typed similarity index 100% rename from python/kubeflow/py.typed rename to kubeflow/py.typed diff --git a/python/kubeflow/trainer/__init__.py b/kubeflow/trainer/__init__.py similarity index 100% rename from python/kubeflow/trainer/__init__.py rename to kubeflow/trainer/__init__.py diff --git a/python/kubeflow/trainer/api/__init__.py b/kubeflow/trainer/api/__init__.py similarity index 100% rename from python/kubeflow/trainer/api/__init__.py rename to kubeflow/trainer/api/__init__.py diff --git a/python/kubeflow/trainer/api/trainer_client.py b/kubeflow/trainer/api/trainer_client.py similarity index 100% rename from python/kubeflow/trainer/api/trainer_client.py rename to kubeflow/trainer/api/trainer_client.py diff --git a/python/kubeflow/trainer/api/trainer_client_test.py b/kubeflow/trainer/api/trainer_client_test.py similarity index 100% rename from python/kubeflow/trainer/api/trainer_client_test.py rename to kubeflow/trainer/api/trainer_client_test.py diff --git a/python/kubeflow/trainer/constants/__init__.py b/kubeflow/trainer/constants/__init__.py similarity index 100% rename from python/kubeflow/trainer/constants/__init__.py rename to kubeflow/trainer/constants/__init__.py diff --git a/python/kubeflow/trainer/constants/constants.py b/kubeflow/trainer/constants/constants.py similarity index 100% rename from python/kubeflow/trainer/constants/constants.py rename to kubeflow/trainer/constants/constants.py diff --git a/python/kubeflow/trainer/types/__init__.py b/kubeflow/trainer/types/__init__.py similarity index 100% rename from python/kubeflow/trainer/types/__init__.py rename to kubeflow/trainer/types/__init__.py diff --git a/python/kubeflow/trainer/types/types.py b/kubeflow/trainer/types/types.py similarity index 100% rename from python/kubeflow/trainer/types/types.py rename to kubeflow/trainer/types/types.py diff --git a/python/kubeflow/trainer/utils/__init__.py b/kubeflow/trainer/utils/__init__.py similarity index 100% rename from python/kubeflow/trainer/utils/__init__.py rename to kubeflow/trainer/utils/__init__.py diff --git a/python/kubeflow/trainer/utils/utils.py b/kubeflow/trainer/utils/utils.py similarity index 100% rename from python/kubeflow/trainer/utils/utils.py rename to kubeflow/trainer/utils/utils.py diff --git a/pyproject.toml b/pyproject.toml index 274309bf..b5d01668 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ Documentation = "https://www.kubeflow.org/docs/components" Source = "https://github.com/kubeflow/sdk" [tool.hatch.version] -path = "python/kubeflow/trainer/__init__.py" +path = "kubeflow/trainer/__init__.py" [tool.ruff] line-length = 100 @@ -63,8 +63,8 @@ package = true requires = ["hatchling"] build-backend = "hatchling.build" -[tool.hatch.build.targets.wheel] -sources = ["python"] +[tool.hatch.build.targets] +packages = ["kubeflow"] [tool.hatch.metadata] allow-direct-references = true From 4172c45a8d416c2c3daace313afc3f4b8b7b4604 Mon Sep 17 00:00:00 2001 From: kramaranya Date: Thu, 7 Aug 2025 07:46:48 +0100 Subject: [PATCH 5/7] Revert "remove python directory" This reverts commit 06a5bc4be6668590286c3e400f41bc3506b0da1c. Signed-off-by: kramaranya --- .pre-commit-config.yaml | 6 +++--- Makefile | 4 ++-- pyproject.toml | 6 +++--- {kubeflow => python/kubeflow}/__init__.py | 0 {kubeflow => python/kubeflow}/py.typed | 0 {kubeflow => python/kubeflow}/trainer/__init__.py | 0 {kubeflow => python/kubeflow}/trainer/api/__init__.py | 0 {kubeflow => python/kubeflow}/trainer/api/trainer_client.py | 0 .../kubeflow}/trainer/api/trainer_client_test.py | 0 {kubeflow => python/kubeflow}/trainer/constants/__init__.py | 0 .../kubeflow}/trainer/constants/constants.py | 0 {kubeflow => python/kubeflow}/trainer/types/__init__.py | 0 {kubeflow => python/kubeflow}/trainer/types/types.py | 0 {kubeflow => python/kubeflow}/trainer/utils/__init__.py | 0 {kubeflow => python/kubeflow}/trainer/utils/utils.py | 0 15 files changed, 8 insertions(+), 8 deletions(-) rename {kubeflow => python/kubeflow}/__init__.py (100%) rename {kubeflow => python/kubeflow}/py.typed (100%) rename {kubeflow => python/kubeflow}/trainer/__init__.py (100%) rename {kubeflow => python/kubeflow}/trainer/api/__init__.py (100%) rename {kubeflow => python/kubeflow}/trainer/api/trainer_client.py (100%) rename {kubeflow => python/kubeflow}/trainer/api/trainer_client_test.py (100%) rename {kubeflow => python/kubeflow}/trainer/constants/__init__.py (100%) rename {kubeflow => python/kubeflow}/trainer/constants/constants.py (100%) rename {kubeflow => python/kubeflow}/trainer/types/__init__.py (100%) rename {kubeflow => python/kubeflow}/trainer/types/types.py (100%) rename {kubeflow => python/kubeflow}/trainer/utils/__init__.py (100%) rename {kubeflow => python/kubeflow}/trainer/utils/utils.py (100%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e5f678b4..11f20319 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: ruff exclude: | (?x)^( - kubeflow/trainer/__init__.py| - kubeflow/trainer/api/__init__.py| - kubeflow/trainer/models/.*| + python/kubeflow/trainer/__init__.py| + python/kubeflow/trainer/api/__init__.py| + python/kubeflow/trainer/models/.*| )$ diff --git a/Makefile b/Makefile index 9f303bca..2d1f5b68 100644 --- a/Makefile +++ b/Makefile @@ -68,8 +68,8 @@ uv-venv: .PHONY: test-python test-python: uv-venv @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 + @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 run coverage report -m python/kubeflow/trainer/api/trainer_client.py python/kubeflow/trainer/utils/utils.py ifeq ($(report),xml) @uv run coverage xml else diff --git a/pyproject.toml b/pyproject.toml index b5d01668..274309bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,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 = "python/kubeflow/trainer/__init__.py" [tool.ruff] line-length = 100 @@ -63,8 +63,8 @@ package = true requires = ["hatchling"] build-backend = "hatchling.build" -[tool.hatch.build.targets] -packages = ["kubeflow"] +[tool.hatch.build.targets.wheel] +sources = ["python"] [tool.hatch.metadata] allow-direct-references = true diff --git a/kubeflow/__init__.py b/python/kubeflow/__init__.py similarity index 100% rename from kubeflow/__init__.py rename to python/kubeflow/__init__.py diff --git a/kubeflow/py.typed b/python/kubeflow/py.typed similarity index 100% rename from kubeflow/py.typed rename to python/kubeflow/py.typed diff --git a/kubeflow/trainer/__init__.py b/python/kubeflow/trainer/__init__.py similarity index 100% rename from kubeflow/trainer/__init__.py rename to python/kubeflow/trainer/__init__.py diff --git a/kubeflow/trainer/api/__init__.py b/python/kubeflow/trainer/api/__init__.py similarity index 100% rename from kubeflow/trainer/api/__init__.py rename to python/kubeflow/trainer/api/__init__.py diff --git a/kubeflow/trainer/api/trainer_client.py b/python/kubeflow/trainer/api/trainer_client.py similarity index 100% rename from kubeflow/trainer/api/trainer_client.py rename to python/kubeflow/trainer/api/trainer_client.py diff --git a/kubeflow/trainer/api/trainer_client_test.py b/python/kubeflow/trainer/api/trainer_client_test.py similarity index 100% rename from kubeflow/trainer/api/trainer_client_test.py rename to python/kubeflow/trainer/api/trainer_client_test.py diff --git a/kubeflow/trainer/constants/__init__.py b/python/kubeflow/trainer/constants/__init__.py similarity index 100% rename from kubeflow/trainer/constants/__init__.py rename to python/kubeflow/trainer/constants/__init__.py diff --git a/kubeflow/trainer/constants/constants.py b/python/kubeflow/trainer/constants/constants.py similarity index 100% rename from kubeflow/trainer/constants/constants.py rename to python/kubeflow/trainer/constants/constants.py diff --git a/kubeflow/trainer/types/__init__.py b/python/kubeflow/trainer/types/__init__.py similarity index 100% rename from kubeflow/trainer/types/__init__.py rename to python/kubeflow/trainer/types/__init__.py diff --git a/kubeflow/trainer/types/types.py b/python/kubeflow/trainer/types/types.py similarity index 100% rename from kubeflow/trainer/types/types.py rename to python/kubeflow/trainer/types/types.py diff --git a/kubeflow/trainer/utils/__init__.py b/python/kubeflow/trainer/utils/__init__.py similarity index 100% rename from kubeflow/trainer/utils/__init__.py rename to python/kubeflow/trainer/utils/__init__.py diff --git a/kubeflow/trainer/utils/utils.py b/python/kubeflow/trainer/utils/utils.py similarity index 100% rename from kubeflow/trainer/utils/utils.py rename to python/kubeflow/trainer/utils/utils.py From 1c115c6a493b5926b7318c505377a9c045337791 Mon Sep 17 00:00:00 2001 From: kramaranya Date: Thu, 7 Aug 2025 08:02:30 +0100 Subject: [PATCH 6/7] remove python directory Signed-off-by: kramaranya --- .pre-commit-config.yaml | 6 +++--- Makefile | 4 ++-- {python/kubeflow => kubeflow}/__init__.py | 0 {python/kubeflow => kubeflow}/py.typed | 0 {python/kubeflow => kubeflow}/trainer/__init__.py | 0 {python/kubeflow => kubeflow}/trainer/api/__init__.py | 0 {python/kubeflow => kubeflow}/trainer/api/trainer_client.py | 0 .../trainer/api/trainer_client_test.py | 0 {python/kubeflow => kubeflow}/trainer/constants/__init__.py | 0 .../kubeflow => kubeflow}/trainer/constants/constants.py | 0 {python/kubeflow => kubeflow}/trainer/types/__init__.py | 0 {python/kubeflow => kubeflow}/trainer/types/types.py | 0 {python/kubeflow => kubeflow}/trainer/utils/__init__.py | 0 {python/kubeflow => kubeflow}/trainer/utils/utils.py | 0 pyproject.toml | 6 +++--- 15 files changed, 8 insertions(+), 8 deletions(-) rename {python/kubeflow => kubeflow}/__init__.py (100%) rename {python/kubeflow => kubeflow}/py.typed (100%) rename {python/kubeflow => kubeflow}/trainer/__init__.py (100%) rename {python/kubeflow => kubeflow}/trainer/api/__init__.py (100%) rename {python/kubeflow => kubeflow}/trainer/api/trainer_client.py (100%) rename {python/kubeflow => kubeflow}/trainer/api/trainer_client_test.py (100%) rename {python/kubeflow => kubeflow}/trainer/constants/__init__.py (100%) rename {python/kubeflow => kubeflow}/trainer/constants/constants.py (100%) rename {python/kubeflow => kubeflow}/trainer/types/__init__.py (100%) rename {python/kubeflow => kubeflow}/trainer/types/types.py (100%) rename {python/kubeflow => kubeflow}/trainer/utils/__init__.py (100%) rename {python/kubeflow => kubeflow}/trainer/utils/utils.py (100%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 11f20319..e5f678b4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: ruff 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/.*| )$ diff --git a/Makefile b/Makefile index 2d1f5b68..9f303bca 100644 --- a/Makefile +++ b/Makefile @@ -68,8 +68,8 @@ uv-venv: .PHONY: test-python test-python: uv-venv @uv pip install -e ".[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 run coverage report -m python/kubeflow/trainer/api/trainer_client.py python/kubeflow/trainer/utils/utils.py + @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 else diff --git a/python/kubeflow/__init__.py b/kubeflow/__init__.py similarity index 100% rename from python/kubeflow/__init__.py rename to kubeflow/__init__.py diff --git a/python/kubeflow/py.typed b/kubeflow/py.typed similarity index 100% rename from python/kubeflow/py.typed rename to kubeflow/py.typed diff --git a/python/kubeflow/trainer/__init__.py b/kubeflow/trainer/__init__.py similarity index 100% rename from python/kubeflow/trainer/__init__.py rename to kubeflow/trainer/__init__.py diff --git a/python/kubeflow/trainer/api/__init__.py b/kubeflow/trainer/api/__init__.py similarity index 100% rename from python/kubeflow/trainer/api/__init__.py rename to kubeflow/trainer/api/__init__.py diff --git a/python/kubeflow/trainer/api/trainer_client.py b/kubeflow/trainer/api/trainer_client.py similarity index 100% rename from python/kubeflow/trainer/api/trainer_client.py rename to kubeflow/trainer/api/trainer_client.py diff --git a/python/kubeflow/trainer/api/trainer_client_test.py b/kubeflow/trainer/api/trainer_client_test.py similarity index 100% rename from python/kubeflow/trainer/api/trainer_client_test.py rename to kubeflow/trainer/api/trainer_client_test.py diff --git a/python/kubeflow/trainer/constants/__init__.py b/kubeflow/trainer/constants/__init__.py similarity index 100% rename from python/kubeflow/trainer/constants/__init__.py rename to kubeflow/trainer/constants/__init__.py diff --git a/python/kubeflow/trainer/constants/constants.py b/kubeflow/trainer/constants/constants.py similarity index 100% rename from python/kubeflow/trainer/constants/constants.py rename to kubeflow/trainer/constants/constants.py diff --git a/python/kubeflow/trainer/types/__init__.py b/kubeflow/trainer/types/__init__.py similarity index 100% rename from python/kubeflow/trainer/types/__init__.py rename to kubeflow/trainer/types/__init__.py diff --git a/python/kubeflow/trainer/types/types.py b/kubeflow/trainer/types/types.py similarity index 100% rename from python/kubeflow/trainer/types/types.py rename to kubeflow/trainer/types/types.py diff --git a/python/kubeflow/trainer/utils/__init__.py b/kubeflow/trainer/utils/__init__.py similarity index 100% rename from python/kubeflow/trainer/utils/__init__.py rename to kubeflow/trainer/utils/__init__.py diff --git a/python/kubeflow/trainer/utils/utils.py b/kubeflow/trainer/utils/utils.py similarity index 100% rename from python/kubeflow/trainer/utils/utils.py rename to kubeflow/trainer/utils/utils.py diff --git a/pyproject.toml b/pyproject.toml index 274309bf..b5d01668 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ Documentation = "https://www.kubeflow.org/docs/components" Source = "https://github.com/kubeflow/sdk" [tool.hatch.version] -path = "python/kubeflow/trainer/__init__.py" +path = "kubeflow/trainer/__init__.py" [tool.ruff] line-length = 100 @@ -63,8 +63,8 @@ package = true requires = ["hatchling"] build-backend = "hatchling.build" -[tool.hatch.build.targets.wheel] -sources = ["python"] +[tool.hatch.build.targets] +packages = ["kubeflow"] [tool.hatch.metadata] allow-direct-references = true From 354f6c78071a3ab09e1e3a84c79dd47ba4b04d60 Mon Sep 17 00:00:00 2001 From: kramaranya Date: Thu, 7 Aug 2025 11:54:20 +0100 Subject: [PATCH 7/7] move version file to kubeflow dict Signed-off-by: kramaranya --- kubeflow/__init__.py | 15 +++++++++++++++ kubeflow/trainer/__init__.py | 2 -- pyproject.toml | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/kubeflow/__init__.py b/kubeflow/__init__.py index e69de29b..6f406353 100644 --- a/kubeflow/__init__.py +++ b/kubeflow/__init__.py @@ -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" diff --git a/kubeflow/trainer/__init__.py b/kubeflow/trainer/__init__.py index bc780d1b..dce03bbb 100644 --- a/kubeflow/trainer/__init__.py +++ b/kubeflow/trainer/__init__.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index b5d01668..9bc2031d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,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