-
Notifications
You must be signed in to change notification settings - Fork 41
chore: Update CONTRIBUTING.md to use uv #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+64
−69
Merged
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 665f199
remove .flake8 & update .gitignore
szaher c91307e
Merge branch 'main' into update-contrib
szaher bffa122
Fix merge conflict
szaher 1c1c886
checkout Makefile, pyproject, lock file from main branch
szaher 1998f0b
update gitignore
szaher 760ae1a
Update CONTRIBUTING.md
szaher 8d88050
Add make install & foramt
szaher 6c4dd97
Merge branch 'update-contrib' of github.com:szaher/sdk into update-co…
szaher ec4ad5b
Remove uv pip install dev dependencies
szaher d391711
fix typo in the contributing.md file
szaher 0783b83
Update Makefile
szaher 1a38742
update structure
szaher 7f3458e
Merge branch 'update-contrib' of github.com:szaher/sdk into update-co…
szaher e00b711
Merge branch 'main' into update-contrib
szaher 4a02853
rephrase uv install
szaher 958d652
update install step at Makefile
szaher 38e3cc7
Update CONTRIBUTING.md
szaher 4c0a097
Apply suggestion from @andreyvelich
szaher 6eb73ed
Apply suggestion from @andreyvelich
szaher 114fec0
update Make target verify to use install
szaher b9696da
fix formatting in contributing guide
szaher 5077401
remove redundant commands
szaher 3f5bab2
use make install-dev instead of make install
szaher 0ff8e00
update install target reference
szaher cb35c6c
remove group dev from make install-dev target
szaher afe4c91
move coding style to dev
szaher 45f4eb0
remove pre-commit stuff from contributing guide
szaher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.