-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathsetup.py
65 lines (58 loc) · 2.34 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
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2015-2018 Digi International Inc.
import re
import os
from setuptools import setup, find_packages
VERSIONFILE = "devicecloud/version.py"
def get_version():
# In order to get the version safely, we read the version.py file
# as text. This is necessary as devicecloud/__init__.py uses
# things that won't yet be present when the package is being
# installed.
verstrline = open(VERSIONFILE, "r").read()
version_string_re = re.compile(r"^__version__ = ['\"]([^'\"]*)['\"]", re.MULTILINE)
match = version_string_re.search(verstrline)
if match:
return match.group(1)
else:
raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))
def get_long_description():
long_description = open('README.md').read()
try:
import subprocess
import pandoc
doc = pandoc.Document()
doc.markdown = long_description.encode('utf-8')
open("README.rst", "wb").write(doc.rst)
except:
print("Could not find pandoc or convert properly")
print(" make sure you have pandoc (system) and pyandoc (python module) installed")
return long_description
setup(
name="devicecloud",
version=get_version(),
description="Python API to the Digi Device Cloud",
long_description_content_type='text/markdown',
long_description=get_long_description(),
url="https://github.com/digidotcom/python-devicecloud",
author="Digi International Inc.",
author_email="[email protected]",
packages=find_packages(),
install_requires=open('requirements.txt').read().split(),
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Software Development :: Libraries",
"Operating System :: OS Independent",
],
)