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: Correct regression from pull #2124 #2126

Merged
merged 1 commit into from Jun 16, 2023

Conversation

afroemming
Copy link
Contributor

Summary

Pycord requires typing_extensions as a dependency for python < 3.11, however not on version >= 3.11. Because the changes in the referenced pull always tries to load from typing_extensions, they make it so an exception will be raised if the end user is using python >= 3.11 and does not otherwise have that library installed when _parse_options is run (ie, whenever a command is registered).

This change checks the version of python running Pycord, then imports stdlib typing if >= 3.11.

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes. (N/A?)
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes. (N/A?)

Pycord requires typing_extensions as a dependency for python < 3.11,
however not on version >= 3.11. Because the changes in the referenced
pull always tries to load from typing_extensions, they make it so an
exception will be raised if the end user is using python >= 3.11 and
does not otherwise have that library installed when _parse_options is
 run (ie, whenever a command is registered).

This change checks the version of python running Pycord, then imports
stdlib typing if >= 3.11.
@codecov
Copy link

codecov bot commented Jun 16, 2023

Codecov Report

Merging #2126 (a6ef8eb) into master (d894a58) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2126   +/-   ##
=======================================
  Coverage   33.87%   33.88%           
=======================================
  Files         109      109           
  Lines       22340    22343    +3     
=======================================
+ Hits         7568     7571    +3     
  Misses      14772    14772           
Flag Coverage Δ
macos-latest-3.10 33.86% <75.00%> (+<0.01%) ⬆️
macos-latest-3.11 33.86% <75.00%> (+<0.01%) ⬆️
macos-latest-3.8 33.87% <75.00%> (+<0.01%) ⬆️
macos-latest-3.9 33.87% <75.00%> (+<0.01%) ⬆️
ubuntu-latest-3.10 33.86% <75.00%> (+<0.01%) ⬆️
ubuntu-latest-3.11 33.86% <75.00%> (+<0.01%) ⬆️
ubuntu-latest-3.8 33.87% <75.00%> (+<0.01%) ⬆️
ubuntu-latest-3.9 33.87% <75.00%> (+<0.01%) ⬆️
windows-latest-3.10 33.86% <75.00%> (+<0.01%) ⬆️
windows-latest-3.11 33.86% <75.00%> (+<0.01%) ⬆️
windows-latest-3.8 33.87% <75.00%> (+<0.01%) ⬆️
windows-latest-3.9 33.87% <75.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
discord/commands/core.py 40.73% <100.00%> (+0.21%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d894a58...a6ef8eb. Read the comment docs.

@afroemming
Copy link
Contributor Author

This regression passed automated tests because typing_extensions is required in the dev group, which the tests pull.

@Lulalaby Lulalaby merged commit ca2f5da into Pycord-Development:master Jun 16, 2023
29 checks passed
@Lulalaby
Copy link
Member

Thanks!

@afroemming afroemming deleted the type-hint-decorators branch June 16, 2023 19:28
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

2 participants