mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 14:42:54 +01:00
feat: parse toml entrypoint
This commit is contained in:
1 parent
48cb062d90
commit
5776f4c49f
2 files changed
+17
-6
No files matched your search
@@ -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]
|
||||||
+4
-6
@@ -5,10 +5,10 @@ import tarfile
|
|||||||
|
|
||||||
from pathlib import Path
|
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
|
from prebuild import get_pyapp, rebuild_cpython
|
||||||
|
|
||||||
|
|
||||||
root = Path(__file__).resolve().parents[1]
|
root = Path(__file__).resolve().parents[1]
|
||||||
output = root.joinpath("dist")
|
output = root.joinpath("dist")
|
||||||
build_dir = root.joinpath("build")
|
build_dir = root.joinpath("build")
|
||||||
@@ -31,9 +31,7 @@ packaged_version = rebuild_cpython()
|
|||||||
assert packaged_version == version
|
assert packaged_version == version
|
||||||
cpython = build_dir.joinpath("airgapped.tar.gz")
|
cpython = build_dir.joinpath("airgapped.tar.gz")
|
||||||
|
|
||||||
# TODO: parse pyproject directly
|
entrypoint = get_entrypoint()
|
||||||
|
|
||||||
entrypoint = "dzgui.main:main"
|
|
||||||
env = os.environ
|
env = os.environ
|
||||||
env["PYAPP_PROJECT_VERSION"] = version
|
env["PYAPP_PROJECT_VERSION"] = version
|
||||||
env["PYAPP_PROJECT_NAME"] = appname
|
env["PYAPP_PROJECT_NAME"] = appname
|
||||||
@@ -51,7 +49,7 @@ env["PYAPP_DISTRIBUTION_PYTHON_PATH"] = "python/bin/python3"
|
|||||||
subfolder = output.joinpath(stem)
|
subfolder = output.joinpath(stem)
|
||||||
subfolder.mkdir(parents=True)
|
subfolder.mkdir(parents=True)
|
||||||
|
|
||||||
combined_licenses = concat_licenses()
|
combined_licenses = concat_license()
|
||||||
license_file = subfolder.joinpath("LICENSE")
|
license_file = subfolder.joinpath("LICENSE")
|
||||||
license_file.write_text(combined_licenses)
|
license_file.write_text(combined_licenses)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user