mirror of
https://github.com/ansible/ansible.git
synced 2025-11-30 23:16:08 +07:00
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>
This commit is contained in:
@@ -7,6 +7,9 @@ jinja2 >= 3.0.0
|
||||
PyYAML >= 5.1 # PyYAML 5.1 is required for Python 3.8+ support
|
||||
cryptography
|
||||
packaging
|
||||
# importlib.resources in stdlib for py3.9 is lacking native hooks for
|
||||
# importlib.resources.files
|
||||
importlib_resources >= 5.0, < 5.1; python_version < '3.10'
|
||||
# NOTE: resolvelib 0.x version bumps should be considered major/breaking
|
||||
# NOTE: and we should update the upper cap with care, at least until 1.0
|
||||
# NOTE: Ref: https://github.com/sarugaku/resolvelib/issues/69
|
||||
|
||||
Reference in New Issue
Block a user