lmdeploy
lmdeploy copied to clipboard
fix: make project PEP 517 compliant.
Motivation
The LMDeploy project currently utilizes a pyproject.toml file, but the build process isn't fully aligned with PEP 517 standards. This change aims to improve consistency and maintainability by adhering more closely to PEP 517 guidelines.
Modification
This PR refactors the LMDeploy build process to better align with PEP 517 standards, while retaining the necessary functionality for handling dynamic and optional dependencies. Key changes include:
-
Updated
pyproject.toml: Revised thepyproject.tomlfile to more accurately define build requirements and dependencies, ensuring greater conformity with the PEP 517 specification. -
Build Backend Configuration: Adjusted the build backend configuration within
pyproject.tomlto more reliably resolve dependencies during the build process. -
Dependency Management: Ensured dependencies are clearly defined in
pyproject.tomland/orsetup.pyfor consistent dependency management.
Use cases
This change enables the use of a wider range of modern Python packaging tools. Specifically:
-
Standard
pipinstalls:pip install .orpython -m buildwill continue to work as expected. -
Modern tools like
uv: This change ensures compatibility with tools likeuv, allowing developers to leverage its faster dependency resolution and other benefits. - CI/CD Pipelines: Enables consistent builds across different environments using any PEP 517 compliant build tool.
Checklist
- [x] Pre-commit or other linting tools are used to fix the potential lint issues.
- [x] The changes have been tested locally.
- [x] Documentation has been updated to reflect the changes.
- [x] All tests pass.
- [x] The PR addresses the issues outlined in the motivation, acknowledging the continued use of
setup.py.
This PR is a direct followup of https://github.com/InternLM/lmdeploy/pull/3726