lmdeploy icon indicating copy to clipboard operation
lmdeploy copied to clipboard

fix: make project PEP 517 compliant.

Open windreamer opened this issue 6 months ago • 1 comments

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 the pyproject.toml file 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.toml to more reliably resolve dependencies during the build process.
  • Dependency Management: Ensured dependencies are clearly defined in pyproject.toml and/or setup.py for consistent dependency management.

Use cases

This change enables the use of a wider range of modern Python packaging tools. Specifically:

  • Standard pip installs: pip install . or python -m build will continue to work as expected.
  • Modern tools like uv: This change ensures compatibility with tools like uv, 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.

windreamer avatar Jul 17 '25 02:07 windreamer

This PR is a direct followup of https://github.com/InternLM/lmdeploy/pull/3726

windreamer avatar Jul 30 '25 15:07 windreamer