Skip to content

Commit

Permalink
Remove obsolete RenameRouterMethods metaclass (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
intgr authored May 12, 2024
1 parent 766a29d commit 4dc3fcd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
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

0 comments on commit 4dc3fcd

Please sign in to comment.