1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 17:24:46 +00:00

better handle import and move version to its own file

This commit is contained in:
deadc0de6
2018-07-17 21:35:34 +02:00
parent 5293acadd4
commit b4e7e775ba
4 changed files with 17 additions and 20 deletions

View File

@@ -5,8 +5,6 @@ Copyright (c) 2017, deadc0de6
import sys
__version__ = '0.17.1'
def main():
import dotdrop.dotdrop

View File

@@ -11,23 +11,13 @@ import subprocess
from docopt import docopt
# local imports
try:
from . import __version__ as VERSION
except ImportError:
errmsg = '''
Dotdrop has been updated to be included in pypi and
the way it needs to be called has slightly changed.
See https://github.com/deadc0de6/dotdrop/wiki/migrate-from-submodule
'''
print(errmsg)
sys.exit(1)
from .logger import Logger
from .templategen import Templategen
from .installer import Installer
from .dotfile import Dotfile
from .config import Cfg
from .utils import *
from dotdrop.version import __version__ as VERSION
from dotdrop.logger import Logger
from dotdrop.templategen import Templategen
from dotdrop.installer import Installer
from dotdrop.dotfile import Dotfile
from dotdrop.config import Cfg
from dotdrop.utils import *
CUR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
LOG = Logger()

6
dotdrop/version.py Normal file
View File

@@ -0,0 +1,6 @@
"""
author: deadc0de6 (https://github.com/deadc0de6)
Copyright (c) 2018, deadc0de6
"""
__version__ = '0.17.1'

View File

@@ -13,7 +13,10 @@ except ImportError:
print('\n[WARNING] pypandoc not found, could not convert \"{}\"\n'.format(readme))
read_readme = lambda f: open(f, 'r').read()
VERSION = dotdrop.__version__
try:
VERSION = open('dotdrop/version.py', "rt").read()
except:
raise('cannot find version module')
REQUIRES_PYTHON = '>=3'
setup(