separate main package and cli

This commit is contained in:
Zen 2021-05-14 07:16:54 +03:00
parent 5f340af3aa
commit 287ac21841
4 changed files with 22 additions and 2 deletions

View file

@ -1,6 +1,6 @@
#!/usr/bin/env python3
if __name__ == "__main__":
from av1an.__main__ import main
from cli.__main__ import main
main()

1
cli/__init__.py Normal file
View file

@ -0,0 +1 @@

19
cli/__main__.py Normal file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env python3
from av1an.arg_parse import Args
from av1an.manager import Manager
from av1an.startup.setup import startup_check
def main():
"""
Running Av1an CLI
"""
parser = Args()
project = parser.get_project()
startup_check(project)
manager = Manager.Main(project)
manager.run()
if __name__ == "__main__":
main()

View file

@ -49,7 +49,7 @@ setuptools.setup(
py_modules=["av1an"],
rust_extensions=[RustExtension("av1an.av1an", "Cargo.toml", binding=Binding.PyO3)],
include_package_data=True,
entry_points={"console_scripts": ["av1an=av1an:main"]},
entry_points={"console_scripts": ["av1an=cli:main"]},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",