awslabs / aws-az-failure-chaostoolkit

Custom Chaos Toolkit extension to simulate AZ failure/failover on supported AWS resources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chaostoolkit-lib pinned version

Lawouach opened this issue · comments

Hello,

I noticed you pinned chaostoolkit-lib due to a breaking change in the library and I was wondering what I broke that I might fix. The chaoslib evolves rapidly so pinning an old version isn't going to be easy on users. i'm happy to see if I can fix chaoslib somehow.

It seems that it's flake8 which causes trouble

flake8 5.0.4 requires importlib-metadata<4.3,>=1.1.0; python_version < "3.8", but you have importlib-metadata 6.0.0 which is incompatible.

I will create a PR to fix this. I suggest the project moves aways from flake8 onto ruff. Faster and just as powerful without the downsides that flake8 has demonstrated.

Hi @farhanangullia I hope the PR will help.

Hey @Lawouach thank you for looking into it! What prompted the pinning of dependency was indeed due to importlib-metadata which removed a deprecated API resulting in the error here:

$ chaos --version
Traceback (most recent call last):
  File "/usr/local/bin/chaos", line 5, in <module>
    from chaostoolkit.__main__ import cli
  File "/usr/local/lib/python3.7/site-packages/chaostoolkit/__main__.py", line 1, in <module>
    from chaostoolkit.cli import cli
  File "/usr/local/lib/python3.7/site-packages/chaostoolkit/cli.py", line 762, in <module>
    with_plugins(importlib_metadata.entry_points().get("chaostoolkit.cli_plugins"))(cli)
AttributeError: 'EntryPoints' object has no attribute 'get'

chaostoolkit-lib <= 1.33.1 did not face this issue but it surfaced in 1.34.1 on Python 3.7

Oooh! I see. Thank you for posting this. I'm so surprised I missed that one. I will fix chaoslib for that specific issue.

The whole importlib-metadata API is a bit of a mess and hard to follow through. I'm so sorry for that.

Right, I'm hoping this was fixed with chaostoolkit/chaostoolkit#279