forked from static-frame/static-frame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
106 lines (88 loc) · 3.56 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import typing as tp
# To use a consistent encoding
from codecs import open
from os import path
from setuptools import setup
# https://packaging.python.org/distributing/
# to deploy:
# pip install wheel, twine
# python setup.py sdist
# python setup.py bdist_wheel
# twine upload dist/*
# rm -r build; rm -r dist; rm -r *.egg-info
# in /static-frame-feedstock/recipe
# update meta.yaml in feedstock: set version and tar sha256 for tar, commit and push
# submit PR to conda-forge/static-frame-feedstock from fork
# merge into conda forge feedstock after all checks pass
DESCRIPTION = 'Immutable and statically-typeable DataFrames with runtime type and data validation.'
ROOT_DIR_FP = path.abspath(path.dirname(__file__))
def get_long_description() -> str:
with open(path.join(ROOT_DIR_FP, 'README.rst'), encoding='utf-8') as f:
msg = []
collect = False
start = -1
for i, line in enumerate(f):
if line.startswith('static-frame'):
start = i + 2 # skip this line and the next
if i == start:
collect = True
if collect:
msg.append(line)
return ''.join(msg).strip()
def get_version() -> str:
with open(path.join(ROOT_DIR_FP, 'static_frame', '__init__.py'),
encoding='utf-8') as f:
for l in f:
if l.startswith('__version__'):
if '#' in l:
l = l.split('#')[0].strip()
return l.split('=')[-1].strip()[1:-1]
raise ValueError('__version__ not found!')
def _get_requirements(file_name: str) -> tp.Iterator[str]:
with open(path.join(ROOT_DIR_FP, file_name)) as f:
for line in f:
line = line.strip()
if line:
yield line
def get_install_requires() -> tp.Iterator[str]:
yield from _get_requirements('requirements.txt')
def get_extras_require() -> tp.Dict[str, tp.List[str]]:
# For now, have only one group that installs all extras; in the future, can create specialized groups if necessary.
return {'extras': list(_get_requirements('requirements-extras.txt'))}
setup(
name='static-frame',
version=get_version(),
description=DESCRIPTION,
long_description=get_long_description(),
python_requires='>=3.8',
install_requires=list(get_install_requires()),
extras_require=get_extras_require(),
url='https://github.com/static-frame/static-frame',
author='Christopher Ariza',
license='MIT',
package_data={'static_frame': ['py.typed']},
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Topic :: Software Development',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Information Analysis',
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Typing :: Typed',
],
keywords='staticframe pandas numpy immutable array',
packages=[
'static_frame',
'static_frame.core',
'static_frame.test', # needed for doc generation
'static_frame.test.unit', # needed for doc generation
],
)