-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathsetup.py
More file actions
101 lines (84 loc) · 2.94 KB
/
setup.py
File metadata and controls
101 lines (84 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/usr/bin/env python
#-*-coding:utf-8-*-
import setuptools
from distutils import ccompiler
import os,sys
import shutil,os
import platform
import io
import os
long_description = ""
try:
if sys.version_info < (3, 0) :
with open('README.md') as f:
long_description = f.read()
else:
with open('README.md', 'r', encoding="utf-8") as f:
long_description = f.read()
# long_description = io.open('README.md', 'r', encoding="utf-8").read()
except Exception as e:
long_description = ""
finally:
pass
# if sys.version_info < (3, 0) and platform.system() == 'Windows':
# long_description = long_description.decode("utf-8").encode("gbk")
# if sys.version_info >= (3, 0) and platform.system() == 'Windows':
# try:
# if isinstance(long_description, unicode):
# tmp=copy.deepcopy(long_description)
# tmp.encode("mbcs")
# except Exception as e:
# long_description = ''
# else:
# pass
# if sys.version_info < (3, 0):
# with open("README.md", "r") as fh:
# long_description = fh.read()
# if platform.system() == 'Windows':
# long_description = long_description.decode("utf8").encode("gbk")
# else:
# with open("README.md", "r", encoding='utf-8') as fh:
# long_description = "".join(fh.readlines())
# #发现了一个有趣的问题:http://www.queasy.me/rbsoaeod.html/questions/43255455/unicode+character+causing+error+with+bdist_wininst+on+python+3+but+not+python+2
# try:
# long_description.encode("mbcs")
# except Exception as e:
# long_description = ''
# else:
# pass
if os.path.isdir("../src"):
if os.path.isdir("src"):
shutil.rmtree("src")
shutil.copytree("../src","src")
extra_compile_args = []
if ccompiler.get_default_compiler() == "msvc":
extra_compile_args.append("/utf-8")
else:
extra_compile_args.append('-std=c++11')
sxtwl_module = setuptools.Extension('_sxtwl',
sources=[
'sxtwl_wrap.cxx',
'src/eph.cpp',
'src/JD.cpp',
'src/SSQ.cpp',
'src/sxtwl.cpp',
'src/day.cpp',
],
include_dirs=["./src"],
extra_compile_args=extra_compile_args
)
setuptools.setup(
name="sxtwl",
version="2.0.7",
author="yuangu",
author_email="seantone@126.com",
description="sxtwl_cpp warpper for python",
long_description=long_description,
long_description_content_type="text/markdown",
license = "BSD",
#package_dir={'src': '../src'},
url="https://github.com/yuangu/sxtwl_cpp",
packages=setuptools.find_packages(),
ext_modules = [sxtwl_module],
py_modules = ["sxtwl"],
)