Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

pycama / setup.py @ 819:a49c7fad4018

History | View | Annotate | Download (4.75 KB)

1 795:bb2e4a7bf89d maarten
#!/usr/bin/env python3
2 182:531d3eb1f915 Maarten
from distutils.core import setup
3
import glob
4
import os
5
6 184:5dd2fef875a1 maarten
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 350:642c4148ac35 Maarten
#
11 819:a49c7fad4018 maarten
__version__="0.10.3"
12 184:5dd2fef875a1 maarten
13 182:531d3eb1f915 Maarten
# setup script for PyCAMA.
14
15 193:a65a4fc057d0 Maarten
with open('README.rst', 'r') as ref:
16 182:531d3eb1f915 Maarten
    description = ref.read()
17
18
script_list=glob.glob(os.path.join("src", "*.py"))
19 797:c9c81809d02b maarten
script_list.extend(glob.glob(os.path.join("src", "*.sh")))
20 182:531d3eb1f915 Maarten
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 193:a65a4fc057d0 Maarten
28 182:531d3eb1f915 Maarten
for k_idx in sorted(kill_list)[::-1]:
29
    del script_list[k_idx]
30
31 270:885198839ad6 Maarten
cfg_file = glob.glob(os.path.join('cfg', 'S5P_OPER_CFG_MPC_L2_00000000T000000_99999999T999999_*.xml'))
32 590:6df143674247 Maarten
cfg_file.append(os.path.join('cfg', 'sentinel_download.sneep.knmi.nl.cfg'))
33 280:735515d23a7c Maarten
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 315:8e7d09d40774 Maarten
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 280:735515d23a7c Maarten
39 385:5bf018c74634 Maarten
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 797:c9c81809d02b maarten
                      ('', ['LICENSE', 'README.html', 'README.rst', 'README.txt', 'requirements.txt'])]
52 385:5bf018c74634 Maarten
    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 797:c9c81809d02b maarten
                      ('', ['LICENSE', 'README.html', 'README.rst', 'README.txt', 'requirements.txt'])]
59 315:8e7d09d40774 Maarten
else:
60 385:5bf018c74634 Maarten
    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 797:c9c81809d02b maarten
                      ('', ['LICENSE', 'README.html', 'README.rst', 'README.txt', 'requirements.txt'])]
67 385:5bf018c74634 Maarten
    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 797:c9c81809d02b maarten
                      ('', ['LICENSE', 'README.html', 'README.rst', 'README.txt', 'requirements.txt'])]
74 182:531d3eb1f915 Maarten
75
setup(name='PyCAMA',
76 184:5dd2fef875a1 maarten
      version=__version__,
77 182:531d3eb1f915 Maarten
      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 795:bb2e4a7bf89d maarten
      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 474:961daa3cd17e Maarten
# These are desirable, but not required for the data extraction.
105
#                "matplotlib (>=1.5.0)",
106 795:bb2e4a7bf89d maarten
#                "cartopy (>=0.17.0)"],
107 182:531d3eb1f915 Maarten
      scripts=script_list,
108
     )