Skip to content

Remove obsolete RenameRouterMethods metaclass #612

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

Merged
merged 2 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions rest_framework-stubs/routers.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from collections.abc import Callable, Iterable, Mapping
from typing import Any, NamedTuple

from django.utils.deprecation import RenameMethodsBase
from rest_framework import views
from rest_framework.renderers import BaseRenderer
from rest_framework.request import Request
Expand All @@ -27,10 +26,7 @@ class DynamicRoute(NamedTuple):
def escape_curly_brackets(url_path: str) -> str: ...
def flatten(list_of_lists: Iterable[Iterable[Any]]) -> Iterable[Any]: ...

class RenameRouterMethods(RenameMethodsBase):
renamed_methods: Iterable[str | Callable]

class BaseRouter(metaclass=RenameRouterMethods):
class BaseRouter:
registry: list[tuple[str, type[ViewSetMixin], str]]
def register(
self, prefix: str, viewset: type[ViewSetMixin], basename: str | None = ..., base_name: str | None = ...
Expand Down
4 changes: 0 additions & 4 deletions scripts/stubtest/allowlist_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ rest_framework.renderers._BaseOpenAPIRenderer.__init__
rest_framework.renderers._BaseOpenAPIRenderer.render
rest_framework.request.Request.DATA
rest_framework.request.Request.QUERY_PARAMS
rest_framework.routers.BaseRouter
rest_framework.routers.BaseRouter.register
rest_framework.routers.DefaultRouter
rest_framework.routers.RenameRouterMethods
rest_framework.routers.SimpleRouter
rest_framework.schemas.SchemaGenerator.__init__
rest_framework.schemas.coreapi.SchemaGenerator.__init__
rest_framework.schemas.generators.common_path
Expand Down