Make Inference-Perf Package-able / Use Modern Python Tooling #13
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.
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 actionReverted 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
withpyright
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 harnessIt 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