This repository has been archived by the owner on Mar 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathsetup.py
73 lines (65 loc) · 2.12 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
# -*- coding: utf-8 -*-
import os.path
import re
import sys
from setuptools import setup
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')
with open('README.rst', 'rt') as readme:
long_description = readme.read()
with open('CHANGES.txt', 'rt') as changes:
long_description += '\n\n' + changes.read()
dependencies = [
'Blogofile',
'six',
]
if PY26:
dependencies.append('argparse')
def find_package_data(module, path):
"""Find all data files to include in the package.
"""
files = []
exclude = re.compile("\.pyc$|~$")
for dirpath, dirnames, filenames in os.walk(os.path.join(module, path)):
for filename in filenames:
if not exclude.search(filename):
files.append(
os.path.relpath(os.path.join(dirpath, filename), module))
return {module: files}
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_blog",
version="0.8.3",
description="A simple blog engine plugin for Blogofile",
long_description=long_description,
author="Ryan McGuire, Doug Latornell, and the Blogofile Contributors",
author_email="[email protected]",
url="http://www.blogofile.com",
license="MIT",
classifiers=classifiers,
packages=["blogofile_blog"],
package_data=find_package_data("blogofile_blog", "site_src"),
include_package_data=True,
install_requires=dependencies,
zip_safe=False,
entry_points={
"blogofile.plugins": ["blogofile_blog = blogofile_blog"]},
)