Skip to content

Commit

Permalink
fix: remove flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
d9pouces authored and peymanslh committed Dec 13, 2023
1 parent 9cd3e77 commit d3a7144
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions pipeline/__init__.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
PackageNotFoundError = None
DistributionNotFound = None
try:
from importlib.metadata import PackageNotFoundError
from importlib.metadata import version as get_version
except ImportError:
get_version = None
try:
from pkg_resources import DistributionNotFound as PackageNotFoundError
from pkg_resources import get_distribution


def get_version(x):
return get_distribution(x).version
except ImportError:
get_version = None
PackageNotFoundError = None

Check warning on line 8 in pipeline/__init__.py

View check run for this annotation

Codecov / codecov/patch

pipeline/__init__.py#L6-L8

Added lines #L6 - L8 were not covered by tests
get_distribution = None
if get_version is None:
try:
from pkg_resources import DistributionNotFound, get_distribution

Check warning on line 11 in pipeline/__init__.py

View check run for this annotation

Codecov / codecov/patch

pipeline/__init__.py#L10-L11

Added lines #L10 - L11 were not covered by tests

def get_version(x):
return get_distribution(x).version
except ImportError:
get_version = None
DistributionNotFound = None
get_distribution = None

Check warning on line 18 in pipeline/__init__.py

View check run for this annotation

Codecov / codecov/patch

pipeline/__init__.py#L13-L18

Added lines #L13 - L18 were not covered by tests

__version__ = None
if get_version is not None:
try:
__version__ = get_version("django-pipeline")
except PackageNotFoundError:
pass
except DistributionNotFound:
pass

Check warning on line 27 in pipeline/__init__.py

View check run for this annotation

Codecov / codecov/patch

pipeline/__init__.py#L24-L27

Added lines #L24 - L27 were not covered by tests

0 comments on commit d3a7144

Please sign in to comment.