-
Notifications
You must be signed in to change notification settings - Fork 767
/
__init__.py
39 lines (27 loc) · 818 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# flake8: noqa
from importlib import util as importlib_util
from .filters import *
from .filterset import FilterSet, UnknownFieldBehavior
# We make the `rest_framework` module available without an additional import.
# If DRF is not installed, no-op.
if importlib_util.find_spec("rest_framework"):
from . import rest_framework
del importlib_util
__version__ = "24.3"
def parse_version(version):
"""
'0.1.2.dev1' -> (0, 1, 2, 'dev1')
'0.1.2' -> (0, 1, 2)
"""
v = version.split(".")
ret = []
for p in v:
if p.isdigit():
ret.append(int(p))
else:
ret.append(p)
return tuple(ret)
VERSION = parse_version(__version__)
assert VERSION < (25,0), "Remove deprecated code"
class RemovedInDjangoFilter25Warning(DeprecationWarning):
pass