mirror of
https://github.com/Hopiu/wagtail-modeltranslation.git
synced 2026-05-04 13:34:45 +00:00
the import is not needed - bad PyCharm!
This commit is contained in:
parent
be57e57077
commit
eac95ec38a
1 changed files with 2 additions and 2 deletions
4
setup.py
4
setup.py
|
|
@ -1,17 +1,17 @@
|
|||
#!/usr/bin/env python
|
||||
import re
|
||||
from builtins import RuntimeError
|
||||
|
||||
import os
|
||||
from setuptools import setup
|
||||
|
||||
|
||||
def get_version(*file_paths):
|
||||
filename = os.path.join(os.path.dirname(__file__), *file_paths)
|
||||
version_file = open(filename).read()
|
||||
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
|
||||
if version_match:
|
||||
return version_match.group(1)
|
||||
raise RuntimeError('Unable to find version string.')
|
||||
raise RuntimeError('Please assure that the package version is defined as "__version__ = x.x.x" in ' + filename)
|
||||
|
||||
|
||||
version = get_version("wagtail_modeltranslation", "__init__.py")
|
||||
|
|
|
|||
Loading…
Reference in a new issue