-
Notifications
You must be signed in to change notification settings - Fork 98
Description
Summary
Add native support for generating conda recipes from pyproject.toml files to the rattler-build generate-recipe command. This would integrate the core functionality from pyrattler-recipe-autogen directly into rattler-build, eliminating the need for a separate tool.
Motivation
Currently, Python developers need to generate a recipe manually for their own projects that have not been published to PyPI or some other registry. It would be very beneficial to be able to generate conda recipes from their pyproject.toml files. This creates friction in the workflow and requires maintaining separate tooling. By integrating this functionality directly into rattler-build, we can:
- Streamline the workflow - One tool for all recipe generation needs
- Reduce dependencies - No need to install and maintain separate tools
- Improve consistency - Unified interface and behavior across all recipe types
- Better maintenance - Single codebase to maintain and update
Proposed Solution
I had originally started working on pyrattler-recipe-autogen to create the recipe.yaml based on the information found in the pyproject.toml. I believe this functionality would be better suited as an integration into the existing rattler-build generate-recipe functionality. I propose adding a new subcommand: rattler-build generate-recipe pyproject [--input <pyproject.toml>] [--output <recipe.yaml>]
Key Features
- Full pyproject.toml parsing - Extract project metadata, dependencies, and build system requirements
- Dependency conversion - Convert Python package dependencies to conda format with proper version constraints
- Schema version support - Configurable schema version with YAML language server headers
- Conda overrides - Support for
tool.conda.recipe.*configuration sections - Entry points handling - Convert
project.scriptsto conda recipe entry points - Build system integration - Add build system requirements to host dependencies
Example Usage
# Generate recipe from pyproject.toml
rattler-build generate-recipe pyproject