tool.rye.scripts looks promising as it helps to automate some parts of my development process.
However, I found it lacking pre-or post- hooks for commands.
For example, I want to run a test suite in my project, which depends on a local service which I run via Docker, and after the test suite succeeds or fails, I want to stop local services and clean up everything, keeping my development environment clean.
The catch is to perform post-hook in a separate shell/process to have a robust way to clean up regardless of how badly the main script failed.
tool.rye.scripts
looks promising as it helps to automate some parts of my development process. However, I found it lacking pre-or post- hooks for commands. For example, I want to run a test suite in my project, which depends on a local service which I run via Docker, and after the test suite succeeds or fails, I want to stop local services and clean up everything, keeping my development environment clean. The catch is to perform post-hook in a separate shell/process to have a robust way to clean up regardless of how badly the main script failed.This functionality could look like this:
so the whole process would be called by a single command
rye run itest
.The similar functionality is present in PDM.