Skip to content

Commit

Permalink
Remove psycopg2 from dependencies (#117)
Browse files Browse the repository at this point in the history
* remove psycopg2 from direct dependencies, only add it in tests

* bump to 1.0.1

* fix mypy
  • Loading branch information
mkurnikov authored Jul 26, 2019
1 parent 735b58e commit 6b21a04
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
black
pytest-mypy-plugins==1.0.3
psycopg2
flake8
isort==4.3.4
-e .
7 changes: 6 additions & 1 deletion mypy_django_plugin/django/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
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
Expand All @@ -18,6 +17,12 @@

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
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ def find_stub_files(name: str) -> List[str]:
'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',
Expand Down

0 comments on commit 6b21a04

Please sign in to comment.