Skip to content

Commit

Permalink
1、解决python源码打包没有头文件的问题
Browse files Browse the repository at this point in the history
2、增加开源协议
  • Loading branch information
yuangu committed May 1, 2022
1 parent 185032d commit b0944d0
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 12 deletions.
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2017-2022, 元谷
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ sxtwl_cpp是参考[寿星天文历](http://www.nongli.net/sxwnl/)并使用C++实
点击[C#安装及事例文档](doc/如何构建.md)阅读文档

+ #### C语言用户专享文档
注:如有需要显示给其它语言调用的用户,可以使用此版本。目前只提供DLL或者so生成
注:如有需要显示给其它语言调用的用户,可以使用此版本。目前只提供静态库的生成。
另外,导接的接口可参考 c/sxtwl_c.h
点击[C语言安装及事例文档](doc/如何构建.md)阅读文档


Expand Down
1 change: 1 addition & 0 deletions c/sxtwl_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ extern "C"
} sxtwl_Day;


// 注意返回的sxtwl_Day指针,需要使用sxtwl_freeDay释放
CC_EX_DLL sxtwl_Day* sxtwl_after(sxtwl_Day* day, sxtwl_Day* ret, int day_num);
CC_EX_DLL sxtwl_Day* sxtwl_before(sxtwl_Day* day, sxtwl_Day* ret, int day_num);

Expand Down
1 change: 1 addition & 0 deletions python/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include src *.h
15 changes: 4 additions & 11 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,30 +67,23 @@


sxtwl_module = setuptools.Extension('_sxtwl',
include_dirs=[os.path.abspath("./src"),],
sources=[
'sxtwl_wrap.cxx',
'src/eph.cpp',
'src/JD.cpp',
'src/SSQ.cpp',
'src/sxtwl.cpp',
'src/day.cpp',

'src/const.h',
'src/day.h',
'src/eph.h',
'src/JD.h',
'src/SSQ.h',
'src/sxtwl.h',
'src/XL.h'
],
extra_compile_args=extra_compile_args,
include_dirs=["./src"],
extra_compile_args=extra_compile_args

)


setuptools.setup(
name="sxtwl",
version="2.0.4",
version="2.0.5",
author="yuangu",
author_email="[email protected]",
description="sxtwl_cpp warpper for python",
Expand Down

0 comments on commit b0944d0

Please sign in to comment.