From abdfd2e995740da0171732a41374ddf509af707b Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:23:36 +0900 Subject: [PATCH] feat: pack licenses into tarball (WIP) --- {licenses => docs/licenses}/PyGObject/COPYING | 0 {licenses => docs/licenses}/Python/LICENSE | 0 {licenses => docs/licenses}/dayzquery/LICENSE | 0 {licenses => docs/licenses}/packaging/LICENSE | 0 {licenses => docs/licenses}/psutil/LICENSE | 0 {licenses => docs/licenses}/python-a2s/LICENSE | 0 {licenses => docs/licenses}/requests/LICENSE | 0 scripts/release.py | 18 ++++++++++++++++-- 8 files changed, 16 insertions(+), 2 deletions(-) rename {licenses => docs/licenses}/PyGObject/COPYING (100%) rename {licenses => docs/licenses}/Python/LICENSE (100%) rename {licenses => docs/licenses}/dayzquery/LICENSE (100%) rename {licenses => docs/licenses}/packaging/LICENSE (100%) rename {licenses => docs/licenses}/psutil/LICENSE (100%) rename {licenses => docs/licenses}/python-a2s/LICENSE (100%) rename {licenses => docs/licenses}/requests/LICENSE (100%) diff --git a/licenses/PyGObject/COPYING b/docs/licenses/PyGObject/COPYING similarity index 100% rename from licenses/PyGObject/COPYING rename to docs/licenses/PyGObject/COPYING diff --git a/licenses/Python/LICENSE b/docs/licenses/Python/LICENSE similarity index 100% rename from licenses/Python/LICENSE rename to docs/licenses/Python/LICENSE diff --git a/licenses/dayzquery/LICENSE b/docs/licenses/dayzquery/LICENSE similarity index 100% rename from licenses/dayzquery/LICENSE rename to docs/licenses/dayzquery/LICENSE diff --git a/licenses/packaging/LICENSE b/docs/licenses/packaging/LICENSE similarity index 100% rename from licenses/packaging/LICENSE rename to docs/licenses/packaging/LICENSE diff --git a/licenses/psutil/LICENSE b/docs/licenses/psutil/LICENSE similarity index 100% rename from licenses/psutil/LICENSE rename to docs/licenses/psutil/LICENSE diff --git a/licenses/python-a2s/LICENSE b/docs/licenses/python-a2s/LICENSE similarity index 100% rename from licenses/python-a2s/LICENSE rename to docs/licenses/python-a2s/LICENSE diff --git a/licenses/requests/LICENSE b/docs/licenses/requests/LICENSE similarity index 100% rename from licenses/requests/LICENSE rename to docs/licenses/requests/LICENSE diff --git a/scripts/release.py b/scripts/release.py index ee44a89..42d716f 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -62,14 +62,28 @@ if proc.returncode == 0: tarpath = output.joinpath(tarname) with tarfile.open(tarpath, "w:gz") as tar: info = tar.gettarinfo(subfolder) + info.type = tarfile.DIRTYPE info.uname = appname info.name = appname - with open(subfolder, "rb") as f: - tar.addfile(info, f) + #with open(subfolder, "rb") as f: + # tar.add(info, f) + + tar.add(subfolder, arcname="dzgui") + + #for file in subfolder.iterdir(): + # info = tar.gettarinfo(file) + # info.uname = appname + # info.name = appname + # with open(file, "rb") as f: + # tar.addfile(info, f) print(f"Wrote tarfile to '{tarpath}'") proc = subprocess.run([release_exe, "-v"], capture_output=True, text=True) assert proc.stdout.rstrip() == version release_exe.unlink() +license_file.unlink() +subfolder.rmdir() Path(wheel).unlink() + +# TODO: clean up staging directory