-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
76 lines (57 loc) · 2.29 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
""" Scaffolding for the earthdata-varinfo package
Note: license and classifier list:
https://pypi.org/pypi?%3Aaction=list_classifiers
"""
from typing import List
import io
import pathlib
import os
from setuptools import find_packages, setup
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.resolve()
def parse_dependencies(file_path: str) -> List[str]:
"""Parse a Pip requirements file, and extract the dependencies."""
with open(file_path, 'r') as file_handler:
dependencies = file_handler.read().strip().split('\n')
return dependencies
def get_readme(current_directory: str) -> str:
"""Parse the README.md in the root of the repository, for the long
description of this Python package.
"""
with io.open(
os.path.join(current_directory, 'README.md'), 'r', encoding='utf-8'
) as file_handler:
readme = file_handler.read()
return readme
def get_semantic_version(current_directory: str) -> str:
"""Parse the VERSION file in the root of the repository for the semantic
version number of the version.
"""
with open(os.path.join(current_directory, 'VERSION'), 'r') as file_handler:
semantic_version = file_handler.read().strip()
return semantic_version
setup(
name='earthdata-varinfo',
version=get_semantic_version(CURRENT_DIRECTORY),
author='NASA EOSDIS SDPS Data Services Team',
author_email='[email protected]',
description=(
'A package for parsing Earth Observation science granule '
'structure and extracting relations between science variables'
' and their associated metadata, such as coordinates.'
),
long_description=get_readme(CURRENT_DIRECTORY),
long_description_content_type='text/markdown',
url='https://github.com/nasa/earthdata-varinfo',
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
include_package_data=True,
install_requires=parse_dependencies('requirements.txt'),
extras_require={'dev': parse_dependencies('dev-requirements.txt')},
test_suite='tests',
python_requires='>=3.9',
license='License :: OSI Approved :: Apache Software License',
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Operating System :: OS Independent',
],
)