mirror of
https://github.com/samschott/maestral.git
synced 2024-09-22 11:27:35 +03:00
make systemd support an optional extra
only install sdnotify and systemd-python when the "systemd" extra is requested
This commit is contained in:
parent
882d1e8f17
commit
a9f4fbd8e0
@ -42,12 +42,17 @@ IS_NOTIFY = os.getenv("NOTIFY_SOCKET", "") # set by systemd
|
||||
IS_SYSTEMD = os.getenv("INVOCATION_ID", "") # set by systemd
|
||||
|
||||
if IS_SYSTEMD:
|
||||
from systemd import journal
|
||||
try:
|
||||
from systemd import journal
|
||||
except ImportError:
|
||||
IS_SYSTEMD = False
|
||||
|
||||
if IS_NOTIFY:
|
||||
import sdnotify
|
||||
system_notifier = sdnotify.SystemdNotifier()
|
||||
print("running under systemd as type=notify")
|
||||
try:
|
||||
import sdnotify
|
||||
system_notifier = sdnotify.SystemdNotifier()
|
||||
except ImportError:
|
||||
IS_NOTIFY = False
|
||||
|
||||
# ========================================================================================
|
||||
# Logging setup
|
||||
|
@ -7,5 +7,5 @@ u-msgpack-python
|
||||
keyring>=19.0.0
|
||||
keyrings.alt>=3.0.0
|
||||
Pyro4
|
||||
systemd-python; platform_system == 'Linux'
|
||||
sdnotify; platform_system == 'Linux'
|
||||
systemd-python
|
||||
sdnotify
|
5
setup.py
5
setup.py
@ -56,9 +56,10 @@ setup(
|
||||
"requests",
|
||||
"u-msgpack-python",
|
||||
"watchdog",
|
||||
"systemd-python; platform_system == 'Linux'",
|
||||
"sdnotify; platform_system == 'Linux'",
|
||||
],
|
||||
extras_require={
|
||||
"systemd": ["systemd-python", "sdnotify"],
|
||||
},
|
||||
zip_safe=False,
|
||||
entry_points={
|
||||
"console_scripts": ["maestral=maestral.cli:main"],
|
||||
|
Loading…
Reference in New Issue
Block a user