update setup [page skip]
This commit is contained in:
parent
03d46c7043
commit
281e5df555
@ -7,6 +7,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
import warnings
|
import warnings
|
||||||
|
import traceback
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
from setuptools_rust import Binding, RustExtension
|
from setuptools_rust import Binding, RustExtension
|
||||||
|
|
||||||
@ -28,7 +29,7 @@ setup(
|
|||||||
)
|
)
|
||||||
|
|
||||||
lib_path = '../lib'
|
lib_path = '../lib'
|
||||||
build_path = './build'
|
build_path = 'build'
|
||||||
|
|
||||||
if 'clean' in sys.argv:
|
if 'clean' in sys.argv:
|
||||||
shutil.rmtree(lib_path, ignore_errors=True)
|
shutil.rmtree(lib_path, ignore_errors=True)
|
||||||
@ -42,6 +43,11 @@ if not os.path.exists(lib_path):
|
|||||||
builds = os.listdir(build_path)
|
builds = os.listdir(build_path)
|
||||||
print(os.path.abspath('.'))
|
print(os.path.abspath('.'))
|
||||||
|
|
||||||
|
try:
|
||||||
|
shutil.copy('src/__init__.py', os.path.join(lib_path, '__init__.py'))
|
||||||
|
except shutil.SameFileError:
|
||||||
|
traceback.print_exc()
|
||||||
|
|
||||||
for build_dir in builds:
|
for build_dir in builds:
|
||||||
if not os.path.exists(os.path.join(build_path, build_dir, package_path)):
|
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}')
|
warnings.warn(f'package not found at {build_path}/{build_dir}')
|
||||||
@ -50,6 +56,14 @@ for build_dir in builds:
|
|||||||
# file_name = os.path.join(lib_path, file.replace(package_path, f'{package_path}.{DR_runtime.DR_Rust_version}'))
|
# file_name = os.path.join(lib_path, file.replace(package_path, f'{package_path}.{DR_runtime.DR_Rust_version}'))
|
||||||
file_name = os.path.join(lib_path, file)
|
file_name = os.path.join(lib_path, file)
|
||||||
shutil.rmtree(file_name, ignore_errors=True)
|
shutil.rmtree(file_name, ignore_errors=True)
|
||||||
shutil.copy(os.path.join(build_path, build_dir, package_path, file), file_name)
|
try:
|
||||||
|
shutil.copy(os.path.join(build_path, build_dir, package_path, file), file_name)
|
||||||
|
except (shutil.SameFileError, PermissionError):
|
||||||
|
# print(os.path.exists(os.path))
|
||||||
|
print(os.listdir(lib_path))
|
||||||
|
traceback.print_exc()
|
||||||
|
continue
|
||||||
|
os.remove(file_name)
|
||||||
|
shutil.copy(os.path.join(build_path, build_dir, package_path, file), file_name)
|
||||||
# shutil.rmtree(os.path.join(build_path, build_dir))
|
# shutil.rmtree(os.path.join(build_path, build_dir))
|
||||||
# print(os.path.join(build_path, build_dir))
|
# print(os.path.join(build_path, build_dir))
|
||||||
|
11
libs/Difficult_Rocket_rs/src/src/__init__.py
Normal file
11
libs/Difficult_Rocket_rs/src/src/__init__.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# -------------------------------
|
||||||
|
# Difficult Rocket
|
||||||
|
# Copyright © 2021-2022 by shenjackyuanjie 3695888@qq.com
|
||||||
|
# All rights reserved
|
||||||
|
# -------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if not TYPE_CHECKING:
|
||||||
|
from .Difficult_Rocket_rs import *
|
Loading…
Reference in New Issue
Block a user