This repository was archived by the owner on Dec 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
89 lines (74 loc) · 2.39 KB
/
Copy pathsetup.py
File metadata and controls
89 lines (74 loc) · 2.39 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import os
import re
import importlib
import subprocess
from pkg_resources import get_distribution
from string import ascii_letters
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
file_path = os.path.abspath(os.path.dirname(__file__))
__project__ = 'ryport'
# Get version from __init__.py
def get_version(project=__project__):
result = re.search(r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format('__version__'), open(project + '/__init__.py').read())
return result.group(1)
__author__ = 'Ian Doarn'
__version__ = get_version()
__url__ = 'https://github.com/IanDoarn/ryport'
__license__ = 'MIT'
__email__ = 'ian.doarn@zimmerbiomet.com'
__classifiers__ = [
'Intended Audience :: Developers',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
]
# Descriptions
long_desc = """Softwrapper and reporting tool for Postgres
Ryport can run queries and write the data straight to readable formats
such as Excel and CSV.
"""
short_desc = "Softwrapper and reporting tool for Postgres"
# Get required packages by checking if
# the user has them first, then adding them
# to the list of required if they don't.
install_requires = ['mysql-connector-python',
'psycopg2',
'lxml',
'XlsxWriter']
# Create package list of packages in ryport
excluded = ['.git', '.idea', '__pycache__']
def exclude_package(pkg):
for exclude in excluded:
if pkg.startswith(exclude):
return True
return False
# create package list for module
def create_package_list(base_package):
return ([base_package] +
[base_package + '.' + pkg
for pkg
in find_packages(base_package)
if not exclude_package(pkg)])
# Actual setup process
setup_inf = dict(
name=__project__,
version=__version__,
install_requires=install_requires,
packages=create_package_list(__project__),
url=__url__,
license=__license__,
author=__author__,
author_email=__email__,
long_description=long_desc,
description=short_desc,
classifiers=__classifiers__,
zip_safe=True
)
setup(**setup_inf)