feature: Use setuptools entrypoints (#1409)
* Use console_scripts entrypoint for libretimeapi * Use console_scripts entrypoint for playout
This commit is contained in:
parent
ccde6039e7
commit
7384dd7a2f
|
@ -19,8 +19,12 @@ setup(
|
|||
license="AGPLv3",
|
||||
packages=find_packages(),
|
||||
include_package_data=True,
|
||||
scripts=["bin/libretime-api"],
|
||||
python_requires=">=3.6",
|
||||
entry_points={
|
||||
"console_scripts": [
|
||||
"libretime-api=libretimeapi.cli:main",
|
||||
]
|
||||
},
|
||||
install_requires=[
|
||||
"coreapi",
|
||||
"django~=3.0",
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import runpy
|
||||
|
||||
# Run the liquidsoap python module
|
||||
runpy.run_module("liquidsoap")
|
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import runpy
|
||||
|
||||
runpy.run_module("pypo", run_name="__main__")
|
|
@ -45,6 +45,3 @@ def run():
|
|||
print(f"Liquidsoap {liquidsoap_version} using script: {script_path}")
|
||||
exec_args.append("--debug")
|
||||
os.execl(*exec_args)
|
||||
|
||||
|
||||
run()
|
|
@ -15,7 +15,7 @@ import time
|
|||
from datetime import datetime
|
||||
from optparse import OptionParser
|
||||
|
||||
from api_clients import version1 as api_client
|
||||
from api_clients.version1 import AirtimeApiClient as ApiClient
|
||||
from configobj import ConfigObj
|
||||
|
||||
try:
|
||||
|
@ -182,7 +182,7 @@ def get_liquidsoap_version(version_string):
|
|||
return False
|
||||
|
||||
|
||||
def liquidsoap_startup_test():
|
||||
def liquidsoap_startup_test(telnet_lock, ls_host, ls_port):
|
||||
|
||||
liquidsoap_version_string = liquidsoap_get_info(
|
||||
telnet_lock, ls_host, ls_port, logger
|
||||
|
@ -210,7 +210,7 @@ def liquidsoap_startup_test():
|
|||
logger.info("Liquidsoap version string found %s" % liquidsoap_version_string)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def run():
|
||||
logger.info("###########################################")
|
||||
logger.info("# *** pypo *** #")
|
||||
logger.info("# Liquidsoap Scheduled Playout System #")
|
||||
|
@ -224,7 +224,7 @@ if __name__ == "__main__":
|
|||
|
||||
signal.signal(signal.SIGINT, keyboardInterruptHandler)
|
||||
|
||||
api_client = api_client.AirtimeApiClient()
|
||||
api_client = ApiClient()
|
||||
g = Global(api_client)
|
||||
|
||||
while not g.selfcheck():
|
||||
|
@ -244,7 +244,7 @@ if __name__ == "__main__":
|
|||
ls_host = config["pypo"]["ls_host"]
|
||||
ls_port = config["pypo"]["ls_port"]
|
||||
|
||||
liquidsoap_startup_test()
|
||||
liquidsoap_startup_test(telnet_lock, ls_host, ls_port)
|
||||
|
||||
if options.test:
|
||||
g.test_api()
|
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import traceback
|
||||
|
||||
"""
|
||||
|
@ -191,7 +189,7 @@ class Notify:
|
|||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def run():
|
||||
print()
|
||||
print("#########################################")
|
||||
print("# *** pypo *** #")
|
|
@ -24,11 +24,13 @@ setup(
|
|||
"liquidsoap",
|
||||
],
|
||||
package_data={"": ["**/*.liq", "*.cfg", "*.types"]},
|
||||
scripts=[
|
||||
"bin/libretime-playout",
|
||||
"bin/libretime-liquidsoap",
|
||||
"bin/libretime-playout-notify",
|
||||
],
|
||||
entry_points={
|
||||
"console_scripts": [
|
||||
"libretime-playout=pypo.main:run",
|
||||
"libretime-liquidsoap=liquidsoap.main:run",
|
||||
"libretime-playout-notify=pypo.notify.main:run",
|
||||
]
|
||||
},
|
||||
python_requires=">=3.6",
|
||||
install_requires=[
|
||||
f"libretime-api-client @ file://localhost/{here.parent}/api_client#egg=libretime-api-client",
|
||||
|
|
Loading…
Reference in New Issue