Skip to content

Commit

Permalink
Merge pull request #129 from lukasbindreiter/master
Browse files Browse the repository at this point in the history
Infer version dynamically from installed pip package
  • Loading branch information
gforcada committed Nov 24, 2022
2 parents 1a4f33a + 8200cf6 commit 4bed554
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion flake8_isort.py
Expand Up @@ -5,11 +5,19 @@
from pathlib import Path

import isort
from pkg_resources import DistributionNotFound, get_distribution


def _version():
try:
return get_distribution('flake8_isort').version
except DistributionNotFound:
return 'dev' # for local development if package is not installed yet


class Flake8IsortBase:
name = 'flake8_isort'
version = '5.0.1'
version = _version()
isort_unsorted = 'I001 isort found an import in the wrong position'
no_config_msg = 'I002 no configuration found (.isort.cfg or [isort] in configs)'
isort_blank_req = 'I003 isort expected 1 blank line in imports, found 0'
Expand Down

0 comments on commit 4bed554

Please sign in to comment.