Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Python 3 #5

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

lepeuvedic
Copy link

The update replaces urllib2 with requests, eliminates the last remnants of Python 2 syntax and more cleanly defines herald as an executable Python module, using a new main.py entry point. The recommended way to launch herald is with the -m option to python3.

The clean up defines the plugins as independent user-defined Python modules, which do not need to reside in the herald file hierarchy (herald never relied on that anyway, since the plugins location is configurable).

The new version runs with Python 3.11, but should run with most versions of Python 3. It still uses gevent.

Update herald.py for Python 3.11 with modern dependencies.
Upgrade gevent to version 23.9 and pyyaml to version 6.0 in the
install_requires section of setup.py.
This commit adds the .idea/.gitignore file with the following ignored files:
- /shelf/
- /workspace.xml
Transforms herald in an executable module. Must run using -m option of the Python 3 interpreter. The plugins directory is no longer a module since plugins just Python scripts which import herald module herald.baseplugin.
© CalCool Studios SAS 2021-2023
🐛 fix(herald): Fix typo in error message

🎨 style(herald): Remove unused imports

🎨 style(herald): Remove commented code

🐛 fix(baseplugin): Fix typo in assertion message

🚧 chore(herald): Add logger.info() statement

📝 docs(herald): Add missing docstring

🐛 fix(httpplugin): Replace urllib2 with requests

📝 docs(httpplugin): Add missing docstring

🐛 fix(example_config): Fix typo in thresholds_metric

✨ feat(example_config): Add new plugin configuration
…nder debugger.

Refactor the codebase in the `herald.py`, `baseplugin.py`, `httpplugin.py`, and `__main__.py` files to remove unused imports.
@raags
Copy link
Contributor

raags commented Sep 24, 2023

Hi @lepeuvedic, thank you for your contribution. I no longer have write access to this repository, I've asked the org to review and accept the PR.

@ghoseb
Copy link

ghoseb commented Sep 24, 2023

@lepeuvedic I would suggest excluding the .idea folder from the commit.




Created on 23/09/2023
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest removing this boilerplate comment.

@ghoseb
Copy link

ghoseb commented Sep 28, 2023

@lepeuvedic I can see that you have added the .idea folder to .gitignore which is good, but you also need to delete the .idea files which are already included in this PR. The best thing will be to squash a few commits and cleanup the PR with only meaningful commits.

This is one of the commits that needs to be undone - 8022f8c

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.

None yet

3 participants