-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
executable file
·99 lines (78 loc) · 2.39 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Ubuntu packages: clamav clamav-daemon
# Suse packages: clamav
import os
import os.path
import shutil
from setuptools import setup, find_packages
from distutils.command.sdist import sdist
try:
from docs import getVersion
except ImportError: # during packaging, docs are moved to html_docs
from html_docs import getVersion
changelog = open('CHANGES.rst').read()
long_description = "\n\n".join([
open('README.rst').read(),
open('CONTRIBUTORS.rst').read(),
changelog
])
class BuildSphinx(sdist):
"""
Generates sphinx documentation, puts it into html_docs/, packs it to
package and removes unused directory.
"""
def run(self):
d = os.path.abspath('.')
DOCS = d + "/" + "docs"
DOCS_IN = DOCS + "/_build/html"
DOCS_OUT = d + "/html_docs"
if not self.dry_run:
print "Generating the documentation .."
os.chdir(DOCS)
os.system("make clean")
os.system("make html")
if os.path.exists(DOCS_OUT):
shutil.rmtree(DOCS_OUT)
shutil.copytree(DOCS_IN, DOCS_OUT)
shutil.copy(DOCS + "/__init__.py", DOCS_OUT) # for getVersion()
os.chdir(d)
sdist.run(self)
if os.path.exists(DOCS_OUT):
shutil.rmtree(DOCS_OUT)
setup(
name='edeposit.amqp.antivirus',
version=getVersion(changelog),
description="E-Deposit's AMQP wrapper over ClamAV.",
long_description=long_description,
url='https://github.com/edeposit/edeposit.amqp.antivirus/',
author='Edeposit team',
author_email='[email protected]',
classifiers=[
"Programming Language :: Python :: 2.7",
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
"Topic :: Software Development :: Libraries :: Python Modules"
],
license='GPL2+',
packages=find_packages('src'),
package_dir={'': 'src'},
scripts=['bin/edeposit_clamd_init.py'],
namespace_packages=['edeposit', 'edeposit.amqp'],
include_package_data=True,
zip_safe=False,
install_requires=[
'setuptools',
"sh>=1.09",
"pyClamd>=0.3.4"
],
extras_require={
"test": [
"pytest"
],
"docs": [
"sphinx",
"sphinxcontrib-napoleon",
]
},
cmdclass={'sdist': BuildSphinx}
)