Commit Graph

54 Commits (e2ae13cf3889099932025347abc2f1b5ef86987d)

Author SHA1 Message Date
Matt Clay 8ac5c8580b
Remove urllib2 pylint check (#86139)
No supported Python version provides urllib2.
4 weeks ago
Matt Clay 5b8ae0b5b5
Fix deprecation comments (#86138) 4 weeks ago
sivel / Matt Martz e4b4787c02
Soft deprecate ansible.module_utils.six (#86048) 1 month ago
Matt Clay 9ee667030f
ansible-test - Update sanity test requirements (#85980) 2 months ago
Martin Krizek 686c3658ae
Deprecate `ansible.module_utils.six` (#85934)
* Deprecate `ansible.module_utils.six`

Fixes #85920
2 months ago
Martin Krizek b3ef4f7671
sanity: warn on ansible.module_utils.six imports (#85651)
Co-authored-by: Matt Clay <matt@mystile.com>
3 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 3511299e1e
Fix deprecated pylint plugin version parsing (#85402) 5 months ago
Matt Clay e2a5377b9a
ansible-test - Fix incorrect use of InferenceContext (#85230) 6 months ago
Matt Clay e82be177cd
ansible-test - Improve deprecated checking type inference (#85159)
* ansible-test - Improve deprecated checking type inference

Also disabled the ``bad-super-call`` pylint rule due to false positives.

* Add type comment support

* Try without using register_transform
7 months ago
Matt Clay 7b69cf3266
ansible-test - Relax some deprecation checks (#85122) 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 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 9d249432c4
Increase scope of mypy sanity test (#84288)
* Increase scope of mypy sanity test

* Fix issues reported by mypy
1 year ago
Matt Clay 56bab1d097
Enable bad-docstring-quotes pylint rule for core (#84100)
* Enable bad-docstring-quotes pylint rule for core

* Ignore previously bulk update in git blame
1 year ago
Matt Clay 62ce21b6e4
ansible-test - Work around pylint issue on 3.11 (#84094) 1 year ago
Matt Clay 83671ecb39
ansible-test - Enable pylint docstyle for tests (#84092)
This cleans up the implementation of the pylint sanity test and enables the docstyle extension rule `bad-docstring-quotes` for tests.

The rule will be enabled for the rest of ansible-core once automated cleanup has been performed on existing docstrings.
1 year ago
Matt Clay 3cf308f672
ansible-test - Disable pylint deprecated-* rules (#84050) 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 7693c892fa
ansible-test - Use Python version in pylint contexts (#83984) 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 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.
2 years 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
2 years 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
2 years ago
Matt Clay f31c287348
ansible-test - Improve compatibility with pylint 3 (#81841) 2 years 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.
2 years ago
Matt Martz 6fead15334
Pylint deprecated comment checker (#81071)
Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 3a1d58bc58
ansible-test - Use raise from to handle exceptions (#80905) 3 years 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.
3 years ago
Matt Martz 62211097cb
Expand pylint deprecated plugin to catch ansible.module_utils.common.warnings uses (#80462) 3 years ago
Matt Martz 7251938370
ansible.builtin inferred by collection_name == None (#80446) 3 years ago
Mark Chappell f64e79be41
sanity tests - ignore pre-release versions for deprecation comparisons (#79185) 3 years ago
Matt Clay d67b436eba
ansible-test - Improve pylint backwards compat (#79997) 3 years ago
Matt Clay 43487c6581
ansible-test - Enable unused-import pylint rule (#79912)
This was previously enabled for core. This change enables it for collections.
3 years ago
Matt Clay 10bc8af5a2
ansible-test - Remove auto format pylint rule (#79985) 3 years ago
Matt Clay 497d296ed6
Enable pylint rules to detect pointless statements (#79944)
Also instruct `git blame` to ignore the commit used to convert pointless strings to comments.
3 years ago
Matt Clay 379058e10f
Update collections.abc imports (#79911)
* Update `collections.abc` imports

- Use `six.moves` for modules and module_utils
- Use `collections.abc` for controller code

This avoids using `ansible.module_utils.common._collections_compat`,
which was added before the vendored `six` was updated to provide these
imports.

* Update _collections_compat to use six.moves

Also update the custom pylint rule to reflect this change.
3 years ago
Matt Clay e658995760
ansible-test - Enable pylint unused-import for core (#79910) 3 years ago
Matt Clay 4706af58ab
ansible-test - Enable trailing-comma-tuple pylint rule (#79909) 3 years ago
Matt Clay 0a53309f47
ansible-test - Update pylint to 2.16.0 (#79878) 3 years ago
Matt Clay cda16cc5e9
ansible-test - Improve container management. (#78550)
See changelogs/fragments/ansible-test-container-management.yml for details.
3 years ago
Matt Clay c56b35598f
ansible-test - Upgrade pylint. (#78727)
This version of pylint now supports Python 3.11.
3 years ago
Matt Clay ece85abbc4
ansible-test - Verify executables are executable. (#78606) 3 years ago
Matt Clay 69ceb31600
ansible-test - Update sanity test requirements. (#78528) 3 years ago
Matt Clay 89862fda3b
ansible-test - Sanity test code cleanup. (#78497) 3 years ago
Matt Clay 86779cc903 ansible-test - Code cleanup.
This helps prepare for a future pylint upgrade.
4 years ago
Matt Martz bdf37336c8
Update pylint deprecated plugin to use ansible-invalid* symbols (#77086) 4 years ago
Matt Clay 5a6e05affb More strict pylint checking of ansible-test code. 4 years ago
Matt Clay d19b506ce8
ansible-test - Clean up future boilerplate. (#76874)
* ansible-test - Clarify need for empty __init__.py
* ansible-test - Update code-smell boilerplate.
* Update code-smell boilerplate for core.
* Update future boilerplate test for ansible-test.

All ansible-test code (except for targets) and core-specific sanity tests now use the same boilerplate.

The test also checks for unwanted `__future__` and `metaclass` boilerplate.

* Relocate target tools to the correct directory.

Several tools used on target Python versions were incorrectly placed in the controller directory.
4 years ago
Matt Clay 1932f0008b
ansible-core - Remove support for Python 2.6. (#75853) 4 years ago