mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-06 12:14:28 +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
|
||||
pytest-mypy-plugins==1.0.3
|
||||
psycopg2
|
||||
flake8
|
||||
isort==4.3.4
|
||||
-e .
|
||||
|
||||
@@ -3,7 +3,6 @@ from collections import defaultdict
|
||||
from contextlib import contextmanager
|
||||
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.db.models.base import Model
|
||||
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
|
||||
|
||||
try:
|
||||
from django.contrib.postgres.fields import ArrayField
|
||||
except ImportError:
|
||||
class ArrayField: # type: ignore
|
||||
pass
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from django.apps.registry import Apps # noqa: F401
|
||||
from django.conf import LazySettings # noqa: F401
|
||||
|
||||
4
setup.py
4
setup.py
@@ -24,13 +24,11 @@ dependencies = [
|
||||
'mypy>=0.720,<0.730',
|
||||
'typing-extensions',
|
||||
'django',
|
||||
# depends on psycopg2 because of Postgres' ArrayField support
|
||||
'psycopg2'
|
||||
]
|
||||
|
||||
setup(
|
||||
name="django-stubs",
|
||||
version="1.0.0",
|
||||
version="1.0.1",
|
||||
description='Mypy stubs for Django',
|
||||
long_description=readme,
|
||||
long_description_content_type='text/markdown',
|
||||
|
||||
Reference in New Issue
Block a user