Skip to content

Fix #16 and #21 - #22

Merged
cvraut merged 38 commits into
mainfrom
dev
Mar 5, 2026
Merged

Fix #16 and #21#22
cvraut merged 38 commits into
mainfrom
dev

Conversation

@cvraut

@cvraut cvraut commented Mar 3, 2026

Copy link
Copy Markdown
Owner

This PR updates whecho to version 0.0.6. It modernizes treatment of version handling and discord webhooks.

Recently discord has updated their webhook generator to also append app at the end of the url. This PR not only checks for the presence of discord.com but also discordapp.com in the webhook url to determine how to handle the request. This will take care of #21.

pkg_resources is now depreciated. This PR uses importlib.metadata instead to get the version number for whecho. This should silence the warning present with #16.

For development work, github has depreciated most of the python 3.6 runners, such as the windows-2019 runner. This PR switches the windows runner to the windows-2022 runner to maintain python 3.6 test coverage. It also adds a new test case to test_whecho_simple.py to cover the edge case for #21.

Copilot AI and others added 27 commits October 14, 2025 13:44
Co-authored-by: cvraut <10603882+cvraut@users.noreply.github.com>
Co-authored-by: cvraut <10603882+cvraut@users.noreply.github.com>
…dency

Copilot/remove pkg resources dependency

merging into dev to allow for testing. Note, in the future PR's should be made to dev first. Branch rules disallow automated testing on branches other than dev and main to protect the webhook test urls.
…314 as other python versions to check against

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread whecho/whecho.py Outdated
Comment thread tests/test_post_message.py Outdated
Comment thread tests/test_post_message.py
Comment thread whecho/whecho.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@cvraut cvraut left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

PR Overview (from copilot review)

This PR releases whecho v0.0.6, updating version resolution away from deprecated pkg_resources and improving Discord webhook URL handling to support both discord.com and discordapp.com.

Changes:

  • Replace pkg_resources with importlib.metadata/importlib_metadata for version lookup (Python 3.6+ compatible).
  • Treat discordapp.com webhook URLs the same as discord.com in payload selection; add early input validation for missing URL/message.
  • Update CI/test plumbing: add TEST_DISCORD_URL, modernize tox config, expand GitHub Actions matrix, and add/extend tests.

Reviewed Changes

File Description
whecho/whecho.py Makes CLI description emoji conditional on UTF-8 stdout encoding.
whecho/_utilities.py Uses importlib.metadata for --version behavior.
whecho/_send_message.py Adds URL/message validation and supports discordapp.com URL detection.
whecho/_config.py Uses importlib.metadata to populate default config version.
whecho/README.md Documents contribution flow and adds TEST_DISCORD_URL to test setup.
tox.ini Enables isolated builds, passes TEST_DISCORD_URL, sets PYTHONIOENCODING.
tests/test_whecho_simple.py Adds Discord integration test and empty-URL error test.
tests/test_post_message.py Adds unit tests for missing URL/message validation.
tests/test_auto_machine.py Removes unused import.
pyproject.toml Bumps version to 0.0.6 and adds importlib-metadata for Python < 3.8.
.github/workflows/pytest.yml Adds TEST_DISCORD_URL and expands OS/Python test matrix.

@cvraut
cvraut merged commit 8c51a35 into main Mar 5, 2026
10 checks passed
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.

3 participants