1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-04 23:37:12 +00:00
No description
Find a file
Mariam Ahhttouche c1c389e684
Add module to manage Python versions using uv (#11537)
* Add minimal uv_python module

uv_python module: add integration tests

* uv_python module: handle absent state

uv_python module: add integration tests

* uv_python module: restrict accepted version formats to X.Y and  X.Y.Z

uv_python module: add integration tests for version format

* uv_python module: add _list_python and _get_latest_patch_release methods

* uv_python module: add support for latest state

uv_python module: add integration tests for latest state

* uv_python module: add integration tests for check mode

* uv_python module: improve latest state check mode to show version that will be installed

* uv_python module: make latest state more deterministic by using install with explicite version

* uv_python module: improve absent state check mode and add corresponding integration test

* uv_python module: update latest state handling to sort versions without relying on uv behavior

uv_python module: improve integration tests

uv_python module: improve module return values

* uv_python module: add integration test for when uv executable does not exist

uv_python module: improve exception handling

* uv_python module: add integration test for case when specified version does not exist

* uv_python module: handle case when provided python version does not exist in latest state

uv_python module: improve methods' return values and add docstrings

uv_python module: improve integration tests

* uv_python module: improve check mode for present state to fail when no patch version is available

* uv_python module: return commands' stderr and return code as a variable of stdout

* uv_python module: add python version to module return values for present state

* uv_python module: add python version to module return values for absent state

* uv_python module: add python version to module return values for latest state

uv_python module: fix integration tests

* uv_python module: add installation paths to return values for present state

* uv_python module: add installation paths to return values for absent state

* uv_python module: add installation paths to return values for latest state

* uv_python module: update present, absent and latest state to only include versions managed by uv in return values

uv_python module: improve integration tests

uv_python module: update module documentation

* uv_python module: use LooseVersion  instead of StrictVersion to allow specifying threaded and major python versions

* uv_python module: fail module if used uv version is less than the minimal supported version

uv_python module: update documentation

* uv_python module: add uv command options to executed commands to disable unneeded features

* uv_python module: use packaging.version to only accept canonical python versions

uv_python module: update integration tests

uv_python module: improve error messages

* uv_python module: pin uv version used in tests

Improve module documentation

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

Add integration tests' aliases file for uv_python module

* Use StrictVersion instead of packaging Version

* make integration tests more deterministic

Update attributes field in documentation

Save uv bin path in an attribute

Add another example in documentation

Apply PR feedback and refactor code

Fix typing to be compatible with python versions <= 3.8

Update example to use quotes for major.minor example and update documentation

Update test aliases

Use documentation fragment for uv_python attributes

* Add aliases to skip running tests on freebsd and rhel

Make uv_python tests more deterministic

Clean uv_python documentation

* Handle case when version given is an empty string in uv_python module

* Apply linguistic guidelines for plugins/modules/uv_python.py

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

Add Python version requirement in uv_python documentation

* Update tests to install uv using pip and fix some tests

Add typing to plugins/modules/uv_python.py

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

Update plugins/modules/uv_python.py documentation

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

* Add task to uv_python tests to add uv installation directory to PATH

* Update uv_python to log unparsed versions in debug mode

Refactor uv_python code

Remove uv python label in .github/BOTMETA.yml

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

Add typing to plugins/modules/uv_python.py

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

Fix uv python documentation

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

* Allow testing using Python versions lower or equal to 3.8

skip running ci tests in macos

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

* Make uv version check more resilient to cli output format change in uv_python module

Improve tests/integration/targets/uv_python/tasks/main.yaml

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

fix mypy union attr error

* update uv_python tests to run on rhel and freebsd

Update uv_python tests to use generic packge manager to install uv

Install uv with curl for freebsd in uv python tests

Install rust needed by uv in freebsd for uv python tests

Update up_python tests to fix uv installation path in RHEL

skip testing uv_python on freebsd as it only has tier 3 support by uv

Fix fragment name in uv_python.py

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

Update version_added in plugins/modules/uv_python.py

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

Update tests/integration/targets/uv_python/tasks/main.yaml

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

Make version shown on debug message more precise in uv_python module

* Handle case when uv python returns relative paths instead of absolute in uv_python module

Add more typing to uv_python module

* uv_python module: update debug message fo unsupported versions to be more clear

---------

Co-authored-by: Mariam Ahhttouche <mariam.ahhttouche@etu.univ-grenoble-alpes.fr>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-05-17 09:46:59 +02:00
.azure-pipelines CI: Replace Ubuntu 22.04 with 26.04 for ansible-core devel (#12052) 2026-05-15 10:08:58 +02:00
.devcontainer chore: devcontainer/pre-commit (#11729) 2026-04-03 21:49:23 +02:00
.github Add module to manage Python versions using uv (#11537) 2026-05-17 09:46:59 +02:00
changelogs Lookup plugins: prevent using _terms for positional arguments, and reject positional arguments completely for lookups that don't use them (#12060) 2026-05-17 09:43:21 +02:00
docs/docsite lmdb_kv lookup, guide_alicloud: fix deprecated list-format vars: in examples and docs (#11942) 2026-04-30 12:36:13 +12:00
LICENSES Remove no longer needed _mount module util (#11232) 2025-12-01 06:42:13 +01:00
meta uptimerobot: deprecate module (#11993) 2026-05-06 17:54:18 +12:00
plugins Add module to manage Python versions using uv (#11537) 2026-05-17 09:46:59 +02:00
tests Add module to manage Python versions using uv (#11537) 2026-05-17 09:46:59 +02:00
.git-blame-ignore-revs Add latest commit to .git-blame-ignore-revs. 2026-02-04 07:51:20 +01:00
.gitignore lvm_pv_move_data: new module (#10416) 2025-08-04 19:59:54 +02:00
.mypy.ini python_requirements_info: use importlib.metadata when available (#11495) 2026-02-10 22:44:06 +01:00
.pre-commit-config.yaml chore: devcontainer/pre-commit (#11729) 2026-04-03 21:49:23 +02:00
.yamllint CI: Add yamllint for YAML files, plugin/module docs, and YAML in extra docs (#10279) 2025-06-30 20:46:56 +02:00
antsibull-nox.toml Drop support for ansible-core 2.17 (#11906) 2026-04-20 21:04:58 +02:00
CHANGELOG.md Add MarkDown changelog and use it by default (#7941) 2024-02-09 13:08:50 +01:00
CHANGELOG.md.license Add MarkDown changelog and use it by default (#7941) 2024-02-09 13:08:50 +01:00
CHANGELOG.rst Remove leftovers. 2023-01-15 18:44:50 +01:00
CHANGELOG.rst.license Make reuse conformant (#5138) 2022-08-21 08:27:01 +02:00
commit-rights.md docs: migrate RTD URLs to docs.ansible.com (#11109) 2025-11-19 07:00:51 +01:00
CONTRIBUTING.md Fix description error in CONTRIBUTING.md (#11538) 2026-02-25 06:42:09 +01:00
COPYING Initial commit 2020-03-09 09:11:07 +00:00
galaxy.yml Prepare main for 13.0.0 (#11834) 2026-04-20 12:35:43 +02:00
noxfile.py Clean up other Python files (#11379) 2026-01-05 17:59:58 +01:00
README.md Drop support for ansible-core 2.17 (#11906) 2026-04-20 21:04:58 +02:00
REUSE.toml Migrate .reuse/dep5 to REUSE.toml. 2025-03-29 12:17:36 +01:00
ruff.toml Configure sorting imports in CI and formatting (#11410) 2026-01-09 19:37:02 +01:00

Community General Collection

Documentation Build Status EOL CI Nox CI Codecov REUSE status

This repository contains the community.general Ansible Collection. The collection is a part of the Ansible package and includes many modules and plugins supported by Ansible community which are not part of more specialized community collections.

You can find documentation for this collection on the Ansible docs site.

Please note that this collection does not support Windows targets. Only connection plugins included in this collection might support Windows targets, and will explicitly mention that in their documentation if they do so.

Code of Conduct

We follow Ansible Code of Conduct in all our interactions within this project.

If you encounter abusive behavior violating the Ansible Code of Conduct, please refer to the policy violations section of the Code of Conduct for information on how to raise a complaint.

Communication

  • Join the Ansible forum:

    • Get Help: get help or help others. This is for questions about modules or plugins in the collection. Please add appropriate tags if you start new discussions.
    • Tag community-general: discuss the collection itself, instead of specific modules or plugins.
    • Social Spaces: gather and interact with fellow enthusiasts.
    • News & Announcements: track project-wide announcements including social events.
  • The Ansible Bullhorn newsletter: used to announce releases and important changes.

For more information about communication, see the Ansible communication guide.

Tested with Ansible

Tested with the current ansible-core 2.18, ansible-core 2.19, ansible-core 2.20, ansible-core 2.21 releases and the current development version of ansible-core. Ansible-core versions before 2.18.0 are not supported. This includes all ansible-base 2.10 and Ansible 2.9 releases.

External requirements

Some modules and plugins require external libraries. Please check the requirements for each plugin or module you use in the documentation to find out which requirements are needed.

Included content

Please check the included content on the Ansible Galaxy page for this collection or the documentation on the Ansible docs site.

Using this collection

This collection is shipped with the Ansible package. So if you have it installed, no more action is required.

If you have a minimal installation (only Ansible Core installed) or you want to use the latest version of the collection along with the whole Ansible package, you need to install the collection from Ansible Galaxy manually with the ansible-galaxy command-line tool:

ansible-galaxy collection install community.general

You can also include it in a requirements.yml file and install it via ansible-galaxy collection install -r requirements.yml using the format:

collections:
- name: community.general

Note that if you install the collection manually, it will not be upgraded automatically when you upgrade the Ansible package. To upgrade the collection to the latest available version, run the following command:

ansible-galaxy collection install community.general --upgrade

You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax where X.Y.Z can be any available version:

ansible-galaxy collection install community.general:==X.Y.Z

See Ansible Using collections for more details.

Contributing to this collection

The content of this collection is made by good people just like you, a community of individuals collaborating on making the world better through developing automation software.

We are actively accepting new contributors.

All types of contributions are very welcome.

You don't know how to start? Refer to our contribution guide!

The current maintainers are listed in the commit-rights.md file. If you have questions or need help, feel free to mention them in the proposals.

You can find more information in the developer guide for collections, and in the Ansible Community Guide.

Also for some notes specific to this collection see our CONTRIBUTING documentation.

Running tests

See here.

Collection maintenance

To learn how to maintain / become a maintainer of this collection, refer to:

It is necessary for maintainers of this collection to be subscribed to:

  • The collection itself (the Watch button → All Activity in the upper right corner of the repository's homepage).
  • The "Changes Impacting Collection Contributors and Maintainers" issue.

They also should be subscribed to Ansible's The Bullhorn newsletter.

Publishing New Version

See the Releasing guidelines to learn how to release this collection.

Release notes

See the changelog.

Roadmap

In general, we plan to release a major version every six months, and minor versions every two months. Major versions can contain breaking changes, while minor versions only contain new features and bugfixes.

See this issue for information on releasing, versioning, and deprecation.

More information

Licensing

This collection is primarily licensed and distributed as a whole under the GNU General Public License v3.0 or later.

See LICENSES/GPL-3.0-or-later.txt for the full text.

Parts of the collection are licensed under the BSD 2-Clause license and the MIT license.

All files have a machine readable SDPX-License-Identifier: comment denoting its respective license(s) or an equivalent entry in an accompanying .license file. Only changelog fragments (which will not be part of a release) are covered by a blanket statement in REUSE.toml. This conforms to the REUSE specification.