forked from minrk/wurlitzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
55 lines (45 loc) · 1.46 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
#!/usr/bin/env python
import sys
from setuptools import setup
from setuptools.command.bdist_egg import bdist_egg
with open("README.md") as f:
long_description = f.read()
version_ns = {}
with open("wurlitzer.py") as f:
for line in f:
if line.startswith("__version__"):
exec(line, version_ns)
class bdist_egg_disabled(bdist_egg):
"""Disabled version of bdist_egg
Prevents setup.py install from performing setuptools' default easy_install,
which it should never ever do.
"""
def run(self):
sys.exit(
"Aborting implicit building of eggs. Use `pip install .` to install from source."
)
setup_args = dict(
name="wurlitzer",
version=version_ns["__version__"],
author="Min RK",
author_email="[email protected]",
description="Capture C-level output in context managers",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/minrk/wurlitzer",
py_modules=["wurlitzer"],
python_requires=">=2.7",
license="MIT",
cmdclass={
"bdist_egg": bdist_egg if "bdist_egg" in sys.argv else bdist_egg_disabled
},
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
],
)
if __name__ == "__main__":
setup(**setup_args)