-
Notifications
You must be signed in to change notification settings - Fork 41
Add optional dependencies for testing #35
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
Conversation
This commit introduces optional dependencies specifically for testing purposes. The `pytest` and `pytest-mock` packages are added to the `pyproject.toml` file under the `optional-dependencies` section, allowing developers to easily install testing tools when needed. Additionally, a new `pytest.ini` configuration section is created to standardize test settings, including options for verbosity and test discovery patterns. Signed-off-by: Krishnaswamy Subramanian <subramk@thoughtworks.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Fixes: #20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this @jskswamy!
/assign @szaher @franciscojavierarceo @astefanutti @Electronic-Waste @briangallagher
|
@andreyvelich: GitHub didn't allow me to assign the following users: briangallagher, szaher. Note that only kubeflow members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/lgtm Thanks |
|
|
||
| [tool.pytest.ini_options] | ||
| addopts = [ | ||
| "--import-mode=importlib", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need it ?
| "-v", | ||
| "--tb=short", | ||
| ] | ||
| testpaths = ["kubeflow"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we create a dedicated directory for tests? i.e. kubeflow/tests ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, for unit tests, we agreed previously to store test files alongside the actual files.
That will make it easier to find unit tests, and make it consistent with Go best practices.
KFP also does it: https://github.com/kubeflow/pipelines/tree/master/sdk/python/kfp/client
|
|
||
| [project.optional-dependencies] | ||
| test = [ | ||
| "pytest>=7.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we are going to use uv let's use ruff as well with uv?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
| @@ -0,0 +1,438 @@ | |||
| version = 1 | |||
| revision = 2 | |||
| requires-python = ">=3.12" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we dropping old python versions? I think we still need to support 3.10 and 3.11
3.9 version will be dropped in October this year https://devguide.python.org/versions/
|
Let's split this PR into two as there are two things happening here. pytest and uv dependency management and we need to check if we are creating workspaces or not and some other directives for uv we need to decide on if this is Ok cc: @andreyvelich |
|
@jskswamy Can we update this PR to only focus on |
|
This has been resolved in: #38 |
Purpose
Add support for
uvdependency management to the Kubeflow SDK.Background
This addresses the following feedback from PR #31:
Changes
pytest>=7.0.0,pytest-mock>=3.10.0inpyproject.tomltestpaths = ["kubeflow"]to support co-located testsuv.lockfile with locked dependency versionsRelated