Commit Graph

333 Commits (devel)

Author SHA1 Message Date
sivel / Matt Martz 707a5ec617
Add CLAUDE.md/AGENTS.md files for tighter assistance with GenAIs (#85841)
* Add an override of the `/review` slash command in claude code
* Add support for `CLAUDE.local.md` and `~/.claude/ansible.md`

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
4 weeks ago
Matt Clay 8ac5c8580b
Remove urllib2 pylint check (#86139)
No supported Python version provides urllib2.
4 weeks ago
Matt Clay 12acd5c18f
ansible-test - Update sanity requirements (#86083) 1 month ago
Matt Clay 9ee667030f
ansible-test - Update sanity test requirements (#85980) 2 months ago
Sviatoslav Sydorenko 53afc6f203 Mention pkg name in `package-data` sanity output
The logs were displaying a series of numbers in parens like `(66.1.0)`
at the end of each error line. its unintuitive what that means. I had
to look into the source code to confirm my suspicion of it being the
version of `setuptools`. This patch spells it out.
2 months ago
Sviatoslav Sydorenko 0cd36ce6d0 Use strict_optional @ ansible.galaxy.dependency_resolution
This patch drops unnecessary default for
`CollectionDependencyProvider`'s `concrete_artifacts_manager` argument
as it is always passed, in every place across the code base where the
provider is constructed.

It was also causing MyPy violations on calls to
`_ComputedReqKindsMixin.from_requirement_dict()` in the "strict
optional" mode which is now enforced for $sbj, while remaining
disabled globally.

It is a #85545 follow-up.
2 months ago
Sviatoslav Sydorenko c9131aa847 Type-annotate ansible.galaxy.dependency_resolution
This patch is a combination of `pyrefly autotype` and manual
post-processing. Parts of it migrate pre-existing comment-based
annotations, fixing incorrect ones where applicable.

The change also configures MyPy to run checks against actual
`resolvelib` annotations and includes a small tweak of
`ansible.galaxy.collection._resolve_depenency_map` to make it
compatible with those.

Co-Authored-By: Jordan Borean <jborean93@gmail.com>
Co-Authored-By: Matt Clay <matt@mystile.com>
Co-Authored-By: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 months ago
Matt Clay ddbedc6ac6
Update mypy sanity test requirements (#85832) 3 months ago
Matt Clay e8a3be9de5
ansible-test - Update sanity test and coverage requirements (#85761)
* ansible-test - Update sanity test requirements

* ansible-test - Update coverage to 7.10.5
3 months ago
Matt Clay 5fbce46dcf
ansible-test - Update pinned sanity test requirements (#85577) 4 months ago
Matt Clay 6b2b665ef7
Add support for Python 3.14 and drop Python 3.8 (#85576) 4 months ago
Jordan Borean 3882366585
Add AnsiballZ debugging support with debugpy (#85476)
* Add AnsiballZ debugging support with debugpy

Adds support for debugging AnsiballZ modules with debugpy which is used
by VSCode as its Python debugger DAP. Debugging can either be done
through a manual Debugpy listening server through a launch.json
configuration or through the new ansible-test --dev-debug-on-deman
argument.

* Fix up integration test

* Simplify config option and move mypy ignore

* Use new API if available and fix typo

* Guard the import of debugpy

* Fix sanity import issue

* Minor cosmetic adjustments

* Simplify debugger setup

* ansible-test - Refactor debugging interface

* Add ansible-test debug integration tests

* Fix ansible-test shell when in unsupported dir

---------

Co-authored-by: Matt Clay <matt@mystile.com>
5 months ago
Matt Clay ac8c66d431
Bump devel version to 2.20.0.dev0 (#85409) 5 months ago
Martin Krizek 600c1e67b4
Exceptions clean up (#85176)
* replace usage of `IOError` as it is an alias to `OSError`
* replace usage of `socket.error` as it is an alias to `OSError`
* use subclasses of `OSError` rather than inspecting `errno`s
* utilize `exist_ok` parameter of `os.makedirs` rather than ignoring
  `FileExistsError`

Make the following changes to the exception handling this patch already
updates to be consistent with the new code:
* use `ex` as a name for exception being handled
* use `from ex` when re-raising exception for additional context
* use f-strings and `!r` for quoting
* pass exceptions to the `exception` parameter of `fail_json`
* use `display.error_as_warning` rather than passing stringified
  exception into `display.warning`

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
Matt Davis 9f0a8075e3
Prevent template lookup and action from masking `ansible_managed` value (#85075)
* deprecate DEFAULT_MANAGED_STR and prevent masking of ansible_managed var

* adjust public API behavior

* restore backward-compatible behavior on existing public API
6 months ago
Matt Clay 97dd5f104c
Expand scope of `black` sanity test (#85169) 7 months ago
Matt Clay 460343510c
Code formatting for test/sanity/code-smell/ (#85165) 7 months ago
Matt Clay 588410fe50
ansible-test - Update sanity requirements (#85160) 7 months ago
Matt Davis 7e00053a30
add fuzzy matching to package_data sanity (#85103)
* add fuzzy matching to package_data sanity

* relaxes exact directory matches for license files to allow setuptools > 72 to pass

* sanity
7 months ago
Matt Davis ff6998f2b9
Switch to stackwalk caller ID (#85095)
* See changelog fragment for most changes.
* Defer early config warnings until display is functioning, eliminating related fallback display logic.
* Added more type annotations and docstrings.
* ansible-test - pylint sanity for deprecations improved.
* Refactored inline legacy resolutions in PluginLoader.

Co-authored-by: Matt Clay <matt@mystile.com>
7 months ago
Matt Davis 35750ed321
Templating overhaul, implement Data Tagging (#84621)
Co-authored-by: Matt Davis <mrd@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
8 months ago
Matt Clay 091994a477
ansible-test - Update sanity test requirements (#84866) 9 months ago
Matt Clay 5ff8d093f0
ansible-test - Code style cleanup (#84749)
* ansible-test - Minor style cleanup (add blank lines)

* ansible-test - Use `"""` instead of `'''`
9 months ago
Matt Clay bddb9a7490
ansible-test - Support target testing with black (#84744) 9 months ago
Matt Clay 989e583356
ansible-test - Initial support for black in core (#84741) 9 months ago
Matt Clay cd881bf71e
ansible-test - Add pytest-mock to mypy sanity test (#84669) 10 months ago
Matt Clay 7594243fc0
ansible-test - Update sanity test requirements (#84667) 10 months ago
Abhijeet Kasurde f72aa1dc0c
test: Update regex for required and default in FieldAttributes (#84209)
Fixes: #61460

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Matt Clay 9d249432c4
Increase scope of mypy sanity test (#84288)
* Increase scope of mypy sanity test

* Fix issues reported by mypy
1 year ago
Matt Clay 955e310b4c
Cover unit tests with mypy (#84084)
* Added support for testing unit tests with mypy.
* Added support for ignoring individual mypy error codes.
* Added missing assert on unit tests and marked xfail.
* Added type hints for some unit tests.
* Added ignores for unit tests not passing mypy.
* Fixed incorrect autouse argument in unit test fixtures.
* Fixed minor issues causing problems with mypy in unit tests.
1 year ago
Matt Clay 50604e8461
ansible-test - Update astroid for pylint sanity test (#84054) 1 year ago
Matt Clay 9406ed3109
ansible-test - Update sanity tests and default Python (#83998)
* ansible-test - Update sanity test requirements
* ansible-test - Default to Python 3.13 in base/default containers
* ansible-test - Fix incorrect AnyStr type hints
1 year ago
Matt Clay cf2a4a85da
ansible-test - Update sanity test requirements (#83921) 1 year ago
Matt Clay cd342f76b4
release.py - Use changelog requirements (#83920)
Use the changelog sanity test requirements instead of the package-data sanity test requirements.

This enables removal of most package-data sanity test requirements, as they are no longer used by the test itself.
The additional requirements were being maintained only to provide pinned requirements for building the changelog during a release.
1 year ago
Matt Clay 49490d92c3
Update boilerplate sanity test (#83879)
The `annotations` future can now be imported as `_annotations`.
1 year ago
Matt Clay da02611c48
ansible-test - Update sanity test requirements (#83795)
* Remove PyYAML pin for yamllint sanity test
* Freeze sanity test requirements
1 year ago
Matt Clay 68515abf97
Drop use of setup.py and setup.cfg (#81443) 1 year ago
Matt Clay 70be017f02
ansible-test - Update mypy and package-data tests (#83734)
* package-data - Test min/max setuptools version

* Fix multi-version abstraction

* Convert mypy test to script based test

* Fix f-string in pymarkdown test

* Sanity test fixes
1 year ago
Matt Clay 717f1092e3
ansible-test - Update venv management and sanity requirements (#83729)
* ansible-test - Update venv management
* Upgrade from pip 24.0 to 24.2
* Omit `wheel` and `setuptools` from ansible-test managed virtual environments
* Drop pre-release hacks
* Update mypy requirements
* Freeze sanity test requirements
* Update sanity test configuration
* Update sanity ignores
1 year ago
Matt Clay 4e69d83fac
release.py - Auto-update setuptools upper bound (#83713)
When releases are prepared, the upper bound on setuptools in pyproject.toml will be automatically updated
to the latest version available on PyPI. This version will then be tested by the package-data sanity test
during the release process and will be used to build the release.

This change ensures that a released version of ansible-core can be built in the future if a new setuptools
release includes breaking changes that would prevent building a functional package. If a downstream package
maintainer requires a newer setuptools version than the upper bound permits, they can patch pyproject.toml
as needed. Since ansible-core releases support specific Python versions, lack of support for new setuptools
releases will have no effect on support for future Python versions.
1 year ago
Matt Clay cf265eb14d
Add Python 3.13 support (#83416)
* Add Python 3.13 support

* Add temporary work-around for yamllint test
2 years ago
Matt Martz 76fe4e8a71
Bump devel to 2.18.0.dev0 (#82934)
* Bump devel to 2.18.0.dev0

* Add ignores for 2.18 deprecations
2 years ago
Abhijeet Kasurde b8b12c4be3
Update sanity requirements (#82296)
* Update sanity requirements
* Drop Python 3.7 for mypy

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Abhijeet Kasurde aecffcb896 pylint: update for use-yield-from
* With Pylint 3.1.0, use-yield-from check is enabled

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Clay 71d81e4a60
Add no-unwanted-characters sanity test for core (#82557) 2 years ago
Matt Clay ac3ae94ae1
Ignore coverage on code intended never to execute (#82128)
* Ignore coverage on code intended never to execute

* Fail collection loader test if wrong code runs

* Update boilerplate test to accommodate nocover
2 years ago
Sviatoslav Sydorenko d2ba76c117
Remove Python `< 3.5` `selectors` fallbacks (#81872) 2 years ago
Matt Clay 16b23d6779
Rename boilerplate sanity test (#81903)
The test covers more than just future boilerplate, so the shorter name is more appropriate.
2 years ago
Matt Clay 9f899f9492
Require `from __future__ import annotations` (#81902) 2 years ago
Matt Clay 921efce43a
ansible-test - Remove more Python 2.7 / 3.6 support (#81898) 2 years ago