setup.py 1.91 KB
Newer Older
Yan Zhaojun's avatar
Yan Zhaojun committed
1
2
3
4
5
6
7
8
9
10
11
12
import setuptools

# 读取README.md作为长描述
with open("README.md", "r") as f:
    long_description = f.read()

# 读取依赖列表requirements.txt
# 忽略#开头或者版本号不明确指定的条目
with open("requirements.txt", "r") as f:
    requirements = [
        req.strip()
        for req in f.readlines()
Yan Zhaojun's avatar
test    
Yan Zhaojun committed
13
        if not req.startswith("#") and req.__contains__("==")
Yan Zhaojun's avatar
Yan Zhaojun committed
14
    ]
Yan Zhaojun's avatar
debug    
Yan Zhaojun committed
15
    
Yan Zhaojun's avatar
Yan Zhaojun committed
16
setuptools.setup(
Yan Zhaojun's avatar
debug    
Yan Zhaojun committed
17
18
    
    name='csst_ifs_sim',  # 包名
Yan Zhaojun's avatar
test    
Yan Zhaojun committed
19
    version="3.0.0",  # 版本号
Yan Zhaojun's avatar
debug    
Yan Zhaojun committed
20
21
22
23
24
    author="Zhaojun Yan",  # 作者
    author_email="zhaojunyan@shao.ac.cn",  # 邮箱
    description="The CSST IFS simulation - prototype",  # 短描述
    long_description=long_description,  # 长描述
    long_description_content_type="text/markdown",  # 长描述类型
Yan Zhaojun's avatar
debug    
Yan Zhaojun committed
25
    url="https://csst-tb.bao.ac.cn/code/csst-sims/csst_ifs_sim/",  # 主页
Yan Zhaojun's avatar
debug    
Yan Zhaojun committed
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
    packages=setuptools.find_packages(where="."),  # 用setuptools工具自动发现带有__init__.py的包
    license="MIT",  # 证书类型
    classifiers=[  # 程序分类, 参考 https://pypi.org/classifiers/
        # How mature is this project?
        #   3 - Alpha
        #   4 - Beta
        #   5 - Production/Stable
        "Development Status :: 3 - Alpha",
        "Intended Audience :: Science/Research",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Programming Language :: Python :: 3",
        "Topic :: Scientific/Engineering :: Physics",
        "Topic :: Scientific/Engineering :: Astronomy",
    ],
    
    include_package_data=True,  # 设置包含随包数据
Yan Zhaojun's avatar
Yan Zhaojun committed
43
    package_data={"": ["LICENSE", "README.md"],
Yan Zhaojun's avatar
test    
Yan Zhaojun committed
44
                  "csst_ifs_sim": ["ifs_so/*", "ifs_data/*"]},
Yan Zhaojun's avatar
debug    
Yan Zhaojun committed
45
46

    # 请注意检查,防止临时文件或其他不必要的文件被提交到仓库,否则会一同安装
Yan Zhaojun's avatar
test    
Yan Zhaojun committed
47
    python_requires=">=3.8",  # Python版本要求
Yan Zhaojun's avatar
Yan Zhaojun committed
48
    install_requires=requirements,
Yan Zhaojun's avatar
debug    
Yan Zhaojun committed
49

Yan Zhaojun's avatar
Yan Zhaojun committed
50
)