#23 Fix errors and flake8
This commit is contained in:
3 files changed
+16
-6
No files matched your search
@@ -11,15 +11,23 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import ast
|
||||
import re
|
||||
from os import path
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
|
||||
PROJECT_DIR = path.abspath(path.dirname(__file__))
|
||||
|
||||
# Read __VERSION__
|
||||
exec(open('./django_migration_linter/constants.py').read())
|
||||
|
||||
def get_version():
|
||||
constants = path.join(PROJECT_DIR, 'django_migration_linter', 'constants.py')
|
||||
_version_re = re.compile(r"__VERSION__\s+=\s+(?P<version>.*)")
|
||||
with open(constants, "r") as f:
|
||||
match = _version_re.search(f.read())
|
||||
version = match.group("version") if match is not None else '"unknown"'
|
||||
return str(ast.literal_eval(version))
|
||||
|
||||
|
||||
|
||||
with open(path.join(PROJECT_DIR, 'README.rst')) as f:
|
||||
@@ -39,7 +47,7 @@ test_requirements = [
|
||||
# noinspection PyUnresolvedReferences
|
||||
setup(
|
||||
name='django-migration-linter',
|
||||
version=__VERSION__,
|
||||
version=get_version(),
|
||||
|
||||
description='Detect backward incompatible migrations for your django project',
|
||||
long_description=long_description,
|
||||
|
||||
Reference in new issue
Block a user