forked from lionheart/requests-cloudkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
75 lines (62 loc) · 2.61 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env/python
# -*- coding: utf-8 -*-
from distutils.cmd import Command
import os
import re
import unittest
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
metadata = {}
execfile("requests_cloudkit/metadata.py", metadata)
with open(os.path.join(os.path.dirname(__file__), "README.rst")) as file:
long_description = file.read()
id_regex = re.compile(r"<\#([\w-]+)>")
link_regex = re.compile(r"<(\w+)>")
link_alternate_regex = re.compile(r" :target: (\w+)")
long_description = id_regex.sub(r"<https://github.com/lionheart/requests-cloudkit#\1>", long_description)
long_description = link_regex.sub(r"<https://github.com/lionheart/requests-cloudkit/blob/master/\1>", long_description)
long_description = link_regex.sub(r"<https://github.com/lionheart/requests-cloudkit/blob/master/\1>", long_description)
long_description = link_alternate_regex.sub(r" :target: https://github.com/lionheart/requests-cloudkit/blob/master/\1", long_description)
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries",
"Topic :: Utilities",
"License :: OSI Approved :: Apache Software License",
]
class TestCommand(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
from test_requests_cloudkit import TestCloudKit
suite = unittest.TestLoader().loadTestsFromTestCase(TestCloudKit)
unittest.TextTestRunner(verbosity=2).run(suite)
setup(
author=metadata['__author__'],
author_email=metadata['__email__'],
classifiers=classifiers,
cmdclass={'test': TestCommand},
description="Apple CloudKit server-to-server support for the requests Python library.",
install_required=["requests>=2.0.0", "ecdsa>=0.13"],
extras_require={'restmapper': ["requests>=2.0.0", "ecdsa>=0.13", "restmapper==0.1.0"]},
keywords="requests cloudkit",
license=metadata['__license__'],
long_description=long_description,
name='requests-cloudkit',
package_data={'': ['LICENSE', 'README.rst']},
packages=['requests_cloudkit'],
url="https://github.com/lionheart/requests-cloudkit",
version=metadata['__version__'],
)