Fix from future - #31
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Python tooling and regenerated sources, primarily to align with newer Ruff/typing conventions and to modernize the source-generation utilities.
Changes:
- Update Python project metadata and lockfile (Python requirement loosened; Ruff bumped to
>=0.16.2and lock updated accordingly). - Add Ruff lint configuration to
pyproject.toml. - Modernize the code generator and parsing utilities (future annotations,
collections.abctyping imports,subprocess.run(..., check=True), minor refactors) and regenerate runner modules to includefrom __future__ import annotations.
Reviewed changes
Copilot reviewed 38 out of 40 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Updates Python requirement metadata and bumps/locks Ruff to 0.16.2. |
| pyproject.toml | Loosens requires-python, bumps Ruff, and adds Ruff lint configuration. |
| README.md | Trims trailing spaces in example output. |
| src/docker_composer/_utils/generate_class.py | Modernizes generator typing/imports and subprocess handling; updates generated template. |
| src/docker_composer/_utils/argument.py | Updates typing imports and annotations; minor refactors in parsing helpers. |
| src/docker_composer/runner/root.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/attach.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/build.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/commit.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/config.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/cp.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/create.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/down.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/events.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/exec.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/export.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/images.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/kill.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/logs.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/ls.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/pause.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/port.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/ps.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/publish.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/pull.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/push.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/restart.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/rm.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/run.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/scale.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/start.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/stats.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/stop.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/top.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/unpause.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/up.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/version.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/volumes.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/wait.py | Adds from __future__ import annotations to generated module. |
| src/docker_composer/runner/cmd/watch.py | Adds from __future__ import annotations to generated module. |
Suppressed comments (1)
src/docker_composer/_utils/generate_class.py:217
- The
write_classdocstring documents afile_nameparameter, but the function signature doesn't accept one (it computesfile_nameinternally). This can confuse callers and IDE help; update the docstring to match the actual API.
"""Generate a class for `cmd` and write it to `file_name`.
:param cmd: docker-compose command to create or an empty string for root.
:param file_name: Name of output file (empty/None for auto-generation)
:return:
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
45
to
+49
| process = subprocess.run( | ||
| ["script", "-q", "-c", full_cmd, "/dev/null"], | ||
| capture_output=True, | ||
| text=True, | ||
| check=True, |
Comment on lines
+60
to
+61
| [tool.ruff.lint.per-file-ignores] | ||
| "!src/docker_composer/_utils/*.py" = ["ALL"] |
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.
No description provided.