mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-05-19 23:09:56 +08:00
Remove psycopg2 from dependencies (#117)
* remove psycopg2 from direct dependencies, only add it in tests * bump to 1.0.1 * fix mypy
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
black
|
black
|
||||||
pytest-mypy-plugins==1.0.3
|
pytest-mypy-plugins==1.0.3
|
||||||
|
psycopg2
|
||||||
flake8
|
flake8
|
||||||
isort==4.3.4
|
isort==4.3.4
|
||||||
-e .
|
-e .
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from collections import defaultdict
|
|||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from typing import TYPE_CHECKING, Dict, Iterator, List, Optional, Tuple, Type
|
from typing import TYPE_CHECKING, Dict, Iterator, List, Optional, Tuple, Type
|
||||||
|
|
||||||
from django.contrib.postgres.fields import ArrayField
|
|
||||||
from django.core.exceptions import FieldError
|
from django.core.exceptions import FieldError
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.fields import AutoField, CharField, Field
|
from django.db.models.fields import AutoField, CharField, Field
|
||||||
@@ -18,6 +17,12 @@ from mypy.types import TypeOfAny
|
|||||||
|
|
||||||
from mypy_django_plugin.lib import helpers
|
from mypy_django_plugin.lib import helpers
|
||||||
|
|
||||||
|
try:
|
||||||
|
from django.contrib.postgres.fields import ArrayField
|
||||||
|
except ImportError:
|
||||||
|
class ArrayField: # type: ignore
|
||||||
|
pass
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from django.apps.registry import Apps # noqa: F401
|
from django.apps.registry import Apps # noqa: F401
|
||||||
from django.conf import LazySettings # noqa: F401
|
from django.conf import LazySettings # noqa: F401
|
||||||
|
|||||||
@@ -24,13 +24,11 @@ dependencies = [
|
|||||||
'mypy>=0.720,<0.730',
|
'mypy>=0.720,<0.730',
|
||||||
'typing-extensions',
|
'typing-extensions',
|
||||||
'django',
|
'django',
|
||||||
# depends on psycopg2 because of Postgres' ArrayField support
|
|
||||||
'psycopg2'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="django-stubs",
|
name="django-stubs",
|
||||||
version="1.0.0",
|
version="1.0.1",
|
||||||
description='Mypy stubs for Django',
|
description='Mypy stubs for Django',
|
||||||
long_description=readme,
|
long_description=readme,
|
||||||
long_description_content_type='text/markdown',
|
long_description_content_type='text/markdown',
|
||||||
|
|||||||
Reference in New Issue
Block a user