#23 Fix errors and flake8
This commit is contained in:
3 files changed
+16
-6
No files matched your search
@@ -18,4 +18,6 @@ from appdirs import user_cache_dir
|
|||||||
|
|
||||||
__VERSION__ = '0.0.7'
|
__VERSION__ = '0.0.7'
|
||||||
|
|
||||||
DEFAULT_CACHE_PATH = Path(user_cache_dir("django-migration-linter", version=__VERSION__))
|
DEFAULT_CACHE_PATH = Path(
|
||||||
|
user_cache_dir("django-migration-linter", version=__VERSION__)
|
||||||
|
)
|
||||||
@@ -59,4 +59,4 @@ def clean_bytes_to_str(byte_input):
|
|||||||
|
|
||||||
|
|
||||||
def get_default_cache_file(project_name):
|
def get_default_cache_file(project_name):
|
||||||
os.join(DEFAULT_CACHE_PATH, '{0}.pickle'.format(project_name))
|
return os.path.join(DEFAULT_CACHE_PATH, '{0}.pickle'.format(project_name))
|
||||||
@@ -11,15 +11,23 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
import ast
|
||||||
|
import re
|
||||||
from os import path
|
from os import path
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
|
|
||||||
PROJECT_DIR = path.abspath(path.dirname(__file__))
|
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:
|
with open(path.join(PROJECT_DIR, 'README.rst')) as f:
|
||||||
@@ -39,7 +47,7 @@ test_requirements = [
|
|||||||
# noinspection PyUnresolvedReferences
|
# noinspection PyUnresolvedReferences
|
||||||
setup(
|
setup(
|
||||||
name='django-migration-linter',
|
name='django-migration-linter',
|
||||||
version=__VERSION__,
|
version=get_version(),
|
||||||
|
|
||||||
description='Detect backward incompatible migrations for your django project',
|
description='Detect backward incompatible migrations for your django project',
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
|
|||||||
Reference in new issue
Block a user