feat(compose): Add support for docker compose up SERVICE --no-deps#708
Merged
gabrieldemarmiesse merged 1 commit intogabrieldemarmiesse:masterfrom Mar 3, 2026
Conversation
This PR adds support for the `--no-deps` flag in the `docker compose up` command. ``` --no-deps Don't start linked services ``` In the Python API, this is exposed via a new `dependencies` boolean parameter (defaulting to `True`) in the `docker.compose.up()` method. When set to `False`, the underlying CLI call includes the `--no-deps` flag, preventing Docker Compose from starting linked services. This maintains compatibility with the `docker.compose.run` method.
gabrieldemarmiesse
approved these changes
Mar 3, 2026
Owner
gabrieldemarmiesse
left a comment
There was a problem hiding this comment.
Great PR, many thanks!
f0b529e
into
gabrieldemarmiesse:master
21 checks passed
Contributor
Author
|
@gabrieldemarmiesse Thanks for maintaining this! Just checking in to see if a new release might be on the horizon. No rush, just curious so I can plan my next update. Cheers! |
Owner
|
Sure thing, I'll do one now :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for the
--no-depsflag in thedocker compose upcommand.In the Python API, this is exposed via a new
dependenciesboolean parameter (defaulting toTrue) in thedocker.compose.up()method. When set toFalse, the underlying CLI call includes the--no-depsflag, preventing Docker Compose from starting linked services.This maintains compatibility with the
docker.compose.runmethod.Type of change
Key Changes
python_on_whales/components/compose/cli_wrapper.pyupmethod signature and its overloads to includedependencies: bool = True.--no-depsflag to the command whendependenciesis set toFalse.tests/python_on_whales/components/test_compose.pytest_docker_compose_up_dependenciesthat verifies:dependencies=True, both the target service and its dependencies are started.dependencies=False, only the target service is started.How to use
Checklist