Closed zhuweiji closed 2 months ago
This seems to be because top_level.txt is not included with chaostoolkit_azure-0.17.0.dist-info
. This top_level.txt is what is used to resolve top-level package names in chaoslib.discovery.package.PathDistribution
.
chaostoolkit_kubernetes-0.28.0.dist-info
comes with a top_level.txt.
When building the two projects locally with pdm, top_level.txt is missing in chaostoolkit-azure. It's missing in the 0.17 release on github as well. The pyproject.toml
of both projects look identical with regards to the build step and the folder structures are similar, so not sure why top_level.txt is not being generated.
@Lawouach any ideas?
Hi @zhuweiji sorry for the lag. I was away quite a bit the last few weeks. I'll look into it tomorrow.
@Lawouach, no worries! I'm suspecting that it might be related to python versions, so I'm trying to build the package with various minor and patch versions of python using tox and pyenv.
Hey @zhuweiji again I apologise for my slow responses this summer.
I have reproduced the issue and I believe it doesn't come from this package but from the fact that when we install packages, the wheels distributions do not contain a top_level.txt
metadat files any longer. So I had to change the way we discover package name from distributions in chaostoolkit-lib. https://github.com/chaostoolkit/chaostoolkit-lib/commit/9e0d067e3485021c660ec9a38184d77faa9ef1eb
I'm about to release chaostoolkit-lib 1.44.0 and I hope this should fix it.
Alright, if you update chaostoolkit-lib
the discovery should now work.
$ pip install -U chaostoolkit-lib
$ chaos discover --no-install chaostoolkit-azure
[2024-08-25 11:12:03 INFO] Discovering capabilities from chaostoolkit-azure
[2024-08-25 11:12:03 WARNING] 'chaosazure.webapp.probes' does not expose the __all__ attribute. It is required to determine what functions are actually exported as activities.
[2024-08-25 11:12:03 INFO] Discovery outcome saved in ./discovery.json
Hi Sylvain, thanks so much for the fix. I was looking into it for awhile too but I couldn't figure out how to navigate the importlib_metadata API. I'll mark the issue as closed.
Under the Chaos Toolkit CLI, the
discover
command is exposed.Running the discover command for this package results in an error.
In comparison, running this command for another chaos-toolkit extension such as the chaostoolkit-kubernetes extension shows the following result.
Version: