Commit a3c73dac authored by Clownce Deng's avatar Clownce Deng

fix: setup

parent 54deeadd
...@@ -13,7 +13,6 @@ NAMESPACE = "timp" ...@@ -13,7 +13,6 @@ NAMESPACE = "timp"
PROJECT = "pcbcam" PROJECT = "pcbcam"
VERSION = "1.0.0" VERSION = "1.0.0"
DESCRIPTION = "pcbcam lib" DESCRIPTION = "pcbcam lib"
# ---- END OF PROJECT SETTING ----# # ---- END OF PROJECT SETTING ----#
...@@ -35,9 +34,11 @@ class CMakeBuild(build_ext): ...@@ -35,9 +34,11 @@ class CMakeBuild(build_ext):
if ext.namespace: if ext.namespace:
py_build_dir = py_build_dir.joinpath(ext.namespace) py_build_dir = py_build_dir.joinpath(ext.namespace)
py_build_dir = py_build_dir.joinpath(ext.name) py_build_dir = py_build_dir.joinpath(ext.name)
if not py_build_dir.exists():
os.makedirs(py_build_dir)
# c++源码所在路径,在不同系统下使用不同的编译目录 # c++源码所在路径,在不同系统下使用不同的编译目录
build_temp = Path(ext.sourcedir).joinpath('../build') build_temp = Path(ext.sourcedir).parent.joinpath('build')
if not build_temp.exists(): if not build_temp.exists():
os.makedirs(build_temp) os.makedirs(build_temp)
...@@ -57,23 +58,23 @@ class CMakeBuild(build_ext): ...@@ -57,23 +58,23 @@ class CMakeBuild(build_ext):
subprocess.check_call(['ninja', 'install'], cwd=build_temp) subprocess.check_call(['ninja', 'install'], cwd=build_temp)
# 拷贝动态库至打包目录 # 拷贝动态库至打包目录
# libray_files = [] libray_files = []
# if platform.system() == "Windows": if platform.system() == "Windows":
# libray_files.append("{}.pyd".format(ext.name)) libray_files.append("{}.pyd".format(ext.name))
# libray_files.append("lib{}.dll".format(ext.name)) libray_files.append("lib{}.dll".format(ext.name))
# elif platform.system() == "Darwin": elif platform.system() == "Darwin":
# libray_files.append("{}.so".format(ext.name)) libray_files.append("{}.so".format(ext.name))
# libray_files.append("lib{}.dylib".format(ext.name)) libray_files.append("lib{}.dylib".format(ext.name))
# else: else:
# libray_files.append("{}.so".format(ext.name)) libray_files.append("{}.so".format(ext.name))
# libray_files.append("lib{}.so".format(ext.name)) libray_files.append("lib{}.so".format(ext.name))
# print('copying dynamic library file') print('copying dynamic library file')
# pak_dir = Path(ext.sourcedir).parent.joinpath(ext.namespace, ext.name) # pak_dir = Path(ext.sourcedir).parent.joinpath(ext.namespace, ext.name)
# for lib in libray_files: for lib in libray_files:
# src_file = pak_dir.joinpath(lib) src_file = build_temp.joinpath(lib)
# print(f'copying {src_file} -> {py_build_dir}') print(f'copying {src_file} -> {py_build_dir}')
# shutil.copy(src_file, py_build_dir) shutil.copy(src_file, py_build_dir)
def get_qt_dir(self) -> str: def get_qt_dir(self) -> str:
""" 获取QT路径 """ """ 获取QT路径 """
...@@ -135,5 +136,5 @@ setup( ...@@ -135,5 +136,5 @@ setup(
tests_require=[], tests_require=[],
extras_require={}, extras_require={},
dependency_links=["http://nexus.topibd.net/repository/pypi-public/simple"], dependency_links=["http://nexus.topibd.net/repository/pypi-public/simple"],
zip_safe=False, zip_safe=False
) )
from timp.pcbcam import PcbCamUtil as UT
if __name__ == "__main__":
a = UT.formatNumber(12.135456789, 2)
print(a)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment