-
Notifications
You must be signed in to change notification settings - Fork 8
/
setup.py
61 lines (47 loc) · 1.6 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
# -----------------------------------------------------------------------------
# Copyright (C) 2013 Min RK
#
# Distributed under the terms of the 2-clause BSD License.
# -----------------------------------------------------------------------------
from __future__ import print_function
import sys
from setuptools import setup
from setuptools.command.bdist_egg import bdist_egg
with open("appnope/__init__.py") as f:
for line in f:
if line.startswith("__version__"):
__version__ = eval(line.split("=", 1)[1])
break
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."
)
with open("README.md") as f:
readme = f.read()
setup_args = dict(
name="appnope",
version=__version__,
packages=["appnope"],
author="Min Ragan-Kelley",
author_email="benjaminrk@gmail.com",
url="http://github.com/minrk/appnope",
description="Disable App Nap on macOS >= 10.9",
long_description=readme,
long_description_content_type="text/markdown",
license="BSD",
python_requires=">=3.6",
cmdclass={
"bdist_egg": bdist_egg if "bdist_egg" in sys.argv else "bdist_egg_disabled",
},
classifiers=[
"License :: OSI Approved :: BSD License",
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python :: 3",
],
)
setup(**setup_args)