Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

pycama / setup.py @ 812:6d9479323c2c

History | View | Annotate | Download (4.75 KB)

1
#!/usr/bin/env python3
2
from distutils.core import setup
3
import glob
4
import os
5

    
6

    
7

    
8
# The Makefile synchronizes this version number with the master version number in PyCAMA.
9
# do not change this line manually, use 'make sync-version' instead.
10
#
11
__version__="0.10.2"
12

    
13
# setup script for PyCAMA.
14

    
15
with open('README.rst', 'r') as ref:
16
    description = ref.read()
17

    
18
script_list=glob.glob(os.path.join("src", "*.py"))
19
script_list.extend(glob.glob(os.path.join("src", "*.sh")))
20
kill_list = []
21
for n in ('src/joborder.py', 'src/plot_s5p.py'):
22
    try:
23
        idx = script_list.index(n)
24
    except ValueError:
25
        continue
26
    kill_list.append(idx)
27

    
28
for k_idx in sorted(kill_list)[::-1]:
29
    del script_list[k_idx]
30

    
31
cfg_file = glob.glob(os.path.join('cfg', 'S5P_OPER_CFG_MPC_L2_00000000T000000_99999999T999999_*.xml'))
32
cfg_file.append(os.path.join('cfg', 'sentinel_download.sneep.knmi.nl.cfg'))
33
doc_file = glob.glob(os.path.join('doc', 'user_manual', 'Signed', 'MPC-KNMI-CC-0014-MA-PyCAMA_Software_User_Manual-*.pdf'))
34
doc_file.sort()
35
if len(doc_file) == 0:
36
    doc_file = glob.glob(os.path.join('doc', 'user_manual', 'MPC-KNMI-CC-0014-MA-PyCAMA_Software_User_Manual-*.pdf'))
37
    doc_file.sort()
38

    
39
doc_fmt_file = glob.glob(os.path.join('doc', 'output_specification', 'Signed', 'MPC-KNMI-CC-0018-SD-Output_format_specification_for_PyCAMA-*.pdf'))
40
doc_fmt_file.sort()
41
if len(doc_fmt_file) == 0:
42
    doc_fmt_file = glob.glob(os.path.join('doc', 'output_specification', 'MPC-KNMI-CC-0018-SD-Output_format_specification_for_PyCAMA-*.pdf'))
43
    doc_fmt_file.sort()
44

    
45
if len(doc_fmt_file) == 0:
46
    if len(doc_file) == 0:
47
        data_files = [('cfg', cfg_file),
48
                      ('test', [os.path.join('test', 'cases', 'run.sh'),
49
                                os.path.join('test', 'cases', 'generate.sh'),
50
                                os.path.join('test', 'cases', 'SYS-001-000-BASE-OPER', 'run.sh')]),
51
                      ('', ['LICENSE', 'README.html', 'README.rst', 'README.txt', 'requirements.txt'])]
52
    else:
53
        data_files = [('cfg', cfg_file),
54
                      ('doc', [doc_file[-1]]),
55
                      ('test', [os.path.join('test', 'cases', 'run.sh'),
56
                                os.path.join('test', 'cases', 'generate.sh'),
57
                                os.path.join('test', 'cases', 'SYS-001-000-BASE-OPER', 'run.sh')]),
58
                      ('', ['LICENSE', 'README.html', 'README.rst', 'README.txt', 'requirements.txt'])]
59
else:
60
    if len(doc_file) == 0:
61
        data_files = [('cfg', cfg_file),
62
                      ('doc', doc_fmt_file[-1]),
63
                      ('test', [os.path.join('test', 'cases', 'run.sh'),
64
                                os.path.join('test', 'cases', 'generate.sh'),
65
                                os.path.join('test', 'cases', 'SYS-001-000-BASE-OPER', 'run.sh')]),
66
                      ('', ['LICENSE', 'README.html', 'README.rst', 'README.txt', 'requirements.txt'])]
67
    else:
68
        data_files = [('cfg', cfg_file),
69
                      ('doc', [doc_file[-1], doc_fmt_file[-1]]),
70
                      ('test', [os.path.join('test', 'cases', 'run.sh'),
71
                                os.path.join('test', 'cases', 'generate.sh'),
72
                                os.path.join('test', 'cases', 'SYS-001-000-BASE-OPER', 'run.sh')]),
73
                      ('', ['LICENSE', 'README.html', 'README.rst', 'README.txt', 'requirements.txt'])]
74

    
75
setup(name='PyCAMA',
76
      version=__version__,
77
      description="The PyCAMA package",
78
      long_description=description,
79
      author='Maarten Sneep',
80
      author_email='maarten.sneep@knmi.nl',
81
      url='https://dev.knmi.nl/projects/pycama',
82
      classifiers=['Development Status :: 4 - Beta',
83
                   'Intended Audience :: Science/Research',
84
                   'Intended Audience :: Developers',
85
                   'Environment :: Console',
86
                   'Operating System :: MacOS :: MacOS X',
87
                   'Operating System :: POSIX',
88
                   'Operating System :: Unix',
89
                   'Topic :: Scientific/Engineering :: Atmospheric Science',
90
                   'License :: OSI Approved :: BSD License',
91
                   'Natural Language :: English',
92
                   'Programming Language :: Python :: 3 :: Only',],
93
      license="BSD",
94
      packages=['pycama', 'pycama.transform'],
95
      package_dir = {'': 'src'},
96
      package_data={'pycama': ['report_template/*.tex']},
97
      data_files=data_files,
98
      requires=["lxml (>=4.4.0)",
99
                "netCDF4 (>=1.5.0)",
100
                "h5py (>=2.9.0)",
101
                "numpy (>=1.16.6)",
102
                "numexpr (>=2.7.1)",
103
                "isodate (>=0.6.0)"],
104
# These are desirable, but not required for the data extraction.
105
#                "matplotlib (>=1.5.0)",
106
#                "cartopy (>=0.17.0)"],
107
      scripts=script_list,
108
     )