-
Notifications
You must be signed in to change notification settings - Fork 46
Closed
Labels
Description
Summary of Observations
The current setup presents a few challenges:
- Slow Initial Setup: The reliance on standard pip and tox with virtualenv makes the initial dependency installation and test environment creation quite slow. This can be a barrier for new contributors who want to quickly get up and running.
- Potential for Environment Inconsistency: The project doesn't currently commit a dependency lock file. This means my local environment might differ slightly from the one used in CI or by other developers, which could lead to "it works on my machine" issues.
- Legacy Configuration: The setup.py file mixes static package metadata (like the project name and dependencies) with the build logic for the C++ extension. For someone new to the codebase, this makes the configuration harder to understand compared to the modern, declarative pyproject.toml standard.
Proposal
I believe all these points can be addressed with the following:
- Make use of pyproject.toml: Use pyproject.toml to hold all the declarative metadata currently in setup.py (name, version, dependencies, classifiers, etc.), as per the PEP 621 standard.
- Simplify setup.py: The setup.py script would then be simplified to handle only the C++ ext_modules logic. This creates a clean separation of concerns, making the build process easier to understand and maintain. setuptools will automatically read all project metadata from the new pyproject.toml.
- Introduce uv: use uv and its lockfile to solve the speed and consistency issues. Integrate tox-uv. CI workflows and CONTRIBUTING.md can then be updated to use uv pip sync for blazingly fast dependency installation.
Benefits of Changing
- Lower Barrier for New Contributors: A faster, simpler, and more reliable setup process makes it much easier for people to start contributing.
- Faster CI/CD: Reduces build and test times for all pull requests, allowing for quicker feedback and merging.
- Eliminate Dependency Issues: Lock files guarantee that every contributor and every CI run uses the exact same set of dependencies.
- Future-Proofing: Aligns the project with modern Python packaging standards, ensuring better compatibility with the evolving tool ecosystem.