Commit Graph

163 Commits (devel)

Author SHA1 Message Date
Matt Davis 889012e29e
clean up ansible-connection (#82992)
* clean up ansible-connection stuff

* eliminate unnecessary usage of pty/termios
* always use default pickle protocol
* remove unnecessary wire hashing

Co-authored-by: Kate Case <this.is@katherineca.se>
1 month ago
Martin Krizek 3a6f825a8e
dnf - honor installroot and substitutes in paths (#83011)
In #80094 support for var substitution for cachedir was added but there
are more options that should be supported. Using an API for
prepend_installroot which should be done anyway provide that feature
so use that. In addition, perform the operation once all substitutes
are in place (releasever as well).
2 months ago
Benoît Knecht d304fd86c2
modules/dnf: Substitute variables in DNF cache path (#80094)
The cache directory can be specified with variables that are expanded by DNF, for example,

```
cachedir=/var/cache/yum/$basearch/$releasever
```

But the `dnf` module would use that path literally, instead of replacing
`$basearch` and `$releasever` with their values.

This commit ensures that variables in `cachedir` are properly substituted.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2 months ago
Matt Clay cd365057d3 Remove more Python 2.x compat code 2 months ago
Matt Clay 1c17fe2d53
Drop Python 3.7 support (#82982) 2 months ago
Matt Clay ca168eb367 ansible-test - Fix Alpine libexpat bootstrapping 2 months ago
Matt Clay a1ad7100df
ansible-test - Handle externally managed Python (#82883)
Remove EXTERNALLY-MANAGED marker in ansible-test managed environments

Additional changes:

- Test the Alpine 3.19 container
- Stop testing Alpine 3.18 container and remote
- Add missing changelog entry the Alpine 3.19 container
2 months ago
Brian Coca ddae41759c
Add FreeBSD 13.3 and 14.0 to ansible-test (#82530)
Co-authored-by: Matt Clay <matt@mystile.com>
2 months ago
Felix Fontein 0c9f1989a7 Do not treat leading underscore in plugin names as attempted deprecation. 2 months ago
Matt Clay c8d6f7b95e ansible-test - Fix validate-modules Python handling
The ``validate-modules`` sanity test no longer attempts to process files with unrecognized extensions as Python.

Integration tests have been added to verify Python-specific checks do not apply to these files.

The `invalid-extension` and `missing-gplv3-license` checks still apply to these files. This may change in the future.
4 months ago
Matt Martz e458cbac61
Allow for arbitrary key 'context' in argument spec (#82183)
* Allow for arbitrary key 'context' in argument spec
4 months ago
Martin Krizek f024cf35d7
Remove the yum module, redirect it to dnf (#81895)
Fixes #81728
4 months ago
Nilashish Chakraborty b01f1f207c
Support `action_plugin` in plugin_routing_schema (#82562)
now validation schema matches reality

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
5 months ago
Matt Clay 21247c828e ansible-test - Bypass PEP 668 checks
When ansible-test installs requirements, it now instructs pip to allow installs on externally managed environments as defined by PEP 668.

This only occurs in ephemeral environments managed by ansible-test, such as containers,
or when the `--requirements` option is used.
5 months ago
Matt Clay c75624fbdc ansible-test - Enable shellcheck SC2164 5 months ago
Mark Chappell 5346009d2c
ansible-test - Allow multiple documents in the YAML stream for EXAMPLES (#82355)
* Allow multiple documents in the YAML stream for EXAMPLES.

* Add integration test

* linting
6 months ago
Abhijeet Kasurde e6e19e37f7
validate-modules: Check for correct values in choice (#82266)
* validate-modules: Check for correct values in choice

* validate-modules test now checks the length of choices and
  correct option values inside the choice.

Fixes: #82179

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Fix sanity tests

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 months ago
Matt Clay 9dd3eafa14 ansible-test - Use pylint unidiomatic-typecheck
This replaces the regex based check previously used within the validate-modules sanity test.

NOTE: The pylint check overlaps with a similar check for pep8.
      Both are used, since the pep8 based check is more nuanced than the one in pylint.
      For example, allowing `is` checks, but not `==` comparisons.
      If the pylint check is ignored, the pep8 check would still be relevant.
7 months ago
Matt Clay 36d6860d80 ansible-test - Remove no-main-display sanity test 7 months ago
Matt Clay 6e15fb0ebf ansible-test - Removed no-basestring sanity test 7 months ago
Matt Clay c349b91af3 ansible-test - Removed no-dict-* sanity tests 7 months ago
Matt Clay 9765bb46f9 ansible-test - Remove no-unicode-literals test 7 months ago
Brian Coca 9ee603d1c5
Clarify some points in config lookup documentation (#81951)
Also update tests to support the format on modules/plugins

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
7 months ago
Matt Clay 37cee8bdfc
ansible-test - Remove special cryptography install (#82008)
Python 3.10 is the minimum version on the controller, and it requires openssl 1.1.1 or later.

As a result, there's no need to check the openssl version any longer.
8 months ago
Matt Clay f5c742cdfd
ansible-test - Clean up old Python 2 compat code (#81962)
* Update generated code __future__ import

* Remove Python 2.x compat from compile sanity test

* Remove __metaclass__ from pylint good names list

* Remove Python 2.x compat from ansible-test injector

* Remove Python 2.x compat from ansible-test importer

* Remove Python 2.x compat from ansible-test units

* Remove Python 2.x compat from validate-modules

* Remove Python 2.x compat from pylint plugins

* Remove more Python 2.x compat from ansible-test

* Remove Python 2.x openssl detection in ansible-test

* Remove obsolete Python 2.x comment

* Remove obsolete ansible-test Python 2.x support

* Remove unused bootstrap script functions

* Keep mypy happy

* Remove unused imports

* Keep pylint happy
8 months ago
Matt Davis d8484f0af7
Update default test container Python to 3.12 and support for PyLint 3.0.1 (#81953)
* temporary PyLint plugin to mask 3.12 finalizer noise

* ansible-test - Default to Python 3.12 for base/default

* ansible-test - Update pylint requirements

* ansible-test - Remove obsoleted changelog entry

* Add changelog fragment for pylint work-around
8 months ago
Sviatoslav Sydorenko d2ba76c117
Remove Python `< 3.5` `selectors` fallbacks (#81872) 8 months ago
Matt Clay 921efce43a
ansible-test - Remove more Python 2.7 / 3.6 support (#81898) 8 months ago
Matt Clay b94ee1cefd
Drop Python 2.7 and Python 3.6 support (#81866)
* Drop Python 2.7 and Python 3.6 support

* Remove obsolete _json_compat
8 months ago
Matt Clay f31c287348
ansible-test - Improve compatibility with pylint 3 (#81841) 8 months ago
Matt Clay 261e5ce381
ansible-test - Update mypy to 1.5.1 (#81602) 9 months ago
Matt Clay f28e32c063
ansible-test - Limit deprecated check to core (#81552)
Using `# deprecated:` comment checks in collections would effectively limit those collections to a single version of ansible-core.
10 months ago
Matt Clay 691c8e8603
Omit pre-built man pages from sdist (#81395)
Since man pages aren't accessible to users after a `pip install`, there's no need to include them in the sdist.
This change makes it trivial to build man pages from source, which makes them much easier to iterate on.
It also simplifies creation and testing of the sdist, since it no longer requires building man pages.

The new `packaging/cli-doc/build.py` script can generate both man pages and RST documentation.
This supports inclusion on the docs site without a dependency on `ansible-core` internals.
Having a single implementation for both simplifies keeping the two formats in sync.
10 months ago
Sloane Hertel 48dfe8e215
add Python 3.12 support to ansible-test (#80834)
* update docker containers versions to use newer ansible-test ref in the pre-built venvs

* Allow invoking ansible-test with Python 3.12

* Add python3.12 to the INTERPRETER_PYTHON_FALLBACK

* changelog

* add Python 3.12 as a non-default Python version for the test containers

* Update mypy ignores for Python 3.12

* Add Python 3.12 to CI matrix for unit tests, generic tests, and galaxy

* Update unit test for using the Python 2 collection loader path with Python 3.

Skip the existing test on Python 3.12, since find_module is removed.

Suppress the pre-existing deprecation warnings using the Python 2
codepath with Python 3.

Add a test for Python >= 3.12, which doesn't call find_module.

* Ignore sanity test errors on systems without libselinux present.
11 months ago
Matt Clay e964078a83
ansible-test - Pre-build PyYAML wheels (#81300)
This works around Cython failures when attempting to install PyYAML >= 5.4 <= 6.0.
11 months ago
Matt Clay 765b2bd783
ansible-test - Narrow the scope of some sanity tests (#81273)
* ansible-test - Limit scope of replace-urlopen test

Only ansible-core code and plugins in collections can be expected to rely on module_utils.

* ansible-test - Limit scope of use-compat-six test

Only ansible-core code and plugins in collections can be expected to rely on module_utils.

* ansible-test - Limit scope of no-get-exception test

Only ansible-core code and plugins in collections should be checked for usage of outdated module_utils functions.

* Add integration tests
11 months ago
Matt Clay 08307de366
ansible-test - Remove obsolete WinRM setup script (#81249)
The WinRM setup is handled internally by ansible-core-ci now.
11 months ago
Matt Clay 72e038e823
Remove `docs` and `examples` directories (#81011)
* Remove docs dir

* Updates to reflect docs removal

* Fix integration test

* Remove examples dir

* Updates to reflect examples removal

* Remove build_library and build-ansible.py

* Remove refs to build_library and build-ansible.py

* Remove obsolete template

* Remove obsolete template reference

* Remove the now obsolete rstcheck sanity test
11 months ago
Sloane Hertel 67b78a17c4
Remove Python 3.9 support for the controller (#80973)
* Remove obsolete Python <=3.9 controller code
* Remove Python 3.9 test controller bootstrapping
* Update test requirements

Co-authored-by: Matt Clay <matt@mystile.com>
11 months ago
Matt Martz 6fead15334
Pylint deprecated comment checker (#81071)
Co-authored-by: Matt Clay <matt@mystile.com>
12 months ago
Martin Krizek cde15f3c81
Add test support for Python 3.11 on RHEL 8.8/9.2 (#80990)
Fixes #80412
Fixes #80413
12 months ago
Sloane Hertel ecbbd7e5d1
Remove Python 3.5 support (#80972)
* Remove Python 3.5 support

* changelog

* add requested changes

* Update changelogs/fragments/remove-python3.5.yml

Co-authored-by: Matt Clay <matt@mystile.com>

* remove Python3 < 3.5 error handling

* remove Python3 < 3.5 error handling in TE too

---------

Co-authored-by: Matt Clay <matt@mystile.com>
12 months ago
Sloane Hertel 742d47fa15
replace deprecated ast.value.s with ast.value.value (#80968)
* replace deprecated ast.value.s with ast.value.value

the s attribute is deprecated since Python 3.8 and emits a warning in
3.12 causing some test failures
1 year ago
Matt Clay 3a1d58bc58
ansible-test - Use raise from to handle exceptions (#80905) 1 year ago
Matt Clay 2cd1744be3
Use ansible.module_utils.common.text.converters (#80704)
Replace use of old `ansible.module_utils._text` and add a unit test to maintain backwards compatibility.
1 year ago
Matt Clay abc58c026b
ansible-test - Use FreeBSD packaged setuptools (#80615)
This will avoid issues during bootstrapping caused by breaking changes in setuptools.
1 year ago
Matt Clay 676b731e6f
ansible-test - Replace pytest-forked (#80525)
- Unit tests now report warnings generated during test runs.
- Python 3.12 warnings about `os.fork` usage with threads (due to `pytest-xdist`) are suppressed.
- Added integration tests to verify forked test behavior.
1 year ago
Matt Clay 0371ea08d6
ansible-test - Add support for argcomplete 3 (#80482) 1 year ago
Matt Martz 62211097cb
Expand pylint deprecated plugin to catch ansible.module_utils.common.warnings uses (#80462) 1 year ago
Matt Martz 7251938370
ansible.builtin inferred by collection_name == None (#80446) 1 year ago