From b3c862388063c32b4973cac8ca8ab3885770c47f Mon Sep 17 00:00:00 2001 From: krypton-byte Date: Sat, 26 Oct 2024 19:53:34 +0700 Subject: [PATCH] chore: remove unused file --- goneonize/{build.py => __main__.py} | 4 +++ install.py | 39 ----------------------------- pyproject.toml | 3 ++- 3 files changed, 6 insertions(+), 40 deletions(-) rename goneonize/{build.py => __main__.py} (97%) delete mode 100644 install.py diff --git a/goneonize/build.py b/goneonize/__main__.py similarity index 97% rename from goneonize/build.py rename to goneonize/__main__.py index 9e4a2d1..5df5c2a 100644 --- a/goneonize/build.py +++ b/goneonize/__main__.py @@ -115,6 +115,7 @@ def build(): args = argparse.ArgumentParser() sub = args.add_subparsers(dest="build", required=True) sub.add_parser("goneonize") + # arg.add_argument("--out", type=str, default=os.path.dirname(cwd) + "/neonize/") sub.add_parser("proto") sub.add_parser("all") parse = args.parse_args() @@ -159,3 +160,6 @@ def build_android(): # env=os.environ.update({"build_neonize": "1"}), # shell=os.name == "nt", # ) + +if __name__ == '__main__': + build() \ No newline at end of file diff --git a/install.py b/install.py deleted file mode 100644 index c42e65b..0000000 --- a/install.py +++ /dev/null @@ -1,39 +0,0 @@ -from io import BytesIO -from pathlib import Path -from tqdm import tqdm -from neonize.download import UnsupportedPlatform, generated_name, __download -import importlib.metadata -import os, requests -import zipfile - - -def go_build(): - temp = os.mkdir("tmp") - version = importlib.metadata.version("neonize") - content = requests.get( - f"https://codeload.github.com/krypton-byte/neonize/zip/refs/tags/{version}" - ).content - zip_obj = zipfile.ZipFile(BytesIO(content)) - for file in zip_obj.namelist(): - if file.startswith(f"neonize-{version}/goneonize"): - zip_obj.extractall("tmp") - - -def __download(url: str, fname: str, chunk_size=1024): - resp = requests.get(url, stream=True) - if resp.status_code != 200: - resp.close() - raise UnsupportedPlatform(generated_name()) - total = int(resp.headers.get("content-length", 0)) - with open(fname, "wb") as file, tqdm( - desc=Path(fname).name, - total=total, - unit="iB", - unit_scale=True, - unit_divisor=1024, - ) as bar: - for data in resp.iter_content(chunk_size=chunk_size): - size = file.write(data) - bar.update(size) - bar.n = total - bar.close() diff --git a/pyproject.toml b/pyproject.toml index 1c48c04..b6289b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,6 +35,7 @@ tqdm = "^4.66.1" httpx = "^0.27.2" aiomonitor = "^0.7.0" +setuptools = "^75.2.0" [tool.mypy] exclude = [ "_pb2.py" @@ -61,5 +62,5 @@ build-backend = "poetry.core.masonry.api" [tool.poetry.scripts] docsbuild = "docs.build:build" -build = "goneonize.build:build" +build = "goneonize.__main__:build" version = "goneonize.build:set_version"