A Debian Buster-based zuul-jobs test started failing when using stestr
recently [1]. Upon further investigation, this is a Python 3.7
environment which is affected by a recent breaking change to
importlib_metadata.
It seems stevedore worked around this with
Ib9c2b0a14edea91e97d122d2ac93b650029f918e, which was released with
3.5.1 -- but I was still seeing the issue.
Upon further investigation, the "real_groups" dict being returned here
with importlib-metadata 4.12.0 is in buckets by group, e.g.
{'group.one': [EntryPoint(name='foo', ... , group='group.one'),
EntryPoint(name='bar', ... , group='group.one')],
'group.two': [EntryPoint(name='moo', ... , group='group.two'),
EntryPoint(name='goo', ... , group='group.two')],
}
This current code seems to return a dict with entry-points by thier
name, e.g.
{'foo': EntryPoint(name='foo', ... , group='group.one),
'bar': EntryPoint(name='bar', ... , group='group.one),
'moo': EntryPoint(name='moo', ... , group='group.two),
'goo': EntryPoint(name='goo', ... , group='group.two)
}
This reorgansies the fixup routine to put entry-points in a bucket by
their group. With this change, stestr is again finding it's command
plugins.
[1] https://github.com/mtreinish/stestr/issues/336
[2] https://github.com/python/importlib_metadata/issues/409
Change-Id: I3496ab1dfa312b1098a869cdfd9a0c6f81653b28
The behavior of the 'EntryPoint.extras` attribute that this exposes has
changed in recent versions of 'importlib_metadata'/'importlib.metadata'.
In change Iff536d4f4267efbebc4be1e7e5da8a9fde39f79b we applied a
temporary fix to preserve the legacy behavior on these newer versions,
however, given that this is actually a deprecated attribute [1], the
best long-term option seems to be not exposing things. Do just that.
[1] https://packaging.python.org/en/latest/specifications/entry-points/#data-model
Change-Id: Id772d9f002e6945666685138bdef8f8ca32b5229
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
importlib-metadata 5.0 has removed support for dict-style interaction
with entrypoints [1]. This is going to eventually affect us when Python
3.12 is released but even before then anyone not properly using upper
constraints with an older Python 3.7-based release (the only Python
version where we require the third-party importlib-metadata package
rather than the stdlib importlib.metadata package) will be bitten. Fix
it now to address both.
[1] dde2b9de29
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ib9c2b0a14edea91e97d122d2ac93b650029f918e
Closes-Bug: #1991559
A fix to 'importlib.metadata' in Python 3.10 [1], later backported to
3.9 and released in 3.9.11 [2], has broken our tests. Fix them.
[1] b1e2868607
[2] 177be52517
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #1966040
Change-Id: Iff536d4f4267efbebc4be1e7e5da8a9fde39f79b
Add file to the reno documentation build to show release notes for
stable/zed.
Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/zed.
Sem-Ver: feature
Change-Id: I258603f7e7304c3e852d6d47bae5e024e33a90f7
... because this library no longer supports these old versions and
requires Python >= 3.8 now[1].
[1] 8efaa1ceb82300cce19acaf3d5ecd969f6dab3e0
Change-Id: I2b229b24425d3afb9159b2479bd9547e3443011f
In Zed cycle testing runtime, we are targetting to drop the
python 3.6/3.7 support, project started adding python 3.8 as minimum,
example nova:
- 56b5aed08c/setup.cfg (L13)
Also indicates that we support python 3.9.
Change-Id: I1bdec397b1ac563b09174763c20e8a91e5f86143
Add file to the reno documentation build to show release notes for
stable/yoga.
Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/yoga.
Sem-Ver: feature
Change-Id: I732f42ae437931a824aba788bf434f85100f06fa
Add file to the reno documentation build to show release notes for
stable/xena.
Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/xena.
Sem-Ver: feature
Change-Id: I6195a346563189a6867482950b13eda11e0fb5d2
Setuptools v54.1.0 introduces a warning that the use of dash-separated
options in 'setup.cfg' will not be supported in a future version [1].
Get ahead of the issue by replacing the dashes with underscores. Without
this, we see 'UserWarning' messages like the following on new enough
versions of setuptools:
UserWarning: Usage of dash-separated 'description-file' will not be
supported in future versions. Please use the underscore name
'description_file' instead
[1] https://github.com/pypa/setuptools/commit/a2e9ae4cb
Change-Id: I394e12bf1816e4e23e4f547db4bae89547af7989
Add file to the reno documentation build to show release notes for
stable/wallaby.
Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/wallaby.
Sem-Ver: feature
Change-Id: I73998aa60325a26fc11418a0b37c1f4524469e32
We facing errors related to the new pip resolver, this
topic was discussed on the ML and QA team proposed to
to test lower-constraints [1].
I propose to drop this test because the complexity and recurring pain needed
to maintain that now exceeds the benefits provided by this mechanismes.
[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019390.html
Change-Id: I62d911111b54976a9df726c48f593a52e275fe6c
Introduced changes:
- pre-commit config and rules.
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit hooks.
- Applying fixes for pre-commit compliance in all code.
Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.
pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker
(check-byte-order-marker);
- Checks that non-binary executables have a proper
shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings
(check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)
For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks
Change-Id: I045fa1cd7932d960e1cf49b2c335c7acdeba0b46
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
Ansible invokes modules with executable placed under /tmp. This
causes stevedore caching to create bazillions of useless cache files.
When we can identify we run with executable under /tmp or if in the
target cache directory an empty file '.disable' is present - skip
writing cache.
Change-Id: Ic483ac68027505402ba32d7f612631e15a678d09
Add file to the reno documentation build to show release notes for
stable/victoria.
Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/victoria.
Change-Id: I111d3307dd6af6d814d5f685f3acd7a41e5168e0
Sem-Ver: feature
There is a syntax error in the comment of stevedore code.
For example, in the HookManager class:
:param on_load_failure_callback: Callback function that will be called when
a entrypoint can not be loaded.
Here should not be `a entrypoint`, just `an entrypoint` instead.
Fixes: bug #1892610
Change-Id: Ic2aaf5f467bcecaec6adff1ead8e159ae749ac50
The underlying EntryPoint class has some similar methods to fetch
these values, but they depend on the version of importlib.metadata
that is installed, so this provides a consistent API
Change-Id: I7a1b9541f0e4042a224e49c890ba3c63e8a5a259
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Fix the way the warning for undocumented modules in a detail list is
produced. The new importlib.metadata.EntryPoint type is derived from
namedtuple so using string interpolation means the multi-part tuple
causes an error. Take the opportunity to include a more detailed
message.
Change-Id: I02223a982258a1bf8fc28fa91c7c090c7ac3554e
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Load entry points using 'importlib.metadata' instead of 'pkg_resources'.
Include a caching layer. The cache stores the parsed text data from all
of the ini input files in a single JSON file with a name based on the
hash of the path entries and the mtimes. This should produce a unique
filename for each import path, regardless of the use of a virtualenv.
The data is stored in a format that means no other files need to be
examined or parsed in order to return EntryPoint objects.
Change-Id: I8b08f289d446f4775eac1e1a91997fa96f25f641
Depends-On: Ic6db7af34c87a636bfe55bacae03c42154f4b9c7
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Travis is not actually used for this repo. Remove the old configuration
file to clean things up.
Change-Id: I862f8e0222a7f0e12c7b67ad305e021b76859fe4
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Now that stevedore does not support Python 2 anymore, there is no need
to ever use the external 'mock' package. Python 3.3+ has it integrated
as 'unittest.mock', so just use that.
Change-Id: I28a50cac12670bb6987b4c7794a15e15aa1fe965
Signed-off-by: Michał Górny <mgorny@gentoo.org>