-
Notifications
You must be signed in to change notification settings - Fork 5
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
Split core functionality and support orjson and msgspec #9
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
60893a5
Refactor into core and json module, add orjson support
nhairs 7f7ea2a
Format tests
nhairs e9aff5b
Allow tests to complete on all platforms
nhairs eaf56e2
Fix broken GHA spec
nhairs c36d6da
Don't support defaults kwargs (py310+ only)
nhairs 4b19678
Drop py37 support, begin testing again py313
nhairs 0d8b8a1
Fix py313 in GHA
nhairs 3897a97
Don't instlal python on pypy
nhairs 2eb8820
Run py313 in py313...
nhairs bc2b96e
Avoid orjson on python 3.13 while its not supported
nhairs 1441721
Migrate tests to pytest, test OrjsonFormatter where possible
nhairs c017bef
Update docstrings to use mkdocstrings compatible
nhairs 457a74c
Fix formatting, linting, typing
nhairs 0d2bc65
Remove py37 from tox config
nhairs 0ee6b9a
Maintain backwards compatibility
nhairs a0b595b
Add more tests
nhairs 77dcdae
Add support for deprecated json.RESERVED_ATTRS
nhairs b61fc98
fix assert in test
nhairs 89f0820
Update test names
nhairs a2df91b
Add support for msgspec
nhairs 44c610d
Fix msgspec specifiers
nhairs 32f763f
simplify ORJSON_AVAILABLE check
nhairs 487388c
Update README and CHANGELOG
nhairs 5cc6e3d
Fix formatting
nhairs ce76b66
Add other encoders to README
nhairs 44406d3
Update freezegun issue references
nhairs 5a6b959
Remove optional dependencies for specific encoders
nhairs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
### IMPORTS | ||
### ============================================================================ | ||
## Future | ||
|
||
## Standard Library | ||
import warnings | ||
|
||
## Installed | ||
|
||
## Application | ||
import pythonjsonlogger.json | ||
|
||
### CONSTANTS | ||
### ============================================================================ | ||
try: | ||
import orjson | ||
|
||
ORJSON_AVAILABLE = True | ||
except ImportError: | ||
ORJSON_AVAILABLE = False | ||
|
||
|
||
try: | ||
import msgspec | ||
|
||
MSGSPEC_AVAILABLE = True | ||
except ImportError: | ||
MSGSPEC_AVAILABLE = False | ||
|
||
|
||
### DEPRECATED COMPATIBILITY | ||
### ============================================================================ | ||
def __getattr__(name: str): | ||
if name == "jsonlogger": | ||
warnings.warn( | ||
"pythonjsonlogger.jsonlogger has been moved to pythonjsonlogger.json", | ||
DeprecationWarning, | ||
) | ||
return pythonjsonlogger.json | ||
raise AttributeError(f"module {__name__} has no attribute {name}") |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Do I need to specify when to install this?