diff --git a/.travis.yml b/.travis.yml index a599afda5..b13401185 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ jobs: - name: Lint with black python: 3.7 - script: black --check --line-length=120 scripts/ rest_framework-stubs/ + script: black --check --line-length=120 setup.py scripts/ rest_framework-stubs/ - name: Lint plugin code with isort python: 3.7 diff --git a/rest_framework-stubs/__init__.pyi b/rest_framework-stubs/__init__.pyi index 89ec4480a..e69de29bb 100644 --- a/rest_framework-stubs/__init__.pyi +++ b/rest_framework-stubs/__init__.pyi @@ -1,4 +0,0 @@ -HTTP_HEADER_ENCODING: str = ... -ISO_8601: str = ... - -default_app_config: str = ... diff --git a/rest_framework-stubs/views.pyi b/rest_framework-stubs/views.pyi index c8594c9fe..dbfad7984 100644 --- a/rest_framework-stubs/views.pyi +++ b/rest_framework-stubs/views.pyi @@ -20,6 +20,9 @@ def set_rollback() -> None: ... def exception_handler(exc: Exception, context) -> Optional[Response]: ... class APIView(View): + settings: APISettings + request: Request + renderer_classes: Sequence[Type[BaseRenderer]] = ... parser_classes: Sequence[Type[BaseParser]] = ... authentication_classes: Sequence[Type[BaseAuthentication]] = ... @@ -28,7 +31,6 @@ class APIView(View): content_negotiation_class: Optional[str] = ... metadata_class: Optional[str] = ... versioning_class: Optional[str] = ... - settings: APISettings schema: ViewInspector = ... @classmethod def as_view(cls, **initkwargs: Any) -> Any: ... diff --git a/setup.py b/setup.py index 87ebf2940..1225cfa51 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ def find_stub_files(name): result = [] for root, dirs, files in os.walk(name): for file in files: - if file.endswith('.pyi'): + if file.endswith(".pyi"): if os.path.sep in root: sub_root = root.split(os.path.sep, 1)[-1] file = os.path.join(sub_root, file) @@ -16,32 +16,28 @@ def find_stub_files(name): return result -with open('README.md', 'r') as f: +with open("README.md", "r") as f: readme = f.read() -dependencies = [ - 'mypy>=0.750', - 'django-stubs>=1.3.0', - 'typing-extensions' -] +dependencies = ["mypy>=0.750,<0.780", "django-stubs>=1.3.0", "typing-extensions"] setup( name="djangorestframework-stubs", version="1.2.0", - description='PEP-484 stubs for django-rest-framework', + description="PEP-484 stubs for django-rest-framework", long_description=readme, - long_description_content_type='text/markdown', + long_description_content_type="text/markdown", url="https://github.com/typeddjango/djangorestframework-stubs", author="Maksim Kurnikov", author_email="maxim.kurnikov@gmail.com", - license='MIT', + license="MIT", install_requires=dependencies, - packages=['rest_framework-stubs', *find_packages(exclude=['scripts'])], - package_data={'rest_framework-stubs': find_stub_files('rest_framework-stubs')}, + packages=["rest_framework-stubs", *find_packages(exclude=["scripts"])], + package_data={"rest_framework-stubs": find_stub_files("rest_framework-stubs")}, classifiers=[ - 'Development Status :: 3 - Alpha', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7' - ] + "Development Status :: 3 - Alpha", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + ], )