Skip to content

fix: resolve KeyError in run.py and update Python version requirement - #188

Open
itxaiohanglover wants to merge 1 commit into
oss-compass:mainfrom
itxaiohanglover:fix/keyerror-and-python-version
Open

fix: resolve KeyError in run.py and update Python version requirement#188
itxaiohanglover wants to merge 1 commit into
oss-compass:mainfrom
itxaiohanglover:fix/keyerror-and-python-version

Conversation

@itxaiohanglover

Copy link
Copy Markdown

Summary

Fixes #117

Changes

  1. run.py — Fix KeyError when optional params are missing from conf.yaml

    • Before: kwargs[item] = None if params[item] and params[item] == 'None' else params[item] — crashes with KeyError when a key is not in params
    • After: kwargs[item] = None if item not in params or params[item] == 'None' else params[item] — safely handles missing keys
    • Fixed all 5 instances of this pattern in run.py
  2. setup.py — Update Python version requirement

    • Changed python_requires from >=3.4 to >=3.8
    • Updated classifiers from 3.4, 3.5 to 3.8, 3.9, 3.10, 3.11
    • This matches the actual requirement of the grimoire_elk dependency (see grimoirelab-elk pyproject.toml)
  3. README.md — Add Python version requirement note

    • Added ### Requirements section with Python >= 3.8 note

Test plan

  • Both run.py and setup.py compile successfully
  • No logic changes, only error handling and version metadata fixes

…oss-compass#117)

- Fix KeyError in run.py: check if key exists in params dict before
  accessing it, preventing crash when optional params are missing
- Update setup.py: python_requires from >=3.4 to >=3.8 to match
  the actual grimoire_elk dependency requirement
- Update README: add Python >=3.8 requirement note

Signed-off-by: itxaiohanglover <1531137510@qq.com>
@itxaiohanglover
itxaiohanglover force-pushed the fix/keyerror-and-python-version branch from 9009c40 to 9d077bd Compare July 6, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

希望大佬们提供更多该程序的引导说明,包括部署过程和使用方法

1 participant