Skip to content

Conversation

@szaher
Copy link
Member

@szaher szaher commented Jul 17, 2025

What this PR does / why we need it:

  • Update CONTRIBUTING.md to use uv
  • Add pre-commit as dev dependency
  • add pytest as dev dependency

Which issue(s) this PR fixes (optional, in Fixes #<issue number>, #<issue number>, ... format, will close the issue(s) when PR gets merged):

Fixes #

Checklist:

  • Docs included if any changes are user facing

Signed-off-by: Saad Zaher <szaher@redhat.com>
Signed-off-by: Saad Zaher <szaher@redhat.com>
Copy link
Member

@eoinfennessy eoinfennessy left a comment

Choose a reason for hiding this comment

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

Looks good. I added some comments and suggestions.

@kramaranya
Copy link
Contributor

Thank you @szaher!
Could you rebase against main? There are some important changes that need to be included

szaher added 2 commits August 22, 2025 01:52
Signed-off-by: Saad Zaher <szaher@redhat.com>
@google-oss-prow google-oss-prow bot added size/XL and removed size/L labels Aug 22, 2025
Signed-off-by: Saad Zaher <szaher@redhat.com>
@google-oss-prow google-oss-prow bot added size/M and removed size/XL labels Aug 22, 2025
Signed-off-by: Saad Zaher <szaher@redhat.com>
@szaher szaher changed the title Update CONTRIBUTING.md to use uv (chore ): Update CONTRIBUTING.md to use uv Aug 22, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 17142997184

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 64.877%

Totals Coverage Status
Change from base Build 17059769083: 0.3%
Covered Lines: 290
Relevant Lines: 447

💛 - Coveralls

1 similar comment
@coveralls
Copy link

Pull Request Test Coverage Report for Build 17142997184

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 64.877%

Totals Coverage Status
Change from base Build 17059769083: 0.3%
Covered Lines: 290
Relevant Lines: 447

💛 - Coveralls

@coveralls
Copy link

coveralls commented Aug 22, 2025

Pull Request Test Coverage Report for Build 17582757769

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 31 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.9%) to 71.053%

Files with Coverage Reduction New Missed Lines %
kubeflow/trainer/utils/utils.py 31 63.94%
Totals Coverage Status
Change from base Build 17487937699: 0.9%
Covered Lines: 297
Relevant Lines: 418

💛 - Coveralls

@szaher szaher changed the title (chore ): Update CONTRIBUTING.md to use uv (chore): Update CONTRIBUTING.md to use uv Aug 22, 2025
@szaher szaher changed the title (chore): Update CONTRIBUTING.md to use uv chore: Update CONTRIBUTING.md to use uv Aug 22, 2025
@szaher
Copy link
Member Author

szaher commented Aug 22, 2025

@andreyvelich can we get this one reviewed?

Copy link
Member

@andreyvelich andreyvelich left a comment

Choose a reason for hiding this comment

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

Thanks @szaher, I've added some thoughts.
/assign @astefanutti @Electronic-Waste @kramaranya

szaher and others added 3 commits August 23, 2025 00:31
Co-authored-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>
Signed-off-by: Saad Zaher <szaher@redhat.com>
Signed-off-by: Saad Zaher <eng.szaher@gmail.com>
Signed-off-by: Saad Zaher <szaher@redhat.com>
CONTRIBUTING.md Outdated
Comment on lines 16 to 34
Install uv if not installed [Official Docs](https://docs.astral.sh/uv/getting-started/installation/) or using the following command:
```shell
make uv
```
### Install SDK & Dependencies

Create a virtual environment and install all dependencies (including dev tools):

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

#### Development Build (Optional)
#### API Models

To install development tools and the latest API modules directly from the master branch:
```sh
uv pip install -e . --group dev
```

## Development Workflow
```shell
uv sync --dev
```
Copy link
Member

Choose a reason for hiding this comment

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

Can you delete all of these and just run make verify in the Development section ?
Similar to Trainer: https://github.com/kubeflow/trainer/blob/master/CONTRIBUTING.md#development
That should install all required tools and configure uv environment.

Copy link
Member Author

Choose a reason for hiding this comment

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

actually this one is very specific to installing api modules from master branch but the actual installation of dependencies and app is a couple of lines up.

I added make install

Co-authored-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>
Signed-off-by: Saad Zaher <szaher@redhat.com>
CONTRIBUTING.md Outdated
Comment on lines 14 to 22
The Kubeflow SDK project includes a Makefile with several helpful commands to streamline your development workflow.

Install uv if not installed [Official Docs](https://docs.astral.sh/uv/getting-started/installation/) or using the following command:
```shell
make uv
```
### Install SDK & Dependencies

Create a virtual environment and install all dependencies (including dev tools):
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that we need separate section for installing uv and sync API modules, since it is included in the make install command.

Suggested change
The Kubeflow SDK project includes a Makefile with several helpful commands to streamline your development workflow.
Install uv if not installed [Official Docs](https://docs.astral.sh/uv/getting-started/installation/) or using the following command:
```shell
make uv
```
### Install SDK & Dependencies
Create a virtual environment and install all dependencies (including dev tools):
The Kubeflow SDK project includes a Makefile with several helpful commands to streamline your development workflow.
To install all dependencies (including dev tools) and create virtual environment, run
```sh
make install

Copy link
Member

Choose a reason for hiding this comment

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

@szaher Can you fix formatting please: https://github.com/kubeflow/sdk/blob/114fec00669263b6f6302519cd90c570ad8fe4ed/CONTRIBUTING.md#development ?

API Models section also can be removed, since uv sync --dev is part of make install script.

Copy link
Member Author

Choose a reason for hiding this comment

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

well, uv sync or make install will install the default sdk packages with api models == specific version.

the dev group should install api models == master branch

do we need to remove it give that this guide is for people to contribute so they should use the latest api models?

szaher and others added 4 commits September 8, 2025 15:49
Co-authored-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>
Signed-off-by: Saad Zaher <szaher@redhat.com>
Co-authored-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>
Signed-off-by: Saad Zaher <szaher@redhat.com>
Signed-off-by: Saad Zaher <szaher@redhat.com>
Signed-off-by: Saad Zaher <szaher@redhat.com>
Copy link
Contributor

@kramaranya kramaranya left a comment

Choose a reason for hiding this comment

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

Thank you @szaher

Comment on lines 17 to 24

```sh
python3 -m venv .venv
source .venv/bin/activate
```
make install

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Please, clean this up so we just have make install

CONTRIBUTING.md Outdated
Comment on lines 29 to 31
```shell
uv sync --dev
```
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need this since we have make install

Makefile Outdated
install: 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 --group dev
Copy link
Contributor

Choose a reason for hiding this comment

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

uv sync already includes dev group

Suggested change
@uv sync --group dev
@uv sync

Copy link
Member

@andreyvelich andreyvelich Sep 8, 2025

Choose a reason for hiding this comment

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

@kramaranya Is that true ?
IIUC, by default it will use the default installation (e.g. pip install kubeflow), however in make install we should install dev version.
So we should it to uv sync --group dev as @szaher proposed.

@szaher Maybe we should rename this script to make it more explicit:

make install-dev

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, uv sync installs dev group by default https://docs.astral.sh/uv/concepts/projects/dependencies/#default-groups

We should remove --group dev from uv sync. The default installation (similar to pip install kubeflow) with no dev tools would be uv sync --no-dev.
@szaher could you update it accordingly?

Copy link
Member Author

Choose a reason for hiding this comment

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

@kramaranya since uv sync and uv sync --dev has the same effect. dev is a default group in the uv dependency groups so both have the same effect.

keeping --group dev isn't harmful and is more explicit.

Copy link
Member

@andreyvelich andreyvelich Sep 9, 2025

Choose a reason for hiding this comment

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

I see, thanks for letting us know @kramaranya!
Actually, I might agree with @szaher to use uv sync --group dev since it makes more explicit for the developers that we use dev installation, but I am fine with any.
@astefanutti @Electronic-Waste Any thoughts ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine either way, but I think --group dev just makes the command a bit noisier

CONTRIBUTING.md Outdated
Comment on lines 80 to 89
To fix all lint issues automatically using ruff append `--fix` to your ruff check command.
```shell
uv run ruff check --fix .
```
To lint:
```sh
flake8 --exclude .venv
To auto-format, lint all files
```shell
uv run ruff format .
Copy link
Contributor

@kramaranya kramaranya Sep 8, 2025

Choose a reason for hiding this comment

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

Feels like a lot of commands, shall we maybe add make fix or make format instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

I would really recommend we keep like that for now.

  • We can add that later in the ruff pr
  • we need to support fix, format specific files or files if provided by the user
  • uv run ruff check --fix /PATH/TO/FILE

It could be also a separate issue to support individual components, we can create a tracking issue for it.

Signed-off-by: Saad Zaher <szaher@redhat.com>
Signed-off-by: Saad Zaher <szaher@redhat.com>
Signed-off-by: Saad Zaher <szaher@redhat.com>
Copy link
Member

@andreyvelich andreyvelich left a comment

Choose a reason for hiding this comment

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

Thanks @szaher!
/lgtm
/assign @kramaranya

CONTRIBUTING.md Outdated
Comment on lines 48 to 54
## 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.

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

This duplicates https://github.com/szaher/sdk/blob/update-contrib/CONTRIBUTING.md#pre-commit
Could we have one clear section?

Copy link
Member

@andreyvelich andreyvelich Sep 9, 2025

Choose a reason for hiding this comment

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

I agree, maybe we can keep Coding Style as a subsection under Development, e.g.

## Development
...
### Coding Style

Info about pre-commit + `make verify` to check formatting.

## Testing

## Best Practices

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, sounds great to me

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Signed-off-by: Saad Zaher <szaher@redhat.com>
@google-oss-prow google-oss-prow bot removed the lgtm label Sep 9, 2025
Signed-off-by: Saad Zaher <szaher@redhat.com>
CONTRIBUTING.md Outdated
Comment on lines 37 to 42
```shell
pre-commit install
```
To run all hooks manually:
```sh
pre-commit run --all-files
Copy link
Member

Choose a reason for hiding this comment

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

You can remove those sections, since you explain it here: https://github.com/kubeflow/sdk/blob/afe4c9160412090c885e9ab5c214d34c6ea788c3/CONTRIBUTING.md#coding-style

Suggested change
```shell
pre-commit install
```
To run all hooks manually:
```sh
pre-commit run --all-files

CONTRIBUTING.md Outdated
Comment on lines 35 to 36
#### Pre-commit
We use pre-commit to ensure consistent code formatting. To enable pre-commit hooks, run:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#### Pre-commit
We use pre-commit to ensure consistent code formatting. To enable pre-commit hooks, run:

Signed-off-by: Saad Zaher <szaher@redhat.com>
Copy link
Member

@andreyvelich andreyvelich left a comment

Choose a reason for hiding this comment

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

Thank you @szaher!
/lgtm
/assign @kramaranya

@google-oss-prow google-oss-prow bot added the lgtm label Sep 9, 2025
@kramaranya
Copy link
Contributor

Awesome, thank you @szaher!
/lgtm

@andreyvelich
Copy link
Member

/approve

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andreyvelich

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit 6709dcf into kubeflow:main Sep 9, 2025
10 checks passed
@szaher szaher deleted the update-contrib branch September 9, 2025 13:31
accorvin pushed a commit to opendatahub-io/kubeflow-sdk that referenced this pull request Oct 8, 2025
* Update CONTRIBUTING.md to use uv

Signed-off-by: Saad Zaher <szaher@redhat.com>

* remove .flake8 & update .gitignore

Signed-off-by: Saad Zaher <szaher@redhat.com>

* Fix merge conflict

Signed-off-by: Saad Zaher <szaher@redhat.com>

* checkout Makefile, pyproject, lock file from main branch

Signed-off-by: Saad Zaher <szaher@redhat.com>

* update gitignore

Signed-off-by: Saad Zaher <szaher@redhat.com>

* Update CONTRIBUTING.md

Co-authored-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>
Signed-off-by: Saad Zaher <szaher@redhat.com>

* Add make install & foramt

Signed-off-by: Saad Zaher <eng.szaher@gmail.com>

* Remove uv pip install dev dependencies

as we are moving to `dependency-groups` instead of `optional-dependencies` because pypi.org doesn't support git dependencies we need ot use `uv sync` instead of `uv pip ...` 
which will automatically sync all default groups (dev is a default group in uv)


Signed-off-by: Saad Zaher <szaher@redhat.com>

* fix typo in the contributing.md file

Signed-off-by: Saad Zaher <szaher@redhat.com>

* Update Makefile

Signed-off-by: Saad Zaher <szaher@redhat.com>

* update structure

Signed-off-by: Saad Zaher <szaher@redhat.com>

* rephrase uv install

Signed-off-by: Saad Zaher <szaher@redhat.com>

* update install step at Makefile

Signed-off-by: Saad Zaher <szaher@redhat.com>

* Update CONTRIBUTING.md

Co-authored-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>
Signed-off-by: Saad Zaher <szaher@redhat.com>

* Apply suggestion from @andreyvelich

Co-authored-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>
Signed-off-by: Saad Zaher <szaher@redhat.com>

* Apply suggestion from @andreyvelich

Co-authored-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>
Signed-off-by: Saad Zaher <szaher@redhat.com>

* update Make target verify to use install

Signed-off-by: Saad Zaher <szaher@redhat.com>

* fix formatting in contributing guide

Signed-off-by: Saad Zaher <szaher@redhat.com>

* remove redundant commands

Signed-off-by: Saad Zaher <szaher@redhat.com>

* use make install-dev instead of make install

Signed-off-by: Saad Zaher <szaher@redhat.com>

* update install target reference

Signed-off-by: Saad Zaher <szaher@redhat.com>

* remove group dev from make install-dev target

Signed-off-by: Saad Zaher <szaher@redhat.com>

* move coding style to dev

Signed-off-by: Saad Zaher <szaher@redhat.com>

* remove pre-commit stuff from contributing guide

Signed-off-by: Saad Zaher <szaher@redhat.com>

---------

Signed-off-by: Saad Zaher <szaher@redhat.com>
Signed-off-by: Saad Zaher <eng.szaher@gmail.com>
Co-authored-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants