This repository was archived by the owner on Dec 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsetup.py
More file actions
81 lines (73 loc) · 2.6 KB
/
setup.py
File metadata and controls
81 lines (73 loc) · 2.6 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
""" Setup file for statscache """
import os
import os.path
from setuptools import setup
def get_description():
with open('README.rst', 'r') as f:
return ''.join(f.readlines()[2:])
def get_requirements(requirements_file='requirements.txt'):
"""
Get the contents of a file listing the requirements.
Args:
requirements_file (str): path to a requirements file
Returns:
list: the list of requirements, or an empty list if
`requirements_file` could not be opened or read
"""
lines = open(requirements_file).readlines()
dependencies = []
for line in lines:
maybe_dep = line.strip()
if maybe_dep.startswith('#'):
# Skip pure comment lines
continue
if maybe_dep.startswith('git+'):
# VCS reference for dev purposes, expect a trailing comment
# with the normal requirement
__, __, maybe_dep = maybe_dep.rpartition('#')
else:
# Ignore any trailing comment
maybe_dep, __, __ = maybe_dep.partition('#')
# Remove any whitespace and assume non-empty results are dependencies
maybe_dep = maybe_dep.strip()
if maybe_dep:
dependencies.append(maybe_dep)
return dependencies
# Note to packagers: Install or link the following files using the specfile:
# 'apache/stastcache.conf' -> '/etc/httpd/conf.d/statscache.conf'
# 'apache/statscache.wsgi' -> '/usr/share/statscache/statscache.wsgi'
# 'statscache/static/' -> '/usr/share/statscache/static/'
setup(
name='statscache',
version='0.0.4',
description='Daemon to build and keep fedmsg statistics',
long_description=get_description(),
author='Ralph Bean',
author_email='rbean@redhat.com',
url="https://github.com/fedora-infra/statscache/",
download_url="https://pypi.python.org/pypi/statscache/",
license='LGPLv2+',
install_requires=get_requirements(),
tests_require=get_requirements('requirements_test.txt'),
test_suite='nose.collector',
packages=[
'statscache',
'statscache/plugins',
],
include_package_data=True,
zip_safe=False,
classifiers=[
'Environment :: Web Environment',
'Topic :: Software Development :: Libraries :: Python Modules',
'Intended Audience :: Developers',
'Programming Language :: Python',
],
entry_points={
'moksha.consumer': [
"statscache_consumer = statscache.consumer:StatsConsumer",
],
'moksha.producer': [
"statscache_producer = statscache.producer:StatsProducer",
],
},
)