paketo-buildpacks / python

Apache License 2.0
42 stars 10 forks source link

Add a buildpack to set the start command from `pyproject.toml` using `[project.scripts]` #580

Open OscartGiles opened 1 year ago

OscartGiles commented 1 year ago

Describe the Enhancement

The paketo-buildpacks/poetry-run sets the start command for a poetry application. It expects a single entry in pyproject.toml under scripts:

[tool.poetry.scripts]
some-script = "some.module:some_method"

pyproject.toml has support for this outside of poetry using [project.scripts] (see PEP621).

It would be great to support adding a start command for python packages with pyproject.toml files.

Possible Solution

A new buildpack could be added, very similar to paketo-buildpacks/poetry-run but for pyproject.toml containing [project.scripts].

robdimsdale commented 1 year ago

I think this would be a great addition. I think it would belong in here: https://github.com/paketo-buildpacks/python-start - rather than a separate buildpack

robdimsdale commented 1 year ago

If you're willing and able to contribute this that would be great! I'm happy to help provide direction/context so let us know if there's anything you need to get started.

codecakes commented 1 year ago

Does

[tool.poetry.scripts]
start = "module:entry_app"

not work currently as given in packeto builder docs ?