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

core: big cleanup & deprecations for core.common module #380

Merged
merged 14 commits into from
Aug 16, 2024
Merged

Conversation

karlicoss
Copy link
Owner

core.common been getting a bit out of hand and confusing due to too many things in it, many of which are deprecated

This introduces

  • proper deprecations with a runtime warnings for outdated functions/types/alisases. Most are backwards compatible in runtime, while hidden from mypy so it flags the deprecation early
  • functions/types from common moved to more specialized files which better naming
  • utilizes typing_extensions in core.compat better

See commit messages for a detailed log of changes

rely on typing-extensions for fallback

introducing typing-extensions dependency without fallback, should be ok since it's in the top 10 of popular packages
…me warnings

among affected things:

- core.common.assert_never
- core.common.cproperty
- core.common.isoparse
- core.common.mcachew
- core.common.the
- core.common.tzdatetime
- core.compat.sqlite_backup
- deprecate group_by_key, should use itertool.bucket instead
- move make_dict and ensure_unique to my.core.utils.itertools
…annotations for it

also some minor refactoring of my.rss
moving without backward compatibility, since it's extremely unlikely they are used for any external modules

in fact, unclear if these methods still have much value at all, but keeping for now just in case
- move to my.core.utils.itertools
- more robust check for hashable types -- now checks in runtime (since the one based on types purely isn't necessarily sound)
- add more testing
without backwards compat, unlikely it's been used by anyone
…horough tests/docs

deprecate core.common.stat and core.common.Stats with backwards compatibility
no backward compat, unlikely it was used by anyone else
…ecking

runtime still works for backwards compatibility
@karlicoss karlicoss merged commit 7023088 into master Aug 16, 2024
19 checks passed
@karlicoss karlicoss deleted the assert_never branch August 16, 2024 09:22
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