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

Enhance BlacklistMixin with Generic Type for Accurate Type Inference #768

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

Dresdn
Copy link
Contributor

@Dresdn Dresdn commented Dec 4, 2023

Closes #767

Comment on lines +25 to +26
T = TypeVar("T", bound="Token")

Copy link
Member

Choose a reason for hiding this comment

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

Bounded context. Looks good to me.



class TestInit(SimpleTestCase):
def test_package_is_not_installed(self):
with patch(
"pkg_resources.get_distribution", Mock(side_effect=DistributionNotFound)
"importlib.metadata.version", Mock(side_effect=PackageNotFoundError)
Copy link
Member

Choose a reason for hiding this comment

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

Thank you for making this patch, moving from legacy pkg_resources to importlibis a positive move forward to accessing modules metadata.

tldr; Looks good to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. This really just reflects the changes that were made to rest_framework_simplejwt/__init__.py in 19cf38e

Copy link
Member

Choose a reason for hiding this comment

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

A few tox tests seems to be breaking, though. Mostly version-dependent tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are a few tests that seem to not have been passing for a while. I just opened #769 to consolidate the fixes, and I'll update this MR to remove the tests fixes.

Copy link
Member

@50-Course 50-Course Dec 5, 2023

Choose a reason for hiding this comment

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

Oh great this should be ready for ready for merge then, @Andrew-Chen-Wang just merged #769

@Dresdn
Copy link
Contributor Author

Dresdn commented Dec 4, 2023

Tests should pass once #769 is merged.

Copy link
Member

@50-Course 50-Course left a comment

Choose a reason for hiding this comment

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

Approving changes, since tests fixes had been removed from #769

@50-Course 50-Course merged commit 64b32c2 into jazzband:master Dec 5, 2023
1 of 65 checks passed
@Andrew-Chen-Wang
Copy link
Member

Thank you @Dresdn and @50-Course !

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.

Type for BlacklistMixin.for_user() Needs to be enhanced for RefreshToken usage
3 participants