maestral/setup.py

103 lines
2.7 KiB
Python
Raw Normal View History

import sys
import os.path as osp
2018-11-26 20:41:23 +03:00
from setuptools import setup, find_packages
from maestral import __version__, __author__, __url__
2020-03-03 02:19:16 +03:00
from maestral.utils.appdirs import get_runtime_path, get_old_runtime_path
from maestral.config.base import list_configs
2020-03-03 01:57:42 +03:00
# abort install if there are running daemons
2020-02-22 14:26:59 +03:00
running_daemons = []
for config in list_configs():
pid_file = get_runtime_path('maestral', config + '.pid')
old_pid_file = get_old_runtime_path('maestral', config + '.pid')
if osp.exists(pid_file) or osp.exists(old_pid_file):
2020-02-22 14:26:59 +03:00
running_daemons.append(config)
if running_daemons:
sys.stderr.write(f"""
Maestral daemons with the following configs are running:
{', '.join(running_daemons)}
Please stop the daemons before updating to ensure a clean upgrade
of config files and compatibility been the CLI and daemon.
2020-02-22 14:26:59 +03:00
""")
sys.exit(1)
# proceed with actual install
2020-03-02 02:23:53 +03:00
install_requires = [
'atomicwrites',
'bugsnag',
2020-03-19 18:29:42 +03:00
'click>=7.1.1',
'dropbox>=9.4.0, <=9.5.0',
2020-03-02 02:23:53 +03:00
'importlib_metadata;python_version<"3.8"',
'keyring>=19.0.0',
'keyrings.alt>=3.0.0',
'lockfile',
'packaging',
'pathspec',
'Pyro5>=5.7',
'requests',
'rubicon-objc>=0.3.1;sys_platform=="darwin"',
'sdnotify',
'setuptools',
'six>=1.12.0',
2020-03-02 02:23:53 +03:00
'watchdog>=0.9.0',
]
2020-04-03 17:37:34 +03:00
gui_requires = ['maestral-qt==0.6.4']
2020-03-03 02:22:02 +03:00
syslog_requires = ['systemd-python']
2020-03-02 02:23:53 +03:00
# if GUI is installed, always update it as well
2020-03-03 02:22:02 +03:00
try:
2020-03-03 02:26:36 +03:00
import maestral_qt # noqa: F401
2020-03-03 02:22:02 +03:00
except ImportError:
pass
else:
2020-03-02 02:23:53 +03:00
install_requires += gui_requires
2018-12-03 04:42:57 +03:00
setup(
2020-01-29 22:26:57 +03:00
name='maestral',
2019-08-20 14:23:14 +03:00
version=__version__,
2020-01-29 22:26:57 +03:00
description='Open-source Dropbox client for macOS and Linux.',
url=__url__,
2020-02-24 01:38:19 +03:00
author=__author__,
author_email='ss2151@cam.ac.uk',
2020-01-29 22:26:57 +03:00
license='MIT',
long_description=open('README.md').read(),
2019-07-16 15:50:24 +03:00
long_description_content_type='text/markdown',
2018-12-03 04:42:57 +03:00
packages=find_packages(),
package_data={
2020-02-08 01:42:19 +03:00
'maestral': [
'resources/*',
2020-02-21 03:01:58 +03:00
],
},
2020-01-29 22:26:57 +03:00
setup_requires=['wheel'],
2020-03-02 02:23:53 +03:00
install_requires=install_requires,
extras_require={
2020-03-02 02:23:53 +03:00
'gui': gui_requires,
2020-03-03 02:22:02 +03:00
'syslog': syslog_requires,
},
2018-12-03 04:42:57 +03:00
zip_safe=False,
entry_points={
2020-02-21 03:01:58 +03:00
'console_scripts': ['maestral=maestral.cli:main'],
2019-08-14 20:42:11 +03:00
},
2019-02-26 14:46:00 +03:00
python_requires='>=3.6',
2019-08-06 16:25:54 +03:00
classifiers=[
'License :: OSI Approved :: MIT License',
'Operating System :: Unix',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
2019-10-23 23:20:14 +03:00
'Programming Language :: Python :: 3.8',
2019-08-06 16:25:54 +03:00
'Programming Language :: Python :: 3 :: Only',
],
data_files=[
2020-02-17 20:17:13 +03:00
('share/icons/hicolor/512x512/apps', ['maestral/resources/maestral.png'])
],
2019-08-14 20:42:11 +03:00
)