drop python2, add typing hint, rename naming to follow pep8#22
Merged
Conversation
lidaobing
requested changes
Jul 4, 2026
lidaobing
reviewed
Jul 5, 2026
lidaobing
reviewed
Jul 5, 2026
lidaobing
requested changes
Jul 5, 2026
lidaobing
reviewed
Jul 5, 2026
lidaobing
reviewed
Jul 5, 2026
lidaobing
reviewed
Jul 5, 2026
lidaobing
requested changes
Jul 5, 2026
lidaobing
reviewed
Jul 5, 2026
lidaobing
reviewed
Jul 5, 2026
There was a problem hiding this comment.
Pull request overview
This PR modernizes python-lunardate by dropping Python 2-era API naming, adding type annotations, and updating packaging/CI to reflect a Python 3-only support stance.
Changes:
- Declare Python 3-only support in packaging metadata and classifiers.
- Rename public APIs to PEP 8 snake_case while keeping some deprecated aliases.
- Add type checking to CI (mypy) and update documentation examples accordingly.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Adds python_requires and updates supported Python classifiers. |
| README.md | Updates usage examples and link formatting to match renamed APIs. |
| lunardate.py | Adds typing, introduces snake_case APIs + deprecations, and refactors internal naming. |
| lunardate.egg-info/PKG-INFO | Updates generated metadata/version fields and classifiers. |
| .github/workflows/python-package.yml | Adds mypy to CI dependency install and runs a mypy step. |
Comments suppressed due to low confidence (1)
lunardate.egg-info/PKG-INFO:5
lunardate.egg-info/PKG-INFOlooks like generated packaging metadata. Tracking generated egg-info in git tends to create churn/inconsistencies (and it currently embeds usage examples that reference deprecated camelCase APIs). Consider removing egg-info from version control and generating it only during builds/releases.
Metadata-Version: 2.4
Name: lunardate
Version: 0.2.2
Summary: A Chinese Calendar Library in Pure Python
Home-page: https://github.com/lidaobing/python-lunardate
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+138
to
+141
| def __str__(self) -> str: | ||
| return 'LunarDate(%d, %d, %d, %d)' % (self.year, self.month, self.day, self.is_leap_month) | ||
|
|
||
| __repr__ = __str__ | ||
| __repr__: ClassVar = __str__ |
Owner
|
LGTM |
lidaobing
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.