Commit Graph

45 Commits

Author SHA1 Message Date
mjbogusz
ca38a543e8
Merge 260e9cc254 into faa7dee456 2025-12-01 17:27:08 +01:00
Felix Fontein
dbc7b0ec18
Cleanup with ruff check (#1182)
* Implement improvements suggested by ruff check.

* Add ruff check to CI.
2025-10-28 06:58:15 +01:00
Felix Fontein
3350283bcc
Add typing information, 1/2 (#1176)
* Re-enable typing and improve config.

* Make mypy pass.

* Improve settings.

* First batch of types.

* Add more type hints.

* Fixes.

* Format.

* Fix split_port() without returning to previous type chaos.

* Continue with type hints (and ignores).
2025-10-23 07:05:42 +02:00
Felix Fontein
c75aa5dd64
Python code modernization, 5/n (#1165)
* Address raise-missing-from.

* Address simplifiable-if-expression.

* Address unnecessary-dunder-call.

* Address unnecessary-pass.

* Address use-list-literal.

* Address unused-variable.

* Address use-dict-literal.
2025-10-12 16:02:27 +02:00
Felix Fontein
892e9d9cbd Reorganize imports due to https://github.com/ansible-community/antsibull-nox/pull/136. 2025-10-10 21:19:28 +02:00
Felix Fontein
e8ec22d3b1
Python code modernization, 3/n (#1157)
* Remove __metaclass__ = type.

for i in $(grep -REl '__metaclass__ = type' plugins/ tests/); do
  sed -e '/^__metaclass__ = type/d' -i $i;
done

* Remove super arguments, and stop inheriting from object.
2025-10-10 08:11:58 +02:00
Felix Fontein
a3efa26e2e
Address some pylint issues (#1155)
* Address cyclic-import.

* Address redefined-builtin.

* Address redefined-argument-from-local.

* Address many redefined-outer-name.

* Address pointless-string-statement.

* No longer needed due to separate bugfix.

* Address useless-return.

* Address possibly-used-before-assignment.

* Add TODOs.

* Address super-init-not-called.

* Address function-redefined.

* Address unspecified-encoding.

* Clean up more imports.
2025-10-09 20:11:36 +02:00
Felix Fontein
acf18f0ade
Add more CI checks (#1150)
* Enable mypy.

* Add flake8.

* Add pylint with a long list of ignores to be removed.
2025-10-07 19:37:16 +02:00
Felix Fontein
117271579e
Make all doc fragments, module utils, and plugin utils private (#1144)
* Make all doc fragments, module utils, and plugin utils private.

* Remove some unused and no longer needed imports.

This hopefully also fixes the CI issues, which do not happen locally for me...

* Fix formatting.

* Try to make CI happy, again.

* Fix imports.

* Lint.
2025-10-07 07:32:33 +02:00
Felix Fontein
d65d37e9e9 Reformat code with black and isort. 2025-10-06 18:34:59 +02:00
Felix Fontein
f45232635c
Python code modernization, 1/n (#1141)
* Remove unicode text prefixes.

* Replace str.format() uses with f-strings.

* Replace % with f-strings, and do some cleanup.

* Fix wrong variable.

* Avoid unnecessary string conversion.
2025-10-06 18:30:54 +02:00
Felix Fontein
1f2817fa20
Prepare 5.0.0 (#1123)
* Bump version to 5.0.0-a1.

* Drop support for ansible-core 2.15 and 2.16.

* Remove Python 2 and early Python 3 compatibility.
2025-10-05 20:22:50 +02:00
Felix Fontein
ebe42308cc
Replace ansible.module_utils.six with own module utils in some cases (#1138)
* Replace ansible.module_utils.six with own module utils in some cases.

* Add ignore.txt entires.
2025-10-04 23:45:27 +02:00
Maciej Bogusz
f9925d770e docker_compose_v2_build: reference in other docs 2025-07-09 19:45:45 +02:00
Felix Fontein
2487d1a0bf Fix linting errors. 2025-04-26 12:39:00 +02:00
Felix Fontein
635716c07b
docker_compose_v2: use --yes when available instead of -y (#1060)
* Use --yes if available.

* Add smoke test.
2025-03-21 22:05:10 +01:00
londondaintta
c13b891bc9
fix(docker_compose_v2): fix version check (#1059)
* fix version check

* add changelog fragment
2025-03-17 20:20:21 +01:00
Jonas Geiler
a3f9c21228
fix(docker_compose_v2): use correct flag for assume_yes (#1054)
* fix: use correct flag for `assume_yes`

The correct flag is `--y`, not `--yes`.

* refactor(docker_compose_v2): use `-y` instead of `--y` to ensure future compatibility

Maybe they'll change it back to `--yes` sometime, so I'll use the short form that most likely won't change.

* docs(docker_compose_v2): add note about `-y` flag

Co-authored-by: Felix Fontein <felix@fontein.de>

* chore: add changelog fragment

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-03-10 22:18:45 +01:00
londondaintta
187014101b
add --yes parameter to docker compose up (#1045)
* add yes option for compose up to assume yes and prevent hanging

* fix type

* add default

* add changelog fragment

* Apply doc suggestion

Co-authored-by: Felix Fontein <felix@fontein.de>

* set version_added to 4.5.0

* use `assume_yes` to avoid clashing with yaml `yes` keyword

* add version check

* default self.yes to False

* update description

* Fail on older version

Co-authored-by: Felix Fontein <felix@fontein.de>

* update changelog fragment

* update description

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-03-01 15:03:23 +01:00
Felix Fontein
5bfec5d4d2
Add 'idempotent' attribute (#1022)
* Add 'idempotent' attribute.

* Mention check mode in attribute description.

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2024-12-30 21:11:14 +01:00
Felix Fontein
769d15de63
Reformat documentation with 'andebox yaml-doc' (#1020)
* Reformat documentation with 'andebox yaml-doc'.

* Revert unwanted changes.

* Fix too long lines.

* Fix broken quotes.

* Forgot two line breaks.
2024-12-28 16:40:50 +01:00
Felix Fontein
f69536ef3b Improve language. 2024-12-28 14:30:49 +01:00
Felix Fontein
2e7b4e4605
docker_compose_v2: add ignore_build_events option; ignore build events by default (#1011)
* Add ignore_build_events option.

* Adjust docs and tests.

* Switch default to true.

* Remove unnecessary parts from tests.
2024-12-14 19:54:40 +01:00
Christoph
be5564d4de
add renew_anon_volumes parameter to docker compose up (#977)
* add `renew_anon_volumes` parameter to `docker compose up`

* Apply suggestions from code review

Apply suggested changes to Documentation

Co-authored-by: Felix Fontein <felix@fontein.de>

* Fix sanity check error

apply suggestion from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* add changelog fragment for PR #977

* apply suggested changes to changelog fragment

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Christoph Sieber <Christoph.Sieber@telekom.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
2024-10-19 14:21:13 +02:00
Felix Fontein
f7823ea626
Prepare 4.0.0 release. (#971) 2024-10-18 21:01:49 +02:00
Felix Fontein
3cc27ecd65
Handle yet another random unstructured error output. (#949) 2024-08-07 15:58:23 +02:00
Felix Fontein
0fe84b510b
docker_compose_v2_pull: add new options ignore_buildable, include_deps, and services; fix service CLI for docker_compose_v2 module (#942)
* Add new options for --ignore-buildable, --include-deps, and for providing services.

* Add services after -- and not before.
2024-07-25 20:47:32 +02:00
Felix Fontein
22bbfbaf8b
CLI modules: improve docker version/info output processing, avoid querying for API version if it's not needed (#935)
* Don't assume that docker version/info JSON output contains the expected fields.

* Allow CLI modules to not require the API version.

* Add changelog fragment.
2024-07-20 15:51:02 +02:00
Felix Fontein
259f2cf8b7
Fix docker_compose_v2 example. (#917) 2024-07-06 21:20:13 +02:00
Sih Sîng-hông薛丞宏
a22e92cdc0
Update the example of docker_compose_v2.py (#874)
`docker-compse` => `docker compose`.
2024-06-04 13:01:23 +02:00
Felix Fontein
9e8c367c47
docker_compose_v2: allow to specify inline compose definitions (#832)
* Allow to specify inline compose definitions.

* Remove comma that trips Python 2.7.

* Add tests.

* Add PyYAML as EE dependency.

* Be more explicit on PyYAML.
2024-04-09 17:41:12 +02:00
Felix Fontein
4bab9a6b0e
Fix idempotency of docker_compose_v2_pull. (#814) 2024-03-13 13:20:11 +01:00
Felix Fontein
6f5d67860c
docker_compose_v2: ignore some pull events (#803)
* Ignore some pull events.

* Adjust tests.
2024-02-23 18:24:16 +01:00
Felix Fontein
e494464e56
Add wait and wait_timeout options. (#796) 2024-02-14 22:48:36 +01:00
Felix Fontein
b5d085bb88
Parse build events from stderr. (#779) 2024-01-25 06:40:32 +01:00
Felix Fontein
32cb76b164
Add scale option. (#776) 2024-01-24 07:16:33 +01:00
Felix Fontein
37d0a44c0b
Adjust descriptions. (#766) 2024-01-20 14:13:11 +01:00
Felix Fontein
c3322fd55b Fix typo. 2024-01-17 12:58:20 +01:00
Felix Fontein
6082efc855
Improve docs sharing for docker_compose_v2* modules; fix examples and return docs for docker_compose_v2_pull (#761)
* Move more common documentation to docs fragment.

* Fix examples and return values for docker_compose_v2_pull.

* Remove ignore.
2024-01-17 07:53:44 +01:00
Felix Fontein
22d956efa8
Allow to pass --build or --no-build to 'docker compose up'. (#760) 2024-01-17 06:57:35 +01:00
Simon Baerlocher
98a74b1f9c
feat: add docker-compose services support. (#758)
* feat: add docker-compose services support.

fix: typo

* fix: error

* fix: ci Job

* feat: add argument_spec

* fix: whitespace

* feat: refactored docker_compose_v2 in response to feedback
2024-01-16 19:07:12 +01:00
Felix Fontein
8ca5e2f810
Extract more common code and docs fragment for Docker Compose. (#748) 2024-01-07 18:17:10 +01:00
Felix Fontein
cb4dd2fed1
docker_compose_v2: move some code to module_utils (#747)
* Move some code to module_utils.

* Add unit tests.

Test cases are auto-generated from integration test logs.

* Rename ResourceEvent → Event.
2024-01-07 16:17:31 +01:00
Felix Fontein
eed89f32eb
docker_compose_v2: allow to specify pull policy; parse pull events; improve error handling; always return stderr (#746)
* Add pull option for 'docker compose up'.

* Improve dry-mode event parsing, and also parse pull-related events.

* Improve error handling, and add first tests.

* Fix action status documentation.

* Add more tests.

* Always return stderr.

This makes debugging misbehavior a lot easier since you can see
what 'docker compose' actually returned.

* Reformat existing tests.
2024-01-07 08:45:20 +01:00
Felix Fontein
b774837183
Add docker_compose_v2 module (#739)
* Add docker_compose_v2 module.

* Add note on compatibility.

* Parse more events.

Emit warnings (or things we assume are warnings), and report unparsable
messages to the user so they can report them to us.
2024-01-03 07:05:08 +00:00