Commit Graph

13 Commits

Author SHA1 Message Date
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
741c318b1d
Python code modernization, 2/n (#1156)
* Adjust all __future__ imports:

for i in $(grep -REl "__future__.*absolute_import" plugins/ tests/); do
  sed -e 's/from __future__ import .*/from __future__ import annotations/g' -i $i;
done

* Remove all UTF-8 encoding specifications for Python source files:

for i in $(grep -REl '[-][*]- coding: utf-8 -[*]-' plugins/ tests/); do
  sed -e '/^# -\*- coding: utf-8 -\*-/d' -i $i;
done

* Reformat.
2025-10-09 20:46:48 +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
a1e9412bed
Use new tools from community.internal_test_tools. (#1061) 2025-03-22 11:59:27 +01:00
Felix Fontein
9730b2a3c3
Use shared unit test utils from community.internal_test_tools. (#1056) 2025-03-12 21:39:05 +01:00
Felix Fontein
f429017d94
Add inventory filter capability (#698)
* Add inventory filter capability.

* Use community.library_inventory_filtering_v1 collection.

* Bump dependency to 1.0.0.

* Mention the new dependency in the changelog.
2024-01-13 15:51:02 +01:00
Felix Fontein
449b91d489
Remove unnecessary test imports. (#583) 2023-02-12 20:59:51 +01:00
Maxwell G
a33e51e04a
Prefer unitest.mock by universally using compat.mock (#433)
* Prefer unitest.mock by using compat.mock

`mock` is a backport of the `unittest.mock` module from the stdlib, and
there's no reason to use it on newer Python versions. `mock` is deprecated
in Fedora, so I figured I'd propose this here before downstream patching
our ansible-collection-community-docker package.

* Remove compat.mock code for older Python 3 versions

This removes compatibility for older versions of Python 3 that are no
longer supported.
2022-07-31 16:39:31 +02:00
Felix Fontein
a4539a309e
Move licenses to LICENSES/, use SPDX-License-Identifier, mention all licenses in galaxy.yml (#430)
* Move licenses to LICENSES/, use SPDX-License-Identifier, mention all licenses in galaxy.yml.

* ignore.txt lines cannot be empty or contain only a comment.

* Cleanup.

* This particular __init__.py seems to be crucial.

* Try extra newline.

* Markdown comments are a real mess. I hope this won't break Galaxy...

* More licenses.

* Add sanity test.

* Skip some files, lint.

* Make sure there is a copyright line everywhere.

* Also check for copyright line in sanity tests.

* Remove colon after 'Copyright'.

* Normalize lint script.

* Avoid colon after 'Copyright' in lint script.

* Improve license checker.

* Update README.md

Co-authored-by: Maxwell G <9920591+gotmax23@users.noreply.github.com>

* Remove superfluous space.

* Referencing target instead of symlink

Co-authored-by: Maxwell G <9920591+gotmax23@users.noreply.github.com>
2022-07-20 07:45:33 +02:00
Felix Fontein
23a90668c9
Rewrite the docker_containers inventory plugin (#413)
* Rewrite the docker_containers inventory plugin.

* Improve error messages.
2022-07-06 21:48:32 +02:00
Felix Fontein
9b131399ce
Docker inventory plugin (#61)
* Began with docker inventory plugin.

* Linting.

* Improve plugin, add basic unit tests.

* Linting.

* Add integration test.

* Adjust tests to case that there are more containers.

* There can be stopped containers.

ci_coverage

* docker -> docker_containers
2020-12-30 08:44:24 +01:00