Commit Graph

609 Commits

Author SHA1 Message Date
Martin Krizek f024cf35d7
Remove the yum module, redirect it to dnf (#81895)
Fixes #81728
2024-01-23 10:23:43 -06:00
Matt Clay 40e4c69724
Cleanup the hacking directory a bit (#81960)
* Clean up hacking/ansible-profile script

Also rename the script so it has a `.py` extension.

* Remove test-module symlink

Use the test-module.py script instead.
2023-10-11 17:44:42 -07:00
Matt Clay 9f899f9492
Require `from __future__ import annotations` (#81902) 2023-10-04 22:11:17 +00:00
Sam Doran 243197f2d4
env-setup.fish: Correct syntax errors (#81677)
- Single quote regular expression values to avoid shell expansion
- Properly test if the $QUIET variable is set and non-zero
2023-09-12 11:31:19 -04:00
Matt Clay dbb3feddaf
Update update-sanity-requirements.py script (#81424)
Frozen requirements can now preserve any explicitly installed package that would normally be omitted, not just setuptools.
2023-08-03 10:58:19 -07:00
Matt Clay e964078a83
ansible-test - Pre-build PyYAML wheels (#81300)
This works around Cython failures when attempting to install PyYAML >= 5.4 <= 6.0.
2023-07-18 18:17:48 -07:00
Anoint 2915424541
Update env-setup.fish (#81208)
## Description

This commit includes improvements and optimizations to the script:

- Clarified the purpose of the quiet flag with a comment.
- Adjusted conditions for appending to PYTHONPATH and MANPATH variables.
- Enhanced Python executable check for reliability and cross-platform support.
- Improved comments and function clarity.
- Ensured consistency with the original code.

These changes enhance readability, efficiency, and maintainability of the script.
2023-07-11 16:16:14 -07:00
Matt Clay 876be11f8c
Add pymarkdown sanity test for core (#81220)
* Clean up markdown

* Add pymarkdown sanity test for core

* Update unit test SHA
2023-07-11 14:40:47 -07:00
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
2023-07-11 12:40:06 -07:00
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>
2023-07-10 12:01:47 -04:00
Matt Clay e535eb625b
Remove long obsolete hacking/get_library.py (#81122) 2023-06-23 18:42:48 -07:00
Matt Clay 5b586096b3
Remove hacking/fix_test_syntax.py (#81121)
This script is no longer needed, since using tests as filters was removed in 2.9.
2023-06-23 18:31:42 -07:00
Matt Clay 7e2b25beac
Revert "Add a custom policy for hackers using ansible-test (#68535)" (#81120)
This reverts commit bd9e31fcb0.
2023-06-23 17:36:36 -07:00
Matt Clay b3f1290bcd
Remove docs dir dependency from man page build (#81003) 2023-06-08 12:41:45 -07:00
Matt Martz c1f2a9ea6c
No core irc meeting (#80811) 2023-05-16 11:03:42 -05:00
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.
2023-05-03 08:58:00 -07:00
Matt Clay 4d25e3d54f
Set the minimum setuptools to 45.2.0 (#80649)
Also update the package-data sanity test to use the minimum setuptools version.
2023-04-26 16:01:56 -05:00
Matt Clay 9026bc5d76
Remove obsolete pkg_resources usage (#80489) 2023-04-11 19:33:57 -07:00
Sviatoslav Sydorenko a84b3a4e72
Fix misrendered sections in manpage generation
This change fixes bugs in the manpage generator that existed since it
was first added.

It exposes CLI `ARGUMENTS` value to manpage templates.

Before this change, the code contained a typo, causing the `for`-loop
iterate over individual characters of the `'ARGUMENTS'` string rather
than iterating over a tuple. A missing comma was at fault.

The updated code gets rid of the `for`-loop and conditionals since it
seems to have been a premature complexity increase and no other things
than `'ARGUMENTS'` were ever added into the broken iterable.

The functional change is that `arguments` is now always present in the
Jinja2 context, unlike being missing sometimes because of the previous
design (not that it was ever present, because of the bug! sigh...)

The Jinja2 templates perform an `{% if arguments %}` check, letting
the template engine silently ignore the missing variable. The clause
was always falsy, meaning that the arguments section was not included
in the manpages for at least the last 6 years. With this fix, it will
be.

This patch also deduplicates calling `opt_doc_list` @ generate_man.

It was called late in the execution, more times than necessary. This
patch makes sure it happens once by putting it at the top of the scope.

It fixes rendering library and inventory in manpages.

The corresponding Jinja2 templates have blocks wrapped with
conditionals like `{% if inventory %}` and `{% if library %}` but said
variables were never injected into the context, nor were they even
deduced on the Python side of the generator. This means that the
conditional clauses were always falsy, never showing the portions of
the manpages.

The Python script has hints for how the `inventory` variable was to be
calculated, which is confirmed through the Git paleontology efforts.

The block of code that references to the `inventory` bit was
incorrectly checking a variable with a list of nested objects for the
presence of a string which was never going to work.

This patch fixes this check by verifying the CLI flag against the
correct variable containing a list of options and exposes it to the
Jinja2 templates.
It also exposes the `library` variable in a similar way.

The block displaying other binaries in Sphinx CLI docs has been
synchronized with the manpage template.
Previously, the current binary was displayed also. This patch gets rid
of the unwanted trailing comma there too.

Finally, the CLI executables list in the manpage template now reuses
the same variable as the RST template that doesn't need any
post-processing in Jinja2.
Before, it was already used in the RST template so this patch aligns
both templates to use the same logic as they got out-of-sync over time.

PR #80450.
2023-04-08 14:04:59 +02:00
Matt Clay 163f297d7f
Extend bulk issue creator (#80423)
It can now be used to create feature requests, not just deprecation bug reports.
2023-04-05 15:24:21 -07:00
Matt Clay 4f7f7d1c26
Remove old release announcement scripts (#80371)
These have been replaced by `packaging/release.py`
2023-04-04 11:08:44 -07:00
Matt Clay 2e413b74e4
Add work-around for old AZP jobs (#80339) 2023-03-28 11:50:47 -07:00
Matt Clay f587856beb
Remove straight.plugin dependency (#80084) 2023-02-23 15:37:12 -08:00
Matt Clay e69ef1b249
Clean up unused imports in `hacking` directory (#79894) 2023-02-02 16:00:50 -08:00
Matt Clay 868d721d8c
Flush output in sanity requirements update script. (#79774)
This keeps the subprocess output under the correct heading.
2023-01-19 21:49:04 -08:00
Matt Martz 56d142350d
Add support for importlib.resources (#78915)
* Add support for importlib.resources

* Remove the importlib.resources imports

* return the correct data

* Some code comments, and re-order for consistency

* Disallow traversing packages below an individual collection

* Add a traversable class for namespaces

* Re-use variable

* Utilize itertools.chain.from_iterable

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>

* Simplify logic to check for packages from ansible loaders

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>

* Just a generator expression, instead of a generator

* docstrings

* Add comment about find_spec for our namespaces

* Add some initial unit tests for importlib.resources

* normalize

* Utilize importlib.resources for listing collections

* collections_path is already in config, just use config

* install uses a different default for collections_path

* Remove unused import

* Remove duplicate __truediv__

* Bring back TraversableResources

* Apply some small suggestions from code review

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>

* Remove cross contamination between plugin loader code and CLI code

* Remove unused import

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
2023-01-10 11:09:57 -06:00
Felix Fontein 9545f2e0de
stable docs build: do not use YAML parsing/serialization for .deps files (#79233)
* Do not use YAML parsing/serialization for .deps files.

* Prevent crash.
2022-10-26 14:54:00 -07:00
Johanan Liebermann fbd828673d
Fix distro fact handling for Flatcar (#77635)
* Fix distro fact handling for Flatcar

The existence of the file /etc/flatcar/update.conf depends on
bootstrap configuration typically provided by the user. For that
reason this file is unsuitable for determining distro facts for
Flatcar Container Linux.

The distribution_release fact is meaningless in the case of Flatcar
since Flatcar doesn't have named releases. The distribution_version
fact, however, IS meaningful and should contain a number such as
"3139.2.0".

- Use /etc/os-release instead of /etc/flatcar/update.conf.
- Drop the distribution_release fact.
- Set the distribution_version fact.
- Update distro test fixture for Flatcar
- Generate the fixture using gen_distribution_version_testcase.py.
- Override result.distribution and result.os_family manually as the
  generator script gives wrong values.
- Use a recent Flatcar version.

Signed-off-by: Johanan Liebermann <jliebermann@microsoft.com>
2022-09-07 13:14:12 -04:00
Matt Clay 650befed37
Add missing space after keywords. (#78480)
Also remove unnecessary parenthesis.
2022-08-08 13:18:28 -07:00
Martin Krizek 43153c5831
`FieldAttribute`s as descriptors (#73908) 2022-06-29 14:39:23 +02:00
Diana S. Cardona 58b42abede
Update README.md (#78139)
Update Python version requirement to >= 3.8.
2022-06-28 11:03:29 -04:00
Matt Martz a415697d70
Allow result sha to be overriden with local sha (#77832) 2022-05-18 13:19:11 -05:00
Felix Fontein 836683a082
Stop making core docs build talk of (ansible-)'base' when meaning (ansible-)'core'. (#77728) 2022-05-11 14:04:43 -04:00
samccann 7471c036ec shift to ansible_core_version 2022-05-03 10:53:18 -07:00
Matt Clay b8793fa48d Fix use of deprecated antsibull-docs option. 2022-04-25 12:21:09 -07:00
Felix Fontein 841bdb74eb
Replace antsibull with antsibull-docs (#77504) 2022-04-22 09:33:32 -04:00
htol d7fbde4ea9
Make "~/.ansible" path configurable (#76114)
* replace hardcoded '~/.ansible' to C.ANSIBLE_HOME
* rename previously existing env ANSIBLE_HOME in env-setup script
* modify cache dir monkeypatching in galaxy api unit tests
* update "version_added" to 2.14 for ANSIBLE_HOME
* fix description of collections with proper use of ANSIBLE_HOME

Co-authored-by: htol <github@h-tol.net>
Co-authored-by: stefanwascoding <stefan@syntaxhelden.de>
2022-04-11 14:17:00 -04:00
Matt Clay 353511a900
Add script to handle more deprecations. (#77400)
* Add script to handle more deprecations.

This script currently supports deprecations from the following sanity tests:

* deprecated-config
* update-bundled

* Ignore script in package-data test.
2022-03-29 15:24:30 -07:00
Matt Clay 93d0ea0215 Update core porting guide generation. 2022-03-28 13:16:28 -07:00
Matt Clay 3e491db466
Porting guide fixes. (#77376)
* Update porting guide generation.
* Fix 2.13 porting guide link.
2022-03-28 11:57:10 -07:00
Cindy Park 1bdcb56249
Improve documentation to fix outdated file paths (#77341)
Co-authored-by: njthanhtrang <njthanhtrang@users.noreply.github.com>
2022-03-24 14:18:33 -04:00
Philip Douglass e6f63be7a4
Honor `--quiet` parameter properly in fish shell (#77180)
* The `^` stderr redirection is deprecated
* Setting `-q` for `setup.py` in `gen_egg_info` is redundant
2022-03-05 07:04:54 +10:00
Brian Coca 9a4ff01a4f
Cleanup of cannned responses (#76689)
* removed those made obsolete by bot
 * tried to rephrase to be more informative and require less updates in the future

Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: John R Barker <john@johnrbarker.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
2022-02-04 10:37:53 -05:00
Pascal Höhnel 7cd94dd452
Fix unsafe handling of variable PYTHON_BIN (#76767)
The previous state lead to errors, when cloning the repo to a path with spaces in it.
2022-01-18 16:13:33 +01:00
Matt Clay bb63c97c16
ansible-test - Update import test and sanity requirements. (#76308)
* Add script to freeze sanity requirements.
* Declare sanity test requirements and freeze
* Use pinned requirements for import.plugin test.
* Expand scope of import test for ansible-core.
* Add ignores for galaxy import errors.
* Update test-constraints sanity test.
2021-11-16 18:16:42 -08:00
Matt Martz 66a83314b9
Modernize install (#76021)
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Davis <mrd@redhat.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2021-10-19 14:24:57 -05:00
Matt Martz 96b221b344
Update vendored copy of distro to 1.6.0 (#75732)
* Update vendored copy of distro to 1.6.0

* copy pasta mistake

* ci_complete
2021-09-22 11:43:25 -05:00
Matt Martz 208014422d
Fix markdown links that were errantly formatted as rst (#75697) 2021-09-14 10:15:37 -05:00
Sam Doran 5af0420cab
hacking - account for job names that contain separators (#75454)
Some job names contain '/' which causes the download job to fail.

Example job name: `Post-job: Checkout ansible/ansible@refs/pull/75445/merge to ansible.log`
2021-08-11 20:33:23 -07:00
Matt Clay a5b0626176
Cleanup hacking scripts to prepare for pylint update. (#75474)
* Use generator in get_recent_coverage_runs.py
* Use from import in test-module.py
2021-08-11 13:18:40 -07:00