Generate recipe from project tree using pypa/build
Description
This is the start of something I've wanted: grayskull pypi . on a checkout to generate a recipe, suitable for committing to the project tree. Like https://github.com/conda/conda/blob/main/recipe/meta.yaml#L5-L7 where source is "../" or the parent directory of the meta.yaml.
pypa/build gets all project metadata in a standard way, including the build-system requires (setuptools, flit, poetry). If these are not already installed, we should add a "conda install project.metadata_path(...) or bail and let the user install those. We would also change the pip command used in the build: section so that we never accidentally pip install a build requirement.
Remaining to be done, process all possible metadata out of distribution and into recipe; possibly deal with late "we don't know the package name until after fetch_data" more elegantly since this breaks grayskull's current assumptions.
It's also a little awkward that the recipe output dir is always <given directory>/<project name>. These would be <checkout>/conda.recipe/meta.yaml when included as first-party recipes.
Fix #542
is this still as a draft?
I would like feedback but it is still a draft, it's not clean yet.
@beenje I have been refining this technique here. It makes a wheel and immediately converts it to .conda without bothering with conda-build or a recipe. But it's focused on editable installs and there's no supporting code to manage build dependencies etc. In the future the metadata convert part might be shareable.
pyproject.toml doesn't give your imports in a generic way. You could inspect the contents of a wheel. You could have build-system-specific handling like how flit's name= must match the Python import.
@beenje I have been refining this technique here. It makes a wheel and immediately converts it to
.condawithout bothering with conda-build or a recipe. But it's focused on editable installs and there's no supporting code to manage build dependencies etc. In the future the metadata convert part might be shareable.
Nice! Another project I have to look into :-)