-
Notifications
You must be signed in to change notification settings - Fork 10
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: nhairs/python-json-logger
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: nhairs/python-json-logger
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: refactor/centralize-formatters-fix-pypy
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 7 commits
- 9 files changed
- 2 contributors
Commits on May 21, 2025
-
Configuration menu - View commit details
-
Copy full SHA for fde1e9c - Browse repository at this point
Copy the full SHA fde1e9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7f0a6bb - Browse repository at this point
Copy the full SHA 7f0a6bbView commit details
Commits on May 26, 2025
-
Configuration menu - View commit details
-
Copy full SHA for df922fb - Browse repository at this point
Copy the full SHA df922fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 81d38e8 - Browse repository at this point
Copy the full SHA 81d38e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ffd19d - Browse repository at this point
Copy the full SHA 8ffd19dView commit details
Commits on Jun 26, 2025
-
Centralize formatter lists for tests and fix PyPy CI
This commit centralizes the definitions of formatter lists used for testing and resolves an ImportError that was occurring in PyPy environments during test collection. Key changes: 1. Centralized Formatter Lists in `tests/__init__.py`: * Added `from __future__ import annotations` for modern type hints. * Defined `ALL_FORMATTERS: List[Type[BaseJsonFormatter]]` containing actual formatter class objects (`JsonFormatter`, and conditionally `OrjsonFormatter`, `MsgspecFormatter` based on availability of their underlying packages). * Defined `ALL_FORMATTER_PATHS: List[str]` derived from `ALL_FORMATTERS` (e.g., `["pythonjsonlogger.json.JsonFormatter", ...]`). * The conditional inclusion of formatters now correctly relies on `pythonjsonlogger.ORJSON_AVAILABLE` and `pythonjsonlogger.MSGSPEC_AVAILABLE` flags to prevent import attempts if dependencies are missing. 2. Updated `tests/test_formatters.py`: * Removed its local definition of `ALL_FORMATTERS`. * Now imports and uses the centralized `ALL_FORMATTERS` list from `tests.__init__`. 3. Updated `tests/test_dictconfig.py`: * Removed its local definition of `SUPPORTED_DICTCONFIG_FORMATTERS`. * Removed direct top-level imports of `pythonjsonlogger.orjson` and `pythonjsonlogger.msgspec` modules, which were causing `MissingPackageError` on PyPy environments where these optional dependencies are not installed. The `test_dictconfig.py` now relies on `ALL_FORMATTER_PATHS` imported from `tests.__init__`, where the conditional logic correctly handles availability. * The parameterized test `test_external_reference_support_parameterized` now correctly uses the imported `ALL_FORMATTER_PATHS`. This refactoring ensures a single source of truth for formatter lists, improves maintainability, and crucially fixes the test collection errors on PyPy environments. All linters and tests now pass across all configured environments in `tox`.
Configuration menu - View commit details
-
Copy full SHA for c9b76ff - Browse repository at this point
Copy the full SHA c9b76ffView commit details
Commits on Jun 27, 2025
-
Focus dictConfig tests on library-specific integration
This commit refines `tests/test_dictconfig.py` to concentrate on testing aspects unique to `python-json-logger`'s interaction with `logging.config.dictConfig`, rather than general `dictConfig` behaviors that are the responsibility of the standard library. Key changes: 1. Removed Redundant Tests: - `test_disable_existing_loggers`: This test primarily verified the standard `disable_existing_loggers` flag of `dictConfig`. - `test_multiple_handlers_and_formatters`: While it used the library's formatter, the core functionality tested (routing to multiple handlers) is standard `dictConfig` behavior. - `test_filter_configuration`: Testing filter application is also a standard `dictConfig` feature. - Associated helper classes (`TestStream1`, `TestStream2`, `LevelFilter`) and global instances (`test_stream_1_instance`, etc.) were removed as they were only used by these tests. 2. Retained Focused Tests: - `test_external_reference_support_parameterized`: Kept as it tests the crucial `ext://` reference resolution for formatter options, which is a key integration point for `python-json-logger` with `dictConfig`. This test is also parameterized to run against all supported formatter types (`JsonFormatter`, `OrjsonFormatter`, `MsgspecFormatter` via `ALL_FORMATTER_PATHS`). - `test_json_encoder_option` and `test_json_serializer_option`: Kept as they specifically test `ext://` references for configuring custom encoders and serializers, a `dictConfig`-specific interaction for the library's formatters. This streamlining ensures that `test_dictconfig.py` is more focused on validating the unique aspects of `python-json-logger`'s support for and integration with `dictConfig`, reducing redundancy with tests that would be more appropriate for the standard library's own test suite. All linters and the full `tox` test suite pass with these changes.
Configuration menu - View commit details
-
Copy full SHA for df7cb80 - Browse repository at this point
Copy the full SHA df7cb80View commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff main...refactor/centralize-formatters-fix-pypy