From 1d25c0060b87e28c5f84a88b64cfd4c32f11078b Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Fri, 20 Jan 2023 18:31:05 +0800 Subject: [PATCH] push up building --- libs/DR-rs/setup.py | 18 --------- .../{DR-rs => Difficult_Rocket_rs}/Cargo.lock | 0 .../{DR-rs => Difficult_Rocket_rs}/Cargo.toml | 0 .../Difficult_Rocket_rs/__init__.pyi | 0 .../pyproject.toml | 0 libs/Difficult_Rocket_rs/setup.py | 39 +++++++++++++++++++ .../{DR-rs => Difficult_Rocket_rs}/src/lib.rs | 0 7 files changed, 39 insertions(+), 18 deletions(-) delete mode 100644 libs/DR-rs/setup.py rename libs/{DR-rs => Difficult_Rocket_rs}/Cargo.lock (100%) rename libs/{DR-rs => Difficult_Rocket_rs}/Cargo.toml (100%) rename libs/{DR-rs => Difficult_Rocket_rs}/Difficult_Rocket_rs/__init__.pyi (100%) rename libs/{DR-rs => Difficult_Rocket_rs}/pyproject.toml (100%) create mode 100644 libs/Difficult_Rocket_rs/setup.py rename libs/{DR-rs => Difficult_Rocket_rs}/src/lib.rs (100%) diff --git a/libs/DR-rs/setup.py b/libs/DR-rs/setup.py deleted file mode 100644 index a042091..0000000 --- a/libs/DR-rs/setup.py +++ /dev/null @@ -1,18 +0,0 @@ -# ------------------------------- -# Difficult Rocket -# Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com -# All rights reserved -# ------------------------------- -import sys -from setuptools import setup -from setuptools_rust import Binding, RustExtension - -setup( - name='Difficult_Rocket_rs', - version='0.0.0.1', - rust_extensions=[RustExtension("Difficult_Rocket_rs.Difficult_Rocket_rs", binding=Binding.PyO3)], - packages=['Difficult_Rocket_rs'], - zip_safe=False -) - -print(sys.platform) diff --git a/libs/DR-rs/Cargo.lock b/libs/Difficult_Rocket_rs/Cargo.lock similarity index 100% rename from libs/DR-rs/Cargo.lock rename to libs/Difficult_Rocket_rs/Cargo.lock diff --git a/libs/DR-rs/Cargo.toml b/libs/Difficult_Rocket_rs/Cargo.toml similarity index 100% rename from libs/DR-rs/Cargo.toml rename to libs/Difficult_Rocket_rs/Cargo.toml diff --git a/libs/DR-rs/Difficult_Rocket_rs/__init__.pyi b/libs/Difficult_Rocket_rs/Difficult_Rocket_rs/__init__.pyi similarity index 100% rename from libs/DR-rs/Difficult_Rocket_rs/__init__.pyi rename to libs/Difficult_Rocket_rs/Difficult_Rocket_rs/__init__.pyi diff --git a/libs/DR-rs/pyproject.toml b/libs/Difficult_Rocket_rs/pyproject.toml similarity index 100% rename from libs/DR-rs/pyproject.toml rename to libs/Difficult_Rocket_rs/pyproject.toml diff --git a/libs/Difficult_Rocket_rs/setup.py b/libs/Difficult_Rocket_rs/setup.py new file mode 100644 index 0000000..d9950ad --- /dev/null +++ b/libs/Difficult_Rocket_rs/setup.py @@ -0,0 +1,39 @@ +# ------------------------------- +# Difficult Rocket +# Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com +# All rights reserved +# ------------------------------- +import os +import shutil +import warnings +from setuptools import setup +from setuptools_rust import Binding, RustExtension + +package_path = './Difficult_Rocket_rs' + +setup( + name='Difficult_Rocket_rs', + version='0.0.0.1', + rust_extensions=[RustExtension(target="Difficult_Rocket_rs.Difficult_Rocket_rs", + rust_version='2021', + binding=Binding.PyO3)], + packages=[package_path], + zip_safe=False +) + +lib_path = './lib' +build_path = './build' + +if not os.path.exists(lib_path): + os.mkdir(lib_path) + +builds = os.listdir(build_path) + +for build_dir in builds: + if not os.path.exists(os.path.join(build_path, build_dir, package_path)): + warnings.warn(f'package not found at {build_path}/{build_dir}') + continue + for file in os.listdir(os.path.join(build_path, build_dir, package_path)): + shutil.copy(os.path.join(build_path, build_dir, package_path, file), os.path.join(lib_path, file)) + # shutil.rmtree(os.path.join(build_path, build_dir)) + print(os.path.join(build_path, build_dir)) diff --git a/libs/DR-rs/src/lib.rs b/libs/Difficult_Rocket_rs/src/lib.rs similarity index 100% rename from libs/DR-rs/src/lib.rs rename to libs/Difficult_Rocket_rs/src/lib.rs