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