Removing extlib submodule and switching it to being a package.
[mediagoblin.git] / setup.py
1 # GNU MediaGoblin -- federated, autonomous media hosting
2 # Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17 from setuptools import setup, find_packages
18 import os
19 import re
20
21 READMEFILE = "README"
22 VERSIONFILE = os.path.join("mediagoblin", "_version.py")
23 VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
24
25
26 def get_version():
27 verstrline = open(VERSIONFILE, "rt").read()
28 mo = re.search(VSRE, verstrline, re.M)
29 if mo:
30 return mo.group(1)
31 else:
32 raise RuntimeError("Unable to find version string in %s." %
33 VERSIONFILE)
34
35 try:
36 setup(
37 name="mediagoblin",
38 version=get_version(),
39 packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
40 zip_safe=False,
41 include_package_data = True,
42 # scripts and dependencies
43 install_requires=[
44 'setuptools',
45 'python-dateutil',
46 'PasteScript',
47 'wtforms',
48 'py-bcrypt',
49 'pytest>=2.3.1',
50 'pytest-xdist',
51 'werkzeug>=0.7',
52 'celery>=3.0',
53 'kombu',
54 'jinja2',
55 'sphinx',
56 'Babel>=1.0',
57 'argparse',
58 'webtest<2',
59 'ConfigObj',
60 'Markdown',
61 'sqlalchemy<0.9.0, >0.8.0',
62 'sqlalchemy-migrate',
63 'mock',
64 'itsdangerous',
65 'pytz',
66 'oauthlib==0.5.0',
67 'unidecode',
68 'ExifRead',
69
70 # PLEASE change this when we can; a dependency is forcing us to set this
71 # specific number and it is breaking setup.py develop
72 'six==1.5.2'
73
74 ## Annoying. Please remove once we can! We only indirectly
75 ## use pbr, and currently it breaks things, presumably till
76 ## their next release.
77 # 'pbr==0.5.22',
78
79 ## This is optional!
80 # 'translitcodec',
81 ## For now we're expecting that users will install this from
82 ## their package managers.
83 # 'lxml',
84 # 'PIL',
85 ],
86 # requires=['gst'],
87 test_suite='nose.collector',
88 entry_points="""\
89 [console_scripts]
90 gmg = mediagoblin.gmg_commands:main_cli
91 pybabel = mediagoblin.babel.messages.frontend:main
92
93 [paste.app_factory]
94 app = mediagoblin.app:paste_app_factory
95
96 [paste.filter_app_factory]
97 errors = mediagoblin.errormiddleware:mgoblin_error_middleware
98
99 [zc.buildout]
100 make_user_dev_dirs = mediagoblin.buildout_recipes:MakeUserDevDirs
101
102 [babel.extractors]
103 jinja2 = jinja2.ext:babel_extract
104 """,
105 license='AGPLv3',
106 author='Free Software Foundation and contributors',
107 author_email='cwebber@gnu.org',
108 url="http://mediagoblin.org/",
109 download_url="http://mediagoblin.org/download/",
110 long_description=open(READMEFILE).read(),
111 classifiers=[
112 "Development Status :: 3 - Alpha",
113 "Environment :: Web Environment",
114 "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
115 "Operating System :: OS Independent",
116 "Programming Language :: Python",
117 'Programming Language :: Python :: 2.6',
118 'Programming Language :: Python :: 2.7',
119 "Topic :: Internet :: WWW/HTTP :: Dynamic Content"
120 ],
121 )
122 except TypeError, e:
123 # Check if the problem is caused by the sqlalchemy/setuptools conflict
124 msg_as_str = str(e)
125 if not (msg_as_str == 'dist must be a Distribution instance'):
126 raise
127
128 # If so, tell the user it is OK to just run the script again.
129 print "\n\n---------- NOTE ----------"
130 print "The setup.py command you ran failed."
131 print ""
132 print ("It is a known possible failure. Just run it again. It works the "
133 "second time.")
134 import sys
135 sys.exit(1)