39 lines
849 B
Plaintext
Raw Normal View History

2024-11-24 17:03:43 +01:00
#!/usr/bin/env python3
import pathlib
import os
import sys
2024-11-27 21:26:27 +01:00
args = sys.argv[1:]
args_string = " ".join(args)
def install():
os.system("./.venv/bin/python -m pip install -e .")
2024-11-28 03:53:24 +01: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 17:03:43 +01:00
if not pathlib.Path(".venv").exists():
os.system("python3 -m venv .venv")
2024-11-27 21:26:27 +01:00
install()
if "install" in args:
install()
2024-11-24 17:03:43 +01:00
if "build" in sys.argv:
2024-11-28 03:53:24 +01: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 17:03:43 +01:00
2024-11-27 21:26:27 +01:00
if "run" in sys.argv:
os.system("./.venv/bin/yura " + args_string)
2024-11-24 17:03:43 +01:00