-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
55 lines (44 loc) · 1.58 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
# Standard library modules.
from setuptools import setup, find_packages
import codecs
import os
import re
import sys
# platform specific dependency
exclude = ['data', 'contrib', 'doc', 'tests']
with open('requirements.txt') as f:
requirements = f.read().splitlines()
def get_absolute_path(*args):
"""Transform relative pathnames into absolute pathnames."""
return os.path.join(os.path.dirname(os.path.abspath(__file__)), *args)
def get_contents(*args):
"""Get the contents of a file relative to the source distribution dir."""
with codecs.open(get_absolute_path(*args), 'r', 'UTF-8') as handle:
return handle.read()
def get_version(*args):
"""Extract the version number from a Python module."""
contents = get_contents(*args)
metadata = dict(re.findall('__([a-z]+)__ = [\'"]([^\'"]+)', contents))
return metadata['version']
setup(
name='pydeco',
version=get_version('pydeco', '__init__.py'),
python_requires='>=3',
description='Python Class Methods Decorator',
url='https://github.com/paulroujansky/pydeco',
author='Paul Roujansky',
long_description=get_contents('README.rst'),
long_description_content_type='text/x-rst',
author_email='[email protected]',
license='MIT',
test_suite='pydeco.tests',
install_requires=requirements,
packages=find_packages(exclude=exclude),
include_package_data=True,
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
zip_safe=False)