-
Notifications
You must be signed in to change notification settings - Fork 2
refactor: utils #44
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
base: master
Are you sure you want to change the base?
refactor: utils #44
Conversation
…omplete` to `utils/public.py`
…omplete` to `utils/public.py`
* Start migration to uv * Setup ruff and hatch * Change pre-commit to use ruff * Format with ruff * Fix mistake * Add dev deps * Change workflows to use uv and ruff * ➕ Add colorlog and remove requirements folder and fix build * 💚 Fix sphinx build ? * 🐛 Add __version.py for version management and update import in __init__.py * ✏️ Update lib-checks.yml to run ruff on ubuntu-latest * 🐛 Update lib-checks.yml to run mypy with uv * 🔥 Delete MANIFEST.in * ✨ Enhance lib-checks.yml to include ruff formatter check * ♻️ Refactor pyproject.toml and uv.lock to use optional-dependencies for voice and speed
* chore: Update localization workflows to use 'uv' for dependency management * chore: refactor Read the Docs configuration to use uv
…tation to private module
It was used twice, and once it wasn't even necessary
Co-authored-by: Lumouille <[email protected]> Signed-off-by: Paillat <[email protected]>
Co-authored-by: Ice Wolfy <[email protected]> Signed-off-by: Paillat <[email protected]>
Co-authored-by: Ice Wolfy <[email protected]> Co-authored-by: Lumouille <[email protected]> Signed-off-by: Paillat <[email protected]>
Co-authored-by: Lumouille <[email protected]> Signed-off-by: Paillat <[email protected]>
Co-authored-by: Lumouille <[email protected]> Signed-off-by: Paillat <[email protected]>
Signed-off-by: Paillat <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the Discord library's utils module to improve code organization and reduce maintenance burden by separating private utilities from user-facing APIs.
Key changes include:
- Splitting utils into
utils.public
for user-facing utilities andutils.private
for internal functions - Removing overly specific or rarely used utilities
- Consolidating overlapping utilities (like merging
time_snowflake
intogenerate_snowflake
)
Reviewed Changes
Copilot reviewed 61 out of 61 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
discord/utils/public.py | New file containing user-facing utility functions |
discord/utils/private.py | New file containing internal utility functions |
discord/utils/init.py | New module initialization file exporting public utilities |
discord/utils.py | Removed monolithic utils file |
Multiple source files | Updated imports to use new utils structure |
Documentation files | Updated to reflect removed utilities and new import patterns |
Test files | Updated imports and removed deprecated function tests |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Paillat <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Paillat <[email protected]>
b501d54
to
0df56df
Compare
The general goal of these changes is to lower the amount of code we have to maintain across te library.
Changes include:
Separated utils function in:
utils.private
for private utils that are to be used in the library codeutils
for user facing utilsRemoved over specific utils
Removed overly specific public utils that wouldn't commonly be used by users and aren't hard to re implement in any project. See
CHANGELOG-V3.md
for a comprehensive list.Removed unused (or lesser used) utils
Remove utils that were used less than once or twice in the library in favor of:
Merged overlapping utils
Merge utils with common goals or with same goal with one another, e.g. see changes to
utils.time_snowflake
->utils.generate_snowflake