diff --git a/.github/workflows/test-e2e.yaml b/.github/workflows/test-e2e.yaml index 1a2fb6f3f..85176384c 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 357f28c73..e5f678b4f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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/.*| )$ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 246719192..05117859a 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 e8f5eb379..9f303bcaf 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,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 diff --git a/kubeflow/__init__.py b/kubeflow/__init__.py new file mode 100644 index 000000000..6f406353b --- /dev/null +++ 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/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 98% rename from python/kubeflow/trainer/__init__.py rename to kubeflow/trainer/__init__.py index bc780d1bd..dce03bbb7 100644 --- a/python/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/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/__init__.py b/kubeflow/trainer/constants/__init__.py similarity index 100% rename from python/kubeflow/__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/constants/__init__.py b/kubeflow/trainer/types/__init__.py similarity index 100% rename from python/kubeflow/trainer/constants/__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/python/pyproject.toml b/pyproject.toml similarity index 94% rename from python/pyproject.toml rename to pyproject.toml index 6f0e8aa9b..9bc2031d4 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 = "kubeflow/__init__.py" [tool.ruff] line-length = 100 @@ -55,8 +56,6 @@ line-length = 100 select = ["E", "F", "W"] ignore = ["E203"] - - [tool.uv] package = true diff --git a/python/kubeflow/trainer/types/__init__.py b/python/kubeflow/trainer/types/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/python/uv.lock b/uv.lock similarity index 100% rename from python/uv.lock rename to uv.lock