maestral/setup.py

58 lines
1.7 KiB
Python
Raw Normal View History

2018-11-26 20:41:23 +03:00
from setuptools import setup, find_packages
2018-12-03 04:42:57 +03:00
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="sisyphosdbx",
version=get_version("sisyphosdbx/main.py"),
description="Open-source Dropbox client for macOS and Linux.",
url="https://github.com/SamSchott/sisyphosdbx",
author="Sam Schott",
author_email="ss2151@cam.ac.uk",
licence="MIT",
long_description=open("README.md").read(),
packages=find_packages(),
package_data={
'sisyphosdbx': [
'gui/*.ui',
'gui/resources/*.icns',
'gui/resources/*.png'
],
},
install_requires=[
"dropbox",
"watchdog",
],
zip_safe=False,
entry_points={
'console_scripts': ['sisyphosdbx=sisyphosdbx.bin.command_line:main'],
}
)