39 lines
847 B
Plaintext
Raw Normal View History

2024-11-24 16:03:43 +00:00
#!/usr/bin/env python3
2024-12-01 08:00:25 +00:00
import os
import pathlib
2024-11-24 16:03:43 +00:00
import sys
2024-11-27 20:26:27 +00:00
args = sys.argv[1:]
args_string = " ".join(args)
2024-12-01 08:00:25 +00:00
2024-11-27 20:26:27 +00:00
def install():
os.system("./.venv/bin/python -m pip install -e .")
2024-12-01 08:00:25 +00:00
2024-11-28 02:53:24 +00:00
def build():
os.system("./.venv/bin/python -m pip install build")
os.system("rm -r dist")
os.system("./.venv/bin/python -m build .")
os.system("./.venv/bin/python -m pip install black")
os.system("./.venv/bin/python -m black .")
2024-11-24 16:03:43 +00:00
if not pathlib.Path(".venv").exists():
os.system("python3 -m venv .venv")
2024-11-27 20:26:27 +00:00
install()
if "install" in args:
install()
2024-11-24 16:03:43 +00:00
if "build" in sys.argv:
2024-11-28 02:53:24 +00:00
build()
if "publish" in sys.argv:
build()
os.system("./.venv/bin/python -m pip install twine")
os.system("./.venv/bin/python -m twine upload --repository gitea dist/*")
2024-11-24 16:03:43 +00:00
2024-11-27 20:26:27 +00:00
if "run" in sys.argv:
os.system("./.venv/bin/yura " + args_string)