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

"fail_fast=false" for scripts chain #1274

Open
chrisjsewell opened this issue Jul 25, 2024 · 1 comment
Open

"fail_fast=false" for scripts chain #1274

chrisjsewell opened this issue Jul 25, 2024 · 1 comment

Comments

@chrisjsewell
Copy link
Contributor

chrisjsewell commented Jul 25, 2024

Currently for https://rye.astral.sh/guide/pyproject/#chain

If any of the commands fails, the rest of the commands won't be executed and the chain fails.

But it would be good if there was an option to make it work similar to how rye test -a works:

If any of the commands fails, the rest of the commands WIILL stil be executed but the chain fails.

This would be useful for running multiple checks and also, for my use case, to run mypy against each package in a monorepo (since unfortunately at present it does not support monorepos), e.g.

[tool.rye.scripts]
"mypy:package_a" = "mypy --config-file python/package_a/pyproject.toml python/package_a/src"
"mypy:package_b" = "mypy --config-file python/package_b/pyproject.toml python/package_b/src"
"mypy:all" = { chain = ["mypy:package_a", "mypy:package_b"], fail_fast = false }
@nikhilweee
Copy link
Contributor

Another use case is running coverage report after tests, regardless of whether they pass or fail. We could also name this new option is keep_going, in line with what PDM uses. Reference: https://pdm-project.org/latest/usage/scripts/#composite

[tool.rye.scripts]
"tests:coverage" = "coverage run -m unittest discover tests"
"tests:report" = "coverage report"
"tests" = { chain = ["tests:coverage", "tests:report"], keep_going = true }

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

No branches or pull requests

2 participants