-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.py
51 lines (41 loc) · 1.6 KB
/
setup.py
1
2
3
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
import distutils.cmd
import os
from setuptools import find_packages, setup
from e3sm_to_cmip import __version__
class CleanCommand(distutils.cmd.Command):
"""
Our custom command to clean out junk files.
"""
description = "Cleans out junk files we don't want in the repo"
user_options = [] # type: ignore
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
cmd_list = dict(
DS_Store="find . -name .DS_Store -print0 | xargs -0 rm -f;",
pyc="find . -name '*.pyc' -exec rm -rf {} \;", # noqa: W605
empty_dirs="find ./pages/ -type d -empty -delete;",
build_dirs="find . -name build -print0 | xargs -0 rm -rf;",
dist_dirs="find . -name dist -print0 | xargs -0 rm -rf;",
egg_dirs="find . -name *.egg-info -print0 | xargs -0 rm -rf;",
)
for _, cmd in cmd_list.items():
os.system(cmd)
setup(
name="e3sm_to_cmip",
version=__version__,
author="Sterling Baldwin, Tom Vo, Chengzhu (Jill) Zhang, Anthony Bartoletti",
author_email="[email protected], [email protected]",
description="Transform E3SM model data output into cmip6 compatable data "
"using the Climate Model Output Rewriter.",
entry_points={"console_scripts": ["e3sm_to_cmip = e3sm_to_cmip.__main__:main"]},
packages=find_packages(include=["e3sm_to_cmip", "e3sm_to_cmip.*"]),
package_dir={"e3sm_to_cmip": "e3sm_to_cmip"},
package_data={"e3sm_to_cmip": ["LICENSE"]},
include_package_data=True,
cmdclass={
"clean": CleanCommand,
},
)