-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
82 lines (70 loc) · 2.87 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
from setuptools import setup #type: ignore
from codecs import open
from os import path
import typing as tp
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('frame-fixtures'):
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, 'frame_fixtures', '__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='frame-fixtures',
version=get_version(),
description='Use compact expressions to create diverse, deterministic DataFrame fixtures with StaticFrame',
long_description=get_long_description(),
python_requires='>=3.9',
install_requires=list(get_install_requires()),
extras_require=get_extras_require(),
url='https://github.com/static-frame/frame-fixtures',
author='Christopher Ariza',
license='MIT',
# 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',
],
keywords='dataframe fixtures test staticframe pandas numpy',
packages=[
'frame_fixtures',
],
)