mirror of
https://github.com/aclist/dztui.git
synced 2026-08-27 02:07:18 +02:00
feat: parse toml entrypoint
This commit is contained in:
parent
48cb062d90
commit
5776f4c49f
13
scripts/parse_toml.py
Normal file
13
scripts/parse_toml.py
Normal file
@ -0,0 +1,13 @@
|
||||
from pprint import pprint
|
||||
import tomllib
|
||||
from pathlib import Path
|
||||
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
|
||||
def get_entrypoint() -> None:
|
||||
p = root.joinpath("pyproject.toml")
|
||||
with open(p, "rb") as f:
|
||||
t = tomllib.load(f)
|
||||
|
||||
name = t["project"]["name"]
|
||||
return t["project"]["scripts"][name]
|
||||
@ -5,10 +5,10 @@ import tarfile
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from concat_licenses import concat_licenses
|
||||
from concat_licenses import concat_license
|
||||
from parse_toml import get_entrypoint
|
||||
from prebuild import get_pyapp, rebuild_cpython
|
||||
|
||||
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
output = root.joinpath("dist")
|
||||
build_dir = root.joinpath("build")
|
||||
@ -31,9 +31,7 @@ packaged_version = rebuild_cpython()
|
||||
assert packaged_version == version
|
||||
cpython = build_dir.joinpath("airgapped.tar.gz")
|
||||
|
||||
# TODO: parse pyproject directly
|
||||
|
||||
entrypoint = "dzgui.main:main"
|
||||
entrypoint = get_entrypoint()
|
||||
env = os.environ
|
||||
env["PYAPP_PROJECT_VERSION"] = version
|
||||
env["PYAPP_PROJECT_NAME"] = appname
|
||||
@ -51,7 +49,7 @@ env["PYAPP_DISTRIBUTION_PYTHON_PATH"] = "python/bin/python3"
|
||||
subfolder = output.joinpath(stem)
|
||||
subfolder.mkdir(parents=True)
|
||||
|
||||
combined_licenses = concat_licenses()
|
||||
combined_licenses = concat_license()
|
||||
license_file = subfolder.joinpath("LICENSE")
|
||||
license_file.write_text(combined_licenses)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user