push up building

This commit is contained in:
shenjack 2023-01-20 18:31:05 +08:00
parent cc5840bef4
commit 1d25c0060b
7 changed files with 39 additions and 18 deletions

View File

@ -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)

View File

@ -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))