setup.py 2.16 KB
Newer Older
Wei Shoulin's avatar
Wei Shoulin committed
1
import os
Wei Shoulin's avatar
Wei Shoulin committed
2
from distutils.core import setup
Wei Shoulin's avatar
Wei Shoulin committed
3

Wei Shoulin's avatar
Wei Shoulin committed
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
setup_pars = {
    "packages" : [
        'csst_dfs_api',
        'csst_dfs_api.common',
        'csst_dfs_api.cpic',
        'csst_dfs_api.facility',
        'csst_dfs_api.functional',
        'csst_dfs_api.hstdm',
        'csst_dfs_api.ifs',
        'csst_dfs_api.mbi',
        'csst_dfs_api.mci',
        'csst_dfs_api.sls',
    ],
    "package_dir" : {
        'csst_dfs_api' : 'csst_dfs_api',
        'csst_dfs_api.common' : 'csst_dfs_api/common',
        'csst_dfs_api.cpic' : 'csst_dfs_api/cpic',
        'csst_dfs_api.facility' : 'csst_dfs_api/facility',
        'csst_dfs_api.functional' : 'csst_dfs_api/functional',
        'csst_dfs_api.hstdm' : 'csst_dfs_api/hstdm',
        'csst_dfs_api.ifs' : 'csst_dfs_api/ifs',
        'csst_dfs_api.mbi' : 'csst_dfs_api/mbi',
        'csst_dfs_api.mci' : 'csst_dfs_api/mci',
        'csst_dfs_api.sls' : 'csst_dfs_api/sls',
    },
}
def requirements():
    with open("requirements.txt", "r") as f:
        return [
            req.strip()
            for req in f.readlines()
            if not req.startswith("#") and req.__contains__("==")
        ]

def version():
    version = {}
    VERSION_PATH = os.path.join(os.path.dirname(__file__), "csst_dfs_api", "version.py")
    with open(VERSION_PATH, "r") as file:
        exec(file.read(), version)
    return version

setup(
    name="csst_dfs_api",
    version=version["__version__"],
    description="API's to access CSST Data Flow System (DFS)",
    long_description=open('README.md').read(),
    license="MIT",
    python_requires=">=3.7",
    setup_requires=["setuptools_scm"],
    install_requires=requirements(),
    zip_safe=False,
    classifiers=[
        "Development Status :: 4 - Beta",
        "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=False,
    project_urls={
        'Source': 'https://csst-tb.bao.ac.cn/code/csst-dfs/csst-dfs-api',
    },
    **setup_pars
)