Erik Grinaker is sharing code with you
Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.
Don't show this againpython-chrono / setup.py
- commit
- 6889755530a2
- parent
- 1f98391edc83
- branch
- default
don't include doctest and doctrees in source distributions
1 |
af3dd4e59949
|
#!/usr/bin/python |
2 |
bca61a4dd9d5
|
# -*- coding: utf-8 -*- |
3 |
af3dd4e59949
|
# |
4 |
312a60c726f4
|
# python-chrono - a Python module for easy and convenient date/time handling |
5 |
af3dd4e59949
|
# |
6 |
af3dd4e59949
|
# This program is free software: you can redistribute it and/or modify |
7 |
af3dd4e59949
|
# it under the terms of the GNU General Public License as published by |
8 |
af3dd4e59949
|
# the Free Software Foundation, either version 3 of the License, or |
9 |
af3dd4e59949
|
# (at your option) any later version. |
10 |
af3dd4e59949
|
# |
11 |
af3dd4e59949
|
# This program is distributed in the hope that it will be useful, |
12 |
af3dd4e59949
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
af3dd4e59949
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
af3dd4e59949
|
# GNU General Public License for more details. |
15 |
af3dd4e59949
|
# |
16 |
af3dd4e59949
|
# You should have received a copy of the GNU General Public License |
17 |
af3dd4e59949
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 |
af3dd4e59949
|
# |
19 |
af3dd4e59949
|
|
20 |
e601e72c2be8
|
from distutils.core import setup |
21 |
7067f3660c79
|
from distutils.cmd import Command |
22 |
9827f80818dc
|
|
23 |
7067f3660c79
|
import os |
24 |
9827f80818dc
|
import os.path |
25 |
7067f3660c79
|
import subprocess |
26 |
9827f80818dc
|
import sys |
27 |
9827f80818dc
|
|
28 |
9827f80818dc
|
sys.path.insert(0, os.path.abspath(".")) |
29 |
9827f80818dc
|
|
30 |
9827f80818dc
|
import chrono |
31 |
9827f80818dc
|
|
32 |
e601e72c2be8
|
cmdclass = {} |
33 |
e601e72c2be8
|
|
34 |
e601e72c2be8
|
if "sdist" in sys.argv and not "build_sphinx" in sys.argv: |
35 |
167586016749
|
sys.argv.insert(1, "build_sphinx") |
36 |
e601e72c2be8
|
|
37 |
e0a34d0b4e61
|
if "build_sphinx" in sys.argv or "doctest" in sys.argv: |
38 |
e601e72c2be8
|
from sphinx.setup_command import BuildDoc |
39 |
e601e72c2be8
|
cmdclass["build_sphinx"] = BuildDoc |
40 |
e0a34d0b4e61
|
cmdclass["doctest"] = BuildDoc |
41 |
af3dd4e59949
|
|
42 |
7067f3660c79
|
|
43 |
7067f3660c79
|
class Test(Command): |
44 |
7067f3660c79
|
"Command for running unit-tests" |
45 |
7067f3660c79
|
|
46 |
7067f3660c79
|
description = "Run unit-tests" |
47 |
7067f3660c79
|
user_options = [ |
48 |
7067f3660c79
|
("python=", "p", "Python command to use (defaults to 'python')"), |
49 |
7067f3660c79
|
] |
50 |
7067f3660c79
|
boolean_options = () |
51 |
7067f3660c79
|
|
52 |
7067f3660c79
|
def finalize_options(self): |
53 |
7067f3660c79
|
pass |
54 |
7067f3660c79
|
|
55 |
7067f3660c79
|
def initialize_options(self): |
56 |
7067f3660c79
|
self.python = "python" |
57 |
7067f3660c79
|
|
58 |
7067f3660c79
|
def run(self): |
59 |
deb75f328d92
|
sys.exit(subprocess.call([self.python, os.path.dirname(os.path.abspath(__file__)) + "/tests/test.py"], stdout=sys.stdout)) |
60 |
7067f3660c79
|
|
61 |
7067f3660c79
|
|
62 |
7067f3660c79
|
cmdclass["test"] = Test |
63 |
7067f3660c79
|
|
64 |
af3dd4e59949
|
setup( |
65 |
9663a8d25028
|
name="python-chrono", |
66 |
9827f80818dc
|
version=chrono.__version__, |
67 |
f4e4f6cf2fce
|
description="A Python module for simple and convenient date/time handling", |
68 |
9827f80818dc
|
long_description=open("README").read(), |
69 |
9827f80818dc
|
license="GNU General Public License 3", |
70 |
9663a8d25028
|
author="Erik Grinaker", |
71 |
9663a8d25028
|
author_email="erikg@codepoet.no", |
72 |
9827f80818dc
|
url="http://oss.codepoet.no/python-chrono/", |
73 |
9827f80818dc
|
classifiers=( |
74 |
9827f80818dc
|
"Development Status :: 3 - Alpha", |
75 |
9827f80818dc
|
"Intended Audience :: Developers", |
76 |
9827f80818dc
|
"License :: OSI Approved :: GNU General Public License (GPL)", |
77 |
9827f80818dc
|
"Operating System :: OS Independent", |
78 |
9827f80818dc
|
"Programming Language :: Python", |
79 |
9827f80818dc
|
"Topic :: Software Development :: Libraries :: Python Modules", |
80 |
9827f80818dc
|
), |
81 |
9663a8d25028
|
packages=( |
82 |
9663a8d25028
|
"chrono", |
83 |
9663a8d25028
|
"chrono.calendar", |
84 |
9663a8d25028
|
"chrono.clock", |
85 |
9663a8d25028
|
"chrono.parser", |
86 |
9663a8d25028
|
), |
87 |
e601e72c2be8
|
cmdclass=cmdclass |
88 |
af3dd4e59949
|
) |