Skip to content

Fix pkg_resources deprecated #627

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hikeya
Copy link

@hikeya hikeya commented Jun 23, 2025

Description

The pkg_resources package used by mqtt_connection_builder and others is scheduled to be removed as early as 2025-11-30.

Details

#626

Test Results

$ python -m unittest test.test_importlib_metadata -v
test_general_exception_handling_mqtt5_client_builder (test.test_importlib_metadata.TestImportlibMetadata.test_general_exception_handling_mqtt5_client_builder)
Test that general exceptions are handled correctly in mqtt5_client_builder ... ok
test_general_exception_handling_mqtt_connection_builder (test.test_importlib_metadata.TestImportlibMetadata.test_general_exception_handling_mqtt_connection_builder)
Test that general exceptions are handled correctly in mqtt_connection_builder ... ok
test_importlib_metadata_available (test.test_importlib_metadata.TestImportlibMetadata.test_importlib_metadata_available)
Test that importlib.metadata is available and working ... ok
test_importlib_metadata_import (test.test_importlib_metadata.TestImportlibMetadata.test_importlib_metadata_import)
Test that importlib.metadata is properly imported in the modified files ... ok
test_metrics_string_generation_mqtt5_client_builder (test.test_importlib_metadata.TestImportlibMetadata.test_metrics_string_generation_mqtt5_client_builder)
Test that mqtt5_client_builder uses importlib.metadata for version detection ... ok
test_metrics_string_generation_mqtt_connection_builder (test.test_importlib_metadata.TestImportlibMetadata.test_metrics_string_generation_mqtt_connection_builder)
Test that mqtt_connection_builder uses importlib.metadata for version detection ... ok
test_no_pkg_resources_import (test.test_importlib_metadata.TestImportlibMetadata.test_no_pkg_resources_import)
Test that pkg_resources is not imported in the modified files ... ok
test_package_not_found_handling_mqtt5_client_builder (test.test_importlib_metadata.TestImportlibMetadata.test_package_not_found_handling_mqtt5_client_builder)
Test that PackageNotFoundError is handled correctly in mqtt5_client_builder ... ok
test_package_not_found_handling_mqtt_connection_builder (test.test_importlib_metadata.TestImportlibMetadata.test_package_not_found_handling_mqtt_connection_builder)
Test that PackageNotFoundError is handled correctly in mqtt_connection_builder ... ok

----------------------------------------------------------------------
Ran 9 tests in 0.082s

OK

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@hikeya hikeya marked this pull request as draft June 23, 2025 03:34
@hikeya hikeya marked this pull request as ready for review June 23, 2025 03:53
@hikeya hikeya changed the title Fix/pkg resources deprecated Fix/pkg_resources deprecated Jun 23, 2025
@hikeya hikeya changed the title Fix/pkg_resources deprecated Fix pkg_resources deprecated Jun 23, 2025
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