summaryrefslogtreecommitdiff
path: root/hacking
Commit message (Collapse)AuthorAgeFilesLines
* Use ansible.module_utils.common.text.converters (#80704)Matt Clay2023-05-037-7/+7
| | | Replace use of old `ansible.module_utils._text` and add a unit test to maintain backwards compatibility.
* Set the minimum setuptools to 45.2.0 (#80649)Matt Clay2023-04-261-1/+13
| | | Also update the package-data sanity test to use the minimum setuptools version.
* Remove obsolete pkg_resources usage (#80489)Matt Clay2023-04-111-11/+0
|
* Fix misrendered sections in manpage generationSviatoslav Sydorenko2023-04-081-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Extend bulk issue creator (#80423)Matt Clay2023-04-051-9/+164
| | | It can now be used to create feature requests, not just deprecation bug reports.
* Remove old release announcement scripts (#80371)Matt Clay2023-04-042-371/+0
| | | These have been replaced by `packaging/release.py`
* Add work-around for old AZP jobs (#80339)Matt Clay2023-03-281-0/+8
|
* Remove straight.plugin dependency (#80084)Matt Clay2023-02-231-3/+30
|
* Clean up unused imports in `hacking` directory (#79894)Matt Clay2023-02-023-8/+1
|
* Flush output in sanity requirements update script. (#79774)Matt Clay2023-01-191-1/+1
| | | This keeps the subprocess output under the correct heading.
* Add support for importlib.resources (#78915)Matt Martz2023-01-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* stable docs build: do not use YAML parsing/serialization for .deps files ↵Felix Fontein2022-10-261-6/+22
| | | | | | | (#79233) * Do not use YAML parsing/serialization for .deps files. * Prevent crash.
* Fix distro fact handling for Flatcar (#77635)Johanan Liebermann2022-09-071-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Add missing space after keywords. (#78480)Matt Clay2022-08-081-1/+1
| | | Also remove unnecessary parenthesis.
* `FieldAttribute`s as descriptors (#73908)Martin Krizek2022-06-291-2/+2
|
* Update README.md (#78139)Diana S. Cardona2022-06-281-2/+1
| | | Update Python version requirement to >= 3.8.
* Allow result sha to be overriden with local sha (#77832)Matt Martz2022-05-181-5/+11
|
* Stop making core docs build talk of (ansible-)'base' when meaning ↵Felix Fontein2022-05-111-16/+16
| | | | (ansible-)'core'. (#77728)
* shift to ansible_core_versionsamccann2022-05-031-2/+2
|
* Fix use of deprecated antsibull-docs option.Matt Clay2022-04-251-2/+2
|
* Replace antsibull with antsibull-docs (#77504)Felix Fontein2022-04-222-3/+3
|
* Make "~/.ansible" path configurable (#76114)htol2022-04-111-8/+8
| | | | | | | | | | * 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>
* Add script to handle more deprecations. (#77400)Matt Clay2022-03-291-0/+285
| | | | | | | | | | * 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.
* Update core porting guide generation.Matt Clay2022-03-281-6/+6
|
* Porting guide fixes. (#77376)Matt Clay2022-03-281-2/+2
| | | | * Update porting guide generation. * Fix 2.13 porting guide link.
* Improve documentation to fix outdated file paths (#77341)Cindy Park2022-03-242-5/+5
| | | Co-authored-by: njthanhtrang <njthanhtrang@users.noreply.github.com>
* Honor `--quiet` parameter properly in fish shell (#77180)Philip Douglass2022-03-051-8/+3
| | | | * The `^` stderr redirection is deprecated * Setting `-q` for `setup.py` in `gen_egg_info` is redundant
* Cleanup of cannned responses (#76689)Brian Coca2022-02-0427-443/+144
| | | | | | | | * 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>
* Fix unsafe handling of variable PYTHON_BIN (#76767)Pascal Höhnel2022-01-181-2/+2
| | | The previous state lead to errors, when cloning the repo to a path with spaces in it.
* ansible-test - Update import test and sanity requirements. (#76308)Matt Clay2021-11-161-0/+112
| | | | | | | | * 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.
* Modernize install (#76021)Matt Martz2021-10-192-0/+13
| | | | | 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>
* Update vendored copy of distro to 1.6.0 (#75732)Matt Martz2021-09-221-1/+1
| | | | | | | * Update vendored copy of distro to 1.6.0 * copy pasta mistake * ci_complete
* Fix markdown links that were errantly formatted as rst (#75697)Matt Martz2021-09-143-3/+3
|
* hacking - account for job names that contain separators (#75454)Sam Doran2021-08-111-0/+4
| | | | | | 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`
* Cleanup hacking scripts to prepare for pylint update. (#75474)Matt Clay2021-08-112-2/+2
| | | | * Use generator in get_recent_coverage_runs.py * Use from import in test-module.py
* Allow docs-build to use a local ansible-build-data checkout.Toshio Kuratomi2021-07-081-0/+6
| | | | | | | This is useful for testing the effects on docs of changing what collections are in a version of ansible. ansible-build-data can be cloned locally, modified, and then build-ansible.py docs-build can be told to use the local checkout instead of the canonical one on github.
* Update hacking `env_setup` to prefer Python 3 (#75213)Sam Doran2021-07-082-5/+5
| | | | | | | | | | * env_setup - Prefer Python3 Prefer the 'python3' executable over 'python'. * Add shebang for syntax detection While the script isn't executable and we recommend sourcing it, having a shebang allows variuos text editors to detect that it is a shell script and apply proper syntax highlighting.
* Use antsibull-docs devel for devel docs (#74988)Felix Fontein2021-06-231-17/+17
| | | | | | | | | * Require antsibull 0.34.0. * Remove Makefile comment about the devel docs building only the core (formerly base) docs; the behavior was updated in ccbfdec334a7b0443f2daecf9f96ac5c5a33fd45 Currently 'make coredocs' builds core-only docs; 'make webdocs' builds the full docs even on the devel branch Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
* Only consider directories which do have .deps files other than ↵Felix Fontein2021-06-151-0/+7
| | | | ancestor.deps. (#74987)
* Due to the takeover of freenode we're moving to a different irc network. ↵Toshio Kuratomi2021-06-013-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#74775) * Due to the takeover of freenode we're moving to a different irc network. * Our channels updated to point at the same channel name on libera.chat * Some links went to webchat.freenode.net. At this time, libera.chat doesn't point you to an official webchat client so I changed these to https://libera.chat. (kiwi irc does work with libera.chat so that could be another option). * In general, I used the name irc.libera.net for link names and https://libera.chat for link targets. This is because the irc service is hosted on irc.libera.chat but the project web server is hosted on libera.chat. (This appears to also be true for freenode but we were using http://irc.freenode.net which doesn't seem to work. Oops). * Removed http://irc.freenode.net from the linkcheck exceptions. linkcheck was actually correct to flag that as invalid (should have been http://frenode.net instead). * Looks like hte important people in #yaml are now in libera.chat * Link to where contributors should get help Add a link target and then link to where contributors should get support for developing groups of modules. * Update docs/docsite/rst/dev_guide/developing_modules_in_groups.rst Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Felix Fontein <felix@fontein.de>
* Vendor `distutils.version` (#74644)Matt Martz2021-05-112-2/+2
| | | | | | | | | | | | | | | * Vendor distutils.version * Fix import order. ci_complete * remove distutils warning filter * Don't remove warnings filter from importer * ci_complete * Add pylint config for preventing distutils.version * Add changelog fragment
* Rename hacking/shippable to hacking/azp.Matt Clay2021-05-056-203/+12
| | | | | | References to Shippable were changed to Azure Pipelines. Also remove rebalance.py as it does not work with Azure Pipelines due to the required data not being present.
* Retrofit shippable scripts to work with AZPAlexander Sowitzki2021-04-285-415/+205
| | | | Co-authored-by: Matt Clay <matt@mystile.com>
* Update default containers to 3.4.0. (#74415)Matt Clay2021-04-251-1/+1
| | | | | | | | | | | * Update default containers to 3.4.0. The 3.4.0 containers use Python 3.6 (the system Python) for `/usr/bin/python3`. Python 3.9 continues to be the default Python version selected by `ansible-test` for these containers. * Fix shebang on build-ansible.py. Using `python` instead of `python3` allows `ansible-test` python interception and requirements install to function.
* Fix typo in incidental.py (#73737)Ikko Ashimine2021-03-011-1/+1
| | | successfull -> successful
* Split Ansible docs from core docs (#73616)Sandra McCann2021-02-171-27/+85
| | | | | | | | | | | | | | | | | | | * excludes scenario guides from core docs, splits porting guides and roadmaps, symlinks indices to create index.html pages, and adds .gitignore entries for conf.py and the toplevel index.rst files generated by the docs build This solution builds three types of docs: * ansible-2.10 and earlier: all the docs. Handle this via `make webdocs ANSIBLE_VERSION=2.10` * ansible-3 and later: a subset of the docs for the ansible package. Handle this via `make webdocs ANSIBLE_VERSION=3` (change the ANSIBLE_VERSION to match the version being built for. * ansible-core: a subset of the docs for the ansible-core package. Handle this via `make coredocs`. * `make webdocs` now always builds all the collection docs * Use `make coredocs` to limit it to core plugins only * The user specifies the desired version. If no ANSIBLE_VERSION is specified, build plugins for the latest release of ansible Co-authored-by: Toshio Kuratomi <a.badger@gmail.com> Co-authored-by: Matt Clay <matt@mystile.com>
* Allow restricting config values to enumerated list (#73162)Brian Coca2021-01-141-1/+7
| | | | | | | * Allow restricting config values to enumerated list * dont document internal entries * also ignore private defs for ansible-config * remove invalid value from tests * added porting entry
* [facts] Differentiate CentOS vs CentOS Stream (#73034)Rick Elrod2021-01-131-0/+1
| | | | | | | | | | | | | | | | | | | Change: - On CentOS Stream, make distribution_release be "Stream" - On CentOS Core, it continues to be "Core" - Implement custom distribution file parser for CentOS, so we can look for "CentOS Linux" and "CentOS Stream" - Two new fixtures introduced (CentOS Linux 8.1 and CentOS Stream 8) - Removed two dicts from `Distribution` class that were seemingly not used anywhere. Test Plan: - ci_complete - New test fixtures Tickets: - Fixes #73027 Signed-off-by: Rick Elrod <rick@elrod.me>
* hacking: replace use of "which" with "command -v" (#71278)Vincent Bernat2020-08-181-1/+2
| | | | | | | | | | | | "command -v" is the POSIX compliant way to get the path to a command. It returns the path to the command if it exists and exits with a non-zero status when it does not, without any output. "which" is not POSIX and it can have various different effects. With Zsh, it says "python not found" on stdout. See: - https://pubs.opengroup.org/onlinepubs/009695399/utilities/command.html Signed-off-by: Vincent Bernat <vincent@bernat.ch>
* Updates to docs build for new antsibull CLIToshio Kuratomi2020-08-141-4/+4
| | | | | * --ansible-base-cache renamed to --ansible-base-source * _acd_version in the .deps file has been renamed to _ansible_version