Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·174 lines (156 loc) · 5.53 KB
/
Copy pathsetup.py
File metadata and controls
executable file
·174 lines (156 loc) · 5.53 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#!/usr/bin/env python3
from setuptools import setup
from setuptools.command.sdist import sdist as _sdist
import os.path
import subprocess
import sysconfig
manfiles = ['visidata/man/vd.1', 'visidata/man/visidata.1', 'visidata/man/vd.txt']
def ensure_man_pages():
if all(os.path.exists(f) for f in manfiles):
return True
try:
subprocess.run([os.path.join('dev', 'mkman.sh')], check=True)
except (OSError, subprocess.CalledProcessError) as e:
print(f'warning: man page generation failed ({e}); packaging without man pages')
return all(os.path.exists(f) for f in manfiles)
# eval before setup(): package_data/data_files snapshot at load time
has_man = ensure_man_pages()
class sdist(_sdist):
# hard-fail: v3.4 sdist silently shipped without man pages (#3019)
def run(self):
if not has_man:
raise SystemExit('man pages required for sdist; install groff and man-db and rerun')
super().run()
def all_requirements():
requirements = []
with open('requirements.txt', 'r', encoding='utf-8') as f:
requirements = []
for line in f:
line = line.strip()
if (line and not line.startswith('#') and not line.startswith('-e git+https') and not line.startswith('git+https')):
# inline comments
if '#' in line:
line = line.split('#')[0].strip()
if line:
requirements.append(line)
return requirements
# tox can't actually run python3 setup.py: https://github.com/tox-dev/tox/issues/96
# from visidata import __version__
__version__ = "3.5dev"
install_requires = [
"python-dateutil",
'importlib_resources; python_version<"3.9"',
'standard-mailcap; python_version>="3.13"',
]
if not sysconfig.get_platform().startswith("mingw"): # 2757
install_requires += ['windows-curses >= 2.4.1; platform_system == "Windows"'] # 2119
setup(
cmdclass={"sdist": sdist},
name="visidata",
version=__version__,
description="terminal interface for exploring and arranging tabular data",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
author="Saul Pwanson",
python_requires=">=3.8",
author_email="visidata@saul.pw",
url="https://visidata.org",
download_url="https://github.com/saulpw/visidata/tarball/" + __version__,
scripts=["bin/vd2to3.vdx", "bin/vdx"],
entry_points={
"console_scripts": ["vd=visidata.main:vd_cli",
"visidata=visidata.main:vd_cli"],
},
py_modules=["visidata"],
install_requires=install_requires,
packages=[
"visidata",
"visidata.loaders",
"visidata.vendor",
"visidata.tests",
"visidata.guides",
"visidata.ddw",
"visidata.man",
"visidata.themes",
"visidata.features",
"visidata.experimental",
"visidata.experimental.noahs_tapestry",
"visidata.apps",
"visidata.apps.vgit",
"visidata.apps.vdsql",
"visidata.desktop",
],
data_files=[
("share/man/man1", ["visidata/man/vd.1", "visidata/man/visidata.1"] if has_man else []),
("share/applications", ["visidata/desktop/visidata.desktop"]),
("share/metainfo", ["visidata/desktop/org.visidata.VisiData.metainfo.xml"]),
("share/icons/hicolor/48x48/apps", ["visidata/desktop/icons/48x48/visidata.png"]),
("share/icons/hicolor/32x32/apps", ["visidata/desktop/icons/32x32/visidata.png"]),
],
extras_require={
"test": [
"brotli",
"dnslib",
"duckdb",
"dpkt",
"fecfile",
"Faker",
"h5py",
"lxml",
"msgpack",
"odfpy",
"openpyxl",
"pandas>=1.5.3",
"pyarrow",
"pyconll",
"pypng",
"pytest",
"PyYAML>=5.1",
"shapely",
"tabulate",
"tomli",
"wcwidth",
"xport>=3.0,<3.3",
],"windows-curses": ['windows-curses >= 2.4.1; platform_system == "Windows"', # 2119
],
"all": all_requirements(),
},
package_data={
"visidata.man": ["vd.1", "vd.txt"] if has_man else [],
"visidata.ddw": ["input.ddw", "regex.ddw"],
"visidata": ["guides/*.md"],
"visidata.tests": ["sample.tsv", "benchmark.csv"],
"visidata.desktop": [
"visidata.desktop",
"org.visidata.VisiData.metainfo.xml",
"icons/48x48/visidata.png",
"icons/32x32/visidata.png",
],
"visidata.experimental.noahs_tapestry": [
"*.ddw",
"*.md",
"*.json",
"noahs.sqlite",
],
},
license="GPL-3.0-only",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Environment :: Console :: Curses",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: System Administrators",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Database :: Front-Ends",
"Topic :: Scientific/Engineering",
"Topic :: Office/Business :: Financial :: Spreadsheet",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Utilities",
],
keywords=(
"console tabular data spreadsheet terminal viewer textpunk"
"curses csv hdf5 h5 xlsx excel tsv"
),
)