e5398c97f6fe758f56003445fde9847626ccf3e9
[cached-property.git] / setup.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 import os
5 import sys
6 import codecs
7
8 try:
9 from setuptools import setup
10 except ImportError:
11 from distutils.core import setup
12
13 __version__ = "1.5.1"
14
15
16 def read(fname):
17 return codecs.open(
18 os.path.join(os.path.dirname(__file__), fname), "r", "utf-8"
19 ).read()
20
21
22 readme = read("README.rst")
23 history = read("HISTORY.rst").replace(".. :changelog:", "")
24
25 if sys.argv[-1] == "publish":
26 try:
27 import wheel
28 import twine
29 except (ImportError, ModuleNotFoundError):
30 raise ModuleNotFoundError('Run "pip install wheel twine"')
31 os.system("python setup.py sdist bdist_wheel")
32 os.system("twine upload dist/*")
33 os.system("git tag -a %s -m 'version %s'" % (__version__, __version__))
34 os.system("git push --tags")
35 sys.exit()
36
37 setup(
38 name="cached-property",
39 version=__version__,
40 description="A decorator for caching properties in classes.",
41 long_description=readme + "\n\n" + history,
42 author="Daniel Greenfeld",
43 author_email="pydanny@gmail.com",
44 url="https://github.com/pydanny/cached-property",
45 py_modules=["cached_property"],
46 include_package_data=True,
47 license="BSD",
48 zip_safe=False,
49 keywords="cached-property",
50 classifiers=[
51 "Development Status :: 5 - Production/Stable",
52 "Intended Audience :: Developers",
53 "License :: OSI Approved :: BSD License",
54 "Natural Language :: English",
55 "Programming Language :: Python :: 2",
56 "Programming Language :: Python :: 2.7",
57 "Programming Language :: Python :: 3",
58 "Programming Language :: Python :: 3.4",
59 "Programming Language :: Python :: 3.5",
60 "Programming Language :: Python :: 3.6",
61 "Programming Language :: Python :: 3.7",
62 "Programming Language :: Python :: 3.8",
63 ],
64 )