Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
T
timp-pcbcam
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Clownce Deng
timp-pcbcam
Commits
a3c73dac
Commit
a3c73dac
authored
Jun 13, 2022
by
Clownce Deng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: setup
parent
54deeadd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
19 deletions
+25
-19
setup.py
setup.py
+20
-19
test.py
study/test.py
+5
-0
No files found.
setup.py
View file @
a3c73dac
...
@@ -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
)
)
study/test.py
0 → 100644
View file @
a3c73dac
from
timp.pcbcam
import
PcbCamUtil
as
UT
if
__name__
==
"__main__"
:
a
=
UT
.
formatNumber
(
12.135456789
,
2
)
print
(
a
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment