Skip to content

Closes #74 #75

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 4 commits into from
Jul 3, 2020
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions rest_framework-stubs/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
HTTP_HEADER_ENCODING: str = ...
ISO_8601: str = ...

default_app_config: str = ...
4 changes: 3 additions & 1 deletion rest_framework-stubs/views.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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]] = ...
Expand All @@ -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: ...
Expand Down
30 changes: 13 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,36 @@ 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)
result.append(file)
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="[email protected]",
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",
],
)