moved package info to __init__.py

This commit is contained in:
Sam Schott 2019-08-20 12:23:14 +01:00
parent 27e080cf56
commit f07b59b03d
6 changed files with 10 additions and 37 deletions

View File

@ -5,3 +5,6 @@ Created on Wed Oct 31 16:23:13 2018
@author: samschott
"""
__version__ = "0.3.2"
__author__ = "Sam Schott"
__url__ = "https://github.com/SamSchott/maestral"

View File

@ -127,7 +127,9 @@ def log():
def about():
"""Returns the version number and other information."""
import time
from maestral.sync.main import __version__, __author__, __url__
from maestral import __url__
from maestral import __author__
from maestral import __version__
year = time.localtime().tm_year
click.echo("")

View File

@ -12,7 +12,7 @@ import os
from maestral.sync.utils.app_dirs import get_autostart_path
from maestral.sync.utils import is_macos_bundle
from maestral.sync.main import __version__
from maestral import __version__
_root = os.path.abspath(os.path.dirname(__file__))

View File

@ -14,7 +14,7 @@ from distutils.version import LooseVersion
from PyQt5 import QtGui, QtCore, QtWidgets, uic
# maestral modules
from maestral.sync.main import __version__, __author__, __url__
from maestral import __version__, __author__, __url__
from maestral.sync.errors import CONNECTION_ERRORS
from maestral.gui.autostart import AutoStart
from maestral.config.main import CONF

View File

@ -6,10 +6,6 @@ Created on Wed Oct 31 16:23:13 2018
@author: samschott
"""
__version__ = "0.3.2"
__author__ = "Sam Schott"
__url__ = "https://github.com/SamSchott/maestral"
# system imports
import sys
import os

View File

@ -1,6 +1,6 @@
import sys
from setuptools import setup, find_packages
from maestral import __version__
CURRENT_PYTHON = sys.version_info[:2]
REQUIRED_PYTHON = (3, 6)
@ -22,37 +22,9 @@ have pip >= 9.0 and setuptools >= 24.2, then try again:
sys.exit(1)
def get_version(relpath):
"""Read version info from a file without importing it"""
from os.path import dirname, join
if "__file__" not in globals():
# Allow to use function interactively
root = "."
else:
root = dirname(__file__)
# The code below reads text file with unknown encoding in
# in Python2/3 compatible way. Reading this text file
# without specifying encoding will fail in Python 3 on some
# systems (see http://goo.gl/5XmOH). Specifying encoding as
# open() parameter is incompatible with Python 2
# cp437 is the encoding without missing points, safe against:
# UnicodeDecodeError: 'charmap' codec can't decode byte...
for line in open(join(root, relpath), "rb"):
line = line.decode("cp437")
if "__version__" in line:
if '"' in line:
return line.split('"')[1]
elif "'" in line:
return line.split("'")[1]
setup(
name="maestral",
version=get_version("maestral/main.py"),
version=__version__,
description="Open-source Dropbox client for macOS and Linux.",
url="https://github.com/SamSchott/maestral",
author="Sam Schott",