diff --git a/CHANGELOG.md b/CHANGELOG.md index ecb36588..267d6ab0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.3.2] - 2024-03-25 + +### Added + +### Changed + +- Moved DeprecationWarning to __post_init__ of BaseRequestConfiguration. [microsoft/kiota#250](https://github.com/microsoft/kiota-abstractions-python/pull/250) + + ## [1.3.1] - 2024-03-05 ### Added diff --git a/kiota_abstractions/_version.py b/kiota_abstractions/_version.py index 57a2f0ce..9964bf2d 100644 --- a/kiota_abstractions/_version.py +++ b/kiota_abstractions/_version.py @@ -1 +1 @@ -VERSION: str = "1.3.1" +VERSION: str = "1.3.2" diff --git a/kiota_abstractions/base_request_configuration.py b/kiota_abstractions/base_request_configuration.py index 1cc0ecfc..4119acb7 100644 --- a/kiota_abstractions/base_request_configuration.py +++ b/kiota_abstractions/base_request_configuration.py @@ -28,7 +28,9 @@ class RequestConfiguration(Generic[QueryParameters]): @dataclass class BaseRequestConfiguration(RequestConfiguration): - warn( - "BaseRequestConfiguration is deprecated. Use RequestConfiguration class instead.", - DeprecationWarning - ) + + def __post_init__(self): + warn( + "BaseRequestConfiguration is deprecated. Use RequestConfiguration class instead.", + DeprecationWarning + ) diff --git a/tests/test_base_request_configuration.py b/tests/test_base_request_configuration.py new file mode 100644 index 00000000..1a274e6e --- /dev/null +++ b/tests/test_base_request_configuration.py @@ -0,0 +1,13 @@ +import pytest + +from kiota_abstractions.base_request_configuration import BaseRequestConfiguration + + +def test_base_request_configuration_deprecation_warning(): + with pytest.warns(DeprecationWarning, match="BaseRequestConfiguration is deprecated. Use RequestConfiguration class instead."): + BaseRequestConfiguration() + + +def test_import_base_request_configuration_no_warning(): + from kiota_abstractions.base_request_configuration import BaseRequestConfiguration, RequestConfiguration + assert len(pytest.warns()) == 0