Skip to content

Commit 734cbc8

Browse files
committed
allow 3.6, remove from CI fix a few linting issues
1 parent 02e0288 commit 734cbc8

File tree

9 files changed

+22
-11
lines changed

9 files changed

+22
-11
lines changed

django_enum/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
'EnumFilter'
4848
]
4949

50-
VERSION = (1, 0, 0)
50+
VERSION = (1, 0, 1)
5151

5252
__title__ = 'Django Enum'
5353
__version__ = '.'.join(str(i) for i in VERSION)

django_enum/choices.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ class DjangoEnumPropertiesMeta(ChoicesMeta): # type: ignore
8383
Needs to be strict subclass of same metaclass as Enum to make it to
8484
the ImportError.
8585
"""
86-
def __init__(self, *args, **kwargs): # pylint: disable=W0231
86+
def __init__(cls, *args, **kwargs): # pylint: disable=W0231
8787
raise ImportError(
88-
f'{self.__class__.__name__} requires enum-properties to be '
88+
f'{cls.__class__.__name__} requires enum-properties to be '
8989
f'installed.'
9090
)
9191

django_enum/fields.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
SmallIntegerField,
2828
)
2929

30-
T = TypeVar('T')
30+
T = TypeVar('T') # pylint: disable=C0103
3131

3232

3333
def with_typehint(baseclass: Type[T]) -> Type[T]:
@@ -92,7 +92,7 @@ def _try_coerce(self, value: Any, force: bool = False) -> Union[Choices, Any]:
9292
(self.coerce or force)
9393
and self.enum is not None
9494
and not isinstance(value, self.enum)
95-
):
95+
): # pylint: disable=R0801
9696
try:
9797
value = self.enum(value)
9898
except (TypeError, ValueError):

django_enum/filters.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
"""Support for django-filter"""
2+
23
from typing import Tuple, Type
34

45
from django.db.models import Field as ModelField
56
from django.forms.fields import Field as FormField
67
from django_enum.fields import EnumMixin
78
from django_enum.forms import EnumChoiceField
89

10+
911
try:
1012
from django_filters import ChoiceFilter, Filter, filterset
1113

django_enum/forms.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from django.forms.fields import ChoiceField
77
from django.forms.widgets import Select
88

9-
# pylint: disable=R0801
109

1110
__all__ = ['NonStrictSelect', 'EnumChoiceField']
1211

@@ -125,7 +124,10 @@ def _coerce(self, value: Any) -> Union[Choices, Any]:
125124

126125
if value in self.empty_values:
127126
return self.empty_value
128-
if self.enum is not None and not isinstance(value, self.enum):
127+
if (
128+
self.enum is not None and
129+
not isinstance(value, self.enum) # pylint: disable=R0801
130+
):
129131
try:
130132
value = self.enum(value)
131133
except (TypeError, ValueError):

doc/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ sphinxcontrib-htmlhelp==2.0.0; python_version >= "3.5"
66
sphinxcontrib-jsmath==1.0.1; python_version >= "3.5"
77
sphinxcontrib-qthelp==1.0.3; python_version >= "3.5"
88
sphinxcontrib-serializinghtml==1.1.5; python_version >= "3.5"
9-
django-enum==1.0.0
9+
django-enum==1.0.1

doc/source/changelog.rst

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Change Log
33
==========
44

5+
v1.0.1
6+
======
7+
8+
* Fix dependency issue - allow python 3.6
9+
10+
511
v1.0.0
612
======
713

pyproject.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-enum"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
description = "Full and natural support for enumerations as Django model fields."
55
authors = ["Brian Kohan <[email protected]>"]
66
license = "MIT"
@@ -20,6 +20,7 @@ classifiers = [
2020
"License :: OSI Approved :: MIT License",
2121
"Natural Language :: English",
2222
"Programming Language :: Python",
23+
"Programming Language :: Python :: 3.6",
2324
"Programming Language :: Python :: 3.7",
2425
"Programming Language :: Python :: 3.8",
2526
"Programming Language :: Python :: 3.9",
@@ -38,7 +39,7 @@ packages = [
3839
exclude = ["django_enum/tests"]
3940

4041
[tool.poetry.dependencies]
41-
python = ">=3.7,<4.0"
42+
python = ">=3.6,<4.0"
4243
Django = ">=3.2,<5.0"
4344
enum-properties = {version = "^1.1.1", optional = true}
4445
django-filter = {version = "^21", optional = true}

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ max-branches=15
1616
ignore=tests
1717

1818
[pylint.MESSAGES CONTROL]
19-
disable=R0903
19+
disable=R0903, R0801
2020

2121
[darglint]
2222
# Darglint integrates with flake8

0 commit comments

Comments
 (0)