Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
68 lines (62 loc) · 2.17 KB
/
Copy pathsetup.py
File metadata and controls
68 lines (62 loc) · 2.17 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
# -*- coding: utf-8 -*-
import sys
from setuptools import setup
import blogofile
py_version = sys.version_info[:2]
PY3 = py_version[0] == 3
PY26 = py_version == (2, 6)
if PY3:
if py_version < (3, 2):
raise RuntimeError(
'On Python 3, Blogofile requires Python 3.2 or better')
else:
if py_version < (2, 6):
raise RuntimeError(
'On Python 2, Blogofile requires Python 2.6 or better')
blogofile.zip_site_init()
with open('README.rst', 'rt') as readme:
long_description = readme.read()
with open('CHANGES.txt', 'rt') as changes:
long_description += '\n\n' + changes.read()
with open('requirements/production.txt', 'rt') as reqs:
requirements = reqs.read()
install_requires = [line for line in requirements.split('\n')
if line and not line.startswith('#')]
# TODO: There has to be a better way...
dependency_links = []
if PY3:
textile_index = [i for i, item in enumerate(install_requires)
if item.startswith('textile')][0]
install_requires[textile_index] += '-py3k'
dependency_links = [
'http://github.com/EnigmaCurry/textile-py3k/tarball/2.1.4'
'#egg=textile-2.1.4-py3k']
if PY26:
install_requires.append('argparse')
classifiers = [
'Programming Language :: Python :: {0}'.format(py_version)
for py_version in ['2', '2.6', '2.7', '3', '3.2']]
classifiers.extend([
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: Implementation :: CPython',
'Environment :: Console',
'Natural Language :: English',
])
setup(
name="Blogofile",
version=blogofile.__version__,
description="A static website compiler and blog engine",
long_description=long_description,
author="Ryan McGuire",
author_email="blogofile-discuss@googlegroups.com",
url="http://www.blogofile.com",
license="MIT",
classifiers=classifiers,
packages=["blogofile", "blogofile.site_init"],
package_data={"blogofile.site_init": ["*.zip"]},
install_requires=install_requires,
dependency_links=dependency_links,
entry_points={
'console_scripts': ['blogofile = blogofile.main:main']},
)