Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: run tasks defined in [tool.poetry.tasks] #7896

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

finswimmer
Copy link
Member

@finswimmer finswimmer commented May 9, 2023

Example pyproject.toml:

[tool.poetry]
name = "tasks"
version = "0.1.0"
description = ""
authors = ["finswimmer <[email protected]>"]
readme = "README.md"

[tool.poetry.tasks]
version = "python --version"
test = "pytest tests"

[tool.poetry.dependencies]
python = "^3.11"
pytest = "^7.3.1"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

Example usage:

poetry run version
poetry run test

Closes #2496

@finswimmer finswimmer changed the title feat: run tasks defined ini [tool.poetry.tasks] feat: run tasks defined in [tool.poetry.tasks] May 9, 2023
@dimbleby
Copy link
Contributor

Acknowledging that clearly this is a thing that you think would be useful, and also that there have been feature requests for this sort of thing so you are not alone - I would want to discourage poetry from going in this direction.

It seems to me that poetry already has more features (and bugs) than maintainers and contributors can keep up with - see the state of this issue tracker for evidence. Adding "be a task-runner" to the things that poetry does is likely to make that even more true, and dilute the available resource still further.

Being a task-runner is both no small matter, and already well-served by other solutions: poethepoet is the obvious example in the poetry ecosystem (lots of non-poetry based approaches are also possible). Duplicating the work of that plugin seems to me both to be quite a lot of work, and not necessary - it already exists!

Of course people will work on the things that interest them. When I occasionally wish for a better poetry project, "more features" is not what comes to mind. But, that's just one person's opinion...

@radoering
Copy link
Member

I completely agree with dimbleby, but I may be in the minority among maintainers.

@clintonroy
Copy link
Contributor

I certainly would use it, and would appreciate it being built in. Maybe in time there will be something like this upstream, but..that could be a long time in waiting.

@dimbleby
Copy link
Contributor

Maybe in time there will be something like this upstream

what do you mean by "upstream"?

Did you try poethepoet? why not, or what's wrong with it?

I've never used it myself so maybe there are good reasons to avoid it. But it sounds as though you are saying "I would use a solution if it existed"; while so far as I know a solution does exist!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saving custom scripts in pyproject.toml (alias npm run)
4 participants