Skip to content
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

Fix cgi and importlib_resources deprecations #185

Merged
merged 5 commits into from Jul 12, 2022

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented Jul 8, 2022

gidgethub/sansio.py:8: 10 warnings
  /private/tmp/gidgethub/gidgethub/sansio.py:8: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
    import cgi

Fix using email module as suggested at https://peps.python.org/pep-0594/#cgi


tests/test_abc.py: 10 warnings
  /private/tmp/gidgethub/tests/test_abc.py:705: DeprecationWarning: read_binary is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    payload = importlib_resources.read_binary(graphql_samples, payload_filename)

tests/test_apps.py::TestGitHubAppUtils::test_get_jwt
  /private/tmp/gidgethub/tests/test_apps.py:24: DeprecationWarning: read_binary is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    private_key = importlib_resources.read_binary(rsa_key_samples, "test_rsa_key")

tests/test_apps.py::TestGitHubAppUtils::test_get_installation_access_token
  /private/tmp/gidgethub/tests/test_apps.py:41: DeprecationWarning: read_binary is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    private_key = importlib_resources.read_binary(rsa_key_samples, "test_rsa_key")

Fix using files() API as suggested at https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy

@codecov-commenter
Copy link

codecov-commenter commented Jul 8, 2022

Codecov Report

Merging #185 (24ab9d4) into main (8c60e56) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #185   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          461       463    +2     
  Branches       102       108    +6     
=========================================
+ Hits           461       463    +2     
Impacted Files Coverage Δ
gidgethub/sansio.py 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Copy link
Collaborator

@brettcannon brettcannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like mypy doesn't like the typing of the change.

@hugovk
Copy link
Contributor Author

hugovk commented Jul 9, 2022

How's this?

@hugovk hugovk requested a review from brettcannon July 9, 2022 13:57
@brettcannon brettcannon merged commit 89ade88 into gidgethub:main Jul 12, 2022
@brettcannon
Copy link
Collaborator

Thanks!

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.

None yet

3 participants