This repository has been archived by the owner on Jul 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
/
setup.py
101 lines (80 loc) · 2.27 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
100
101
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import os
import unittest
try:
from setuptools import setup, find_packages, Command
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages, Command
import sphinxtogithub
from sphinxtogithub.tests import (
filehandler,
directoryhandler,
replacer,
renamer,
remover,
layout,
layoutfactory,
setup as setuptest,
)
class RunTests(Command):
description = "Run the sphinxtogithub test suite."
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
suites = [
filehandler.testSuite(),
directoryhandler.testSuite(),
replacer.testSuite(),
renamer.testSuite(),
remover.testSuite(),
layout.testSuite(),
layoutfactory.testSuite(),
setuptest.testSuite(),
]
suite = unittest.TestSuite(suites)
runner = unittest.TextTestRunner()
runner.run(suite)
class Publish(Command):
description = "Publish package to PyPi"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
"""Publish to PyPi"""
os.system("python setup.py sdist upload")
long_description = codecs.open("README.rst", "r", "utf-8").read()
setup(
name='sphinxtogithub',
version=sphinxtogithub.__version__,
description=sphinxtogithub.__doc__,
author=sphinxtogithub.__author__,
author_email=sphinxtogithub.__contact__,
url=sphinxtogithub.__homepage__,
platforms=["any"],
license="BSD",
packages=find_packages(),
scripts=["bin/sphinxtogithub"],
zip_safe=False,
install_requires=[],
cmdclass = {"test": RunTests, "publish" : Publish},
classifiers=[
"Development Status :: 4 - Beta",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Environment :: Plugins",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX",
"Topic :: Documentation",
],
long_description=long_description,
)