Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/django_filters/__init__.py: 86%

16 statements  

« prev     ^ index     » next       coverage.py v6.4.4, created at 2023-07-17 14:22 -0600

1# flake8: noqa 

2import pkgutil 

3 

4from .filters import * 

5from .filterset import FilterSet 

6 

7# We make the `rest_framework` module available without an additional import. 

8# If DRF is not installed, no-op. 

9if pkgutil.find_loader("rest_framework") is not None: 9 ↛ 11line 9 didn't jump to line 11, because the condition on line 9 was never false

10 from . import rest_framework 

11del pkgutil 

12 

13__version__ = "22.1" 

14 

15 

16def parse_version(version): 

17 """ 

18 '0.1.2.dev1' -> (0, 1, 2, 'dev1') 

19 '0.1.2' -> (0, 1, 2) 

20 """ 

21 v = version.split(".") 

22 ret = [] 

23 for p in v: 

24 if p.isdigit(): 24 ↛ 27line 24 didn't jump to line 27, because the condition on line 24 was never false

25 ret.append(int(p)) 

26 else: 

27 ret.append(p) 

28 return tuple(ret) 

29 

30 

31VERSION = parse_version(__version__)