Skip to content

Make Inference-Perf Package-able / Use Modern Python Tooling #13

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
merged 5 commits into from
Feb 3, 2025

Conversation

sjmonson
Copy link
Contributor

@sjmonson sjmonson commented Feb 1, 2025

A few changes around packaging as QoL tooling. Each commit is a separate proposal that builds off the previous.

Changes

9d6c8c2 Switch to pyproject with PDM for dependency management

The proper way to manage dependencies for a python package is from a pyproject.toml (reference). This proposal utilizes PDM as a build backend.

8186a1e Replace flake8 and black with ruff

Replaces both flake8 and black with ruff as it is significantly faster, more featureful, and more actively maintained.

efb105e Add pre-commit hooks for linting/formatting/typing

Add optional pre-commit hooks for linting/formatting/typing and maintaining the PDM lock file.

7be81a9 Run pre-commit from github action

Reverted for now as the there are some limitations when running mypy in pre-commit. Namely it must be run with --ignore-missing-imports as pre-commit runs every hook from an isolated virtual environment.

Other Considerations

Things not included in this PR but worth considering.

Replace mypy with pyright

Mypy predates much of the typing system within python and generally defaults to off unless types are present. Pyright is generally better at enforcing types and is designed to be used in real-time. See this slightly-biased comparison.

Replace Makefile with tox or other python-native test harness

It is not a given that a system has gnumake installed, thus we should probably use something that is nearly guaranteed to exist (shell script) or a python tool. This is especially relevant to the container build process to reduce layers.

Closes #12

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 1, 2025
@achandrasekar
Copy link
Contributor

/lgtm
/approve

Feel free to create an issue / PR for pyright and swapping Makefile out as well. Sounds reasonable to me.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 3, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: achandrasekar, sjmonson

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 3, 2025
@k8s-ci-robot k8s-ci-robot merged commit eb3ce16 into kubernetes-sigs:main Feb 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decide on a minimum supported python version
3 participants