Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6eb90f4
Update CONTRIBUTING.md to use uv
szaher Jul 17, 2025
665f199
remove .flake8 & update .gitignore
szaher Jul 17, 2025
c91307e
Merge branch 'main' into update-contrib
szaher Aug 22, 2025
bffa122
Fix merge conflict
szaher Aug 22, 2025
1c1c886
checkout Makefile, pyproject, lock file from main branch
szaher Aug 22, 2025
1998f0b
update gitignore
szaher Aug 22, 2025
760ae1a
Update CONTRIBUTING.md
szaher Aug 22, 2025
8d88050
Add make install & foramt
szaher Aug 22, 2025
6c4dd97
Merge branch 'update-contrib' of github.com:szaher/sdk into update-co…
szaher Aug 22, 2025
ec4ad5b
Remove uv pip install dev dependencies
szaher Aug 26, 2025
d391711
fix typo in the contributing.md file
szaher Aug 26, 2025
0783b83
Update Makefile
szaher Aug 26, 2025
1a38742
update structure
szaher Sep 7, 2025
7f3458e
Merge branch 'update-contrib' of github.com:szaher/sdk into update-co…
szaher Sep 7, 2025
e00b711
Merge branch 'main' into update-contrib
szaher Sep 7, 2025
4a02853
rephrase uv install
szaher Sep 7, 2025
958d652
update install step at Makefile
szaher Sep 7, 2025
38e3cc7
Update CONTRIBUTING.md
szaher Sep 8, 2025
4c0a097
Apply suggestion from @andreyvelich
szaher Sep 8, 2025
6eb73ed
Apply suggestion from @andreyvelich
szaher Sep 8, 2025
114fec0
update Make target verify to use install
szaher Sep 8, 2025
b9696da
fix formatting in contributing guide
szaher Sep 8, 2025
5077401
remove redundant commands
szaher Sep 8, 2025
3f5bab2
use make install-dev instead of make install
szaher Sep 8, 2025
0ff8e00
update install target reference
szaher Sep 8, 2025
cb35c6c
remove group dev from make install-dev target
szaher Sep 9, 2025
afe4c91
move coding style to dev
szaher Sep 9, 2025
45f4eb0
remove pre-commit stuff from contributing guide
szaher Sep 9, 2025
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
123 changes: 55 additions & 68 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,89 +1,76 @@
# Contributing to the Kubeflow SDK

Thank you for your interest in contributing to the Kubeflow SDK!
This guide explains how to contribute to the Kubeflow SDK project.
For the Kubeflow SDK documentation, please check [the official Kubeflow documentation](https://www.kubeflow.org/docs/components/).

## Getting Started

### Prerequisites
- Python 3.8–3.11
- [pip](https://pip.pypa.io/en/stable/)
## Requirements
- [Supported Python version](./pyproject.toml#L4)
- [pre-commit](https://pre-commit.com/)
- [uv](https://docs.astral.sh/uv/getting-started/installation/)

### Setting Up Your Development Environment
Clone the repository:
```sh
git clone https://github.com/kubeflow/sdk.git
cd sdk
```

Create a virtual environment and activate it:
```sh
python3 -m venv .venv
source .venv/bin/activate
```
## Development

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

#### Development Build (Optional)
To install development tools and the latest API modules directly from the master branch:
```sh
uv pip install -e . --group dev
```
The Kubeflow SDK project includes a Makefile with several helpful commands to streamline your development workflow.

## Development Workflow
To install all dependencies (including dev tools) and create virtual environment, run

### Pre-commit
We use pre-commit to ensure consistent code formatting. To enable pre-commit hooks, run:
```sh
pre-commit install
```
To run all hooks manually:
```sh
pre-commit run --all-files
make install-dev
```

### Testing
To run the unit tests (if present), execute:
```sh
pytest
```
### Coding Style
Make sure to install [pre-commit](https://pre-commit.com/) (`uv pip install pre-commit`) and run `pre-commit install` from the root of the repository at least once before creating git commits.

### Code Coverage
To run tests and measure coverage:
```sh
coverage run -m pytest
coverage report -m
```
The pre-commit hooks ensure code quality and consistency. They are executed in CI. PRs that fail to comply with the hooks will not be able to pass the corresponding CI gate. The hooks are only executed against staged files unless you run `pre-commit run --all`, in which case, they'll be executed against every file in the repository.

Specific programmatically generated files listed in the `exclude` field in [.pre-commit-config.yaml](.pre-commit-config.yaml) are deliberately excluded from the hooks.

### Code Formatting
To check formatting:
```sh
black --check .
```
To auto-format all files:
```sh
black .
```
To sort imports:
```sh
isort .

```shell
make verify
```
To lint:
```sh
flake8 --exclude .venv

## Testing

The Kubeflow SDK project includes several types of tests to ensure code quality and functionality.

### Unit Testing
To run unit tests locally use the following make command:

```shell
make test-python
```

## Continuous Integration
All PRs are automatically checked by CI. Please ensure all checks pass before requesting review.
### E2E Tests
E2E test run in CI on a kind cluster using [Kubeflow Trainer E2E Scripts](https://github.com/kubeflow/trainer/blob/master/CONTRIBUTING.md#e2e-tests).
Clone the `Kubeflow Trainer` repo and run the provided commands against `Trainer` Makefile.
For more details check [the Kubeflow Trainer Contributing Guide](https://github.com/kubeflow/trainer/blob/master/CONTRIBUTING.md#e2e-tests).


## Best Practices

### Pull Request Title Conventions

We enforce a pull request (PR) title convention to quickly indicate the type and scope of a PR.
The PR titles are used to generated changelog for releases.

PR titles must:

- Follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
- Have an appropriate [type and scope](./.github/workflows/check-pr-title.yaml)

Examples:

- fix: Check empty value for ml_policy
- chore(ci): Remove unused scripts
- feat(docs): Create guide for LLM Fine-Tuning

## Getting Help
For questions, open an issue or contact a maintainer listed in `OWNERS`.
### Kubeflow Enhancement Proposal (KEP)

## Resources
- [Kubeflow Trainer Docs](https://www.kubeflow.org/docs/components/trainer/)
- [Source Code](https://github.com/kubeflow/trainer)
For any significant features or enhancement for Kubeflow SDK project we follow the
[Kubeflow Enhancement Proposal process](https://github.com/kubeflow/community/tree/master/proposals).

---
If you want to submit a significant change to the Kubeflow Trainer, please submit a new KEP under
[./docs/proposals](./docs/proposals/) directory.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ruff: ## Install Ruff
@uvx ruff --help &> /dev/null || uv tool install ruff

.PHONY: verify
verify: uv uv-venv ruff ## install all required tools
verify: install-dev ## install all required tools
@uv lock --check
@uvx ruff check --show-fixes

Expand All @@ -75,3 +75,11 @@ ifeq ($(report),xml)
else
@uv run coverage html
endif


.PHONY: install-dev
install-dev: uv uv-venv ruff ## Install uv, create .venv, sync deps; DEV=1 to include dev group; EXTRAS=comma,list for extras
@echo "Using virtual environment at: $(VENV_DIR)"
@echo "Syncing dependencies with uv..."
@uv sync
@echo "Environment is ready."