Stop writing Comment objects to g.cache
[reddit.git] / r2 / setup.py
blobd8168c6ba61744edcd2941f917c632d0a86160ea
1 #!/usr/bin/env python
2 # The contents of this file are subject to the Common Public Attribution
3 # License Version 1.0. (the "License"); you may not use this file except in
4 # compliance with the License. You may obtain a copy of the License at
5 # http://code.reddit.com/LICENSE. The License is based on the Mozilla Public
6 # License Version 1.1, but Sections 14 and 15 have been added to cover use of
7 # software over a computer network and provide for limited attribution for the
8 # Original Developer. In addition, Exhibit A has been modified to be consistent
9 # with Exhibit B.
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
13 # the specific language governing rights and limitations under the License.
15 # The Original Code is reddit.
17 # The Original Developer is the Initial Developer. The Initial Developer of
18 # the Original Code is reddit Inc.
20 # All portions of the code written by reddit are Copyright (c) 2006-2015 reddit
21 # Inc. All Rights Reserved.
22 ###############################################################################
24 import os
25 import fnmatch
26 import sys
27 from setuptools import setup, find_packages, Extension
30 commands = {}
33 try:
34 from Cython.Build import cythonize
35 except ImportError:
36 print "Cannot find Cython. Skipping Cython build."
37 pyx_extensions = []
38 else:
39 pyx_files = []
40 for root, directories, files in os.walk('.'):
41 for f in fnmatch.filter(files, '*.pyx'):
42 pyx_files.append(os.path.join(root, f))
43 pyx_extensions = cythonize(pyx_files)
46 # guard against import errors in case this is the first run of setup.py and we
47 # don't have any dependencies (including baseplate) yet
48 try:
49 from baseplate.integration.thrift.command import ThriftBuildPyCommand
50 except ImportError:
51 print "Cannot find Baseplate. Skipping Thrift build."
52 else:
53 commands["build_py"] = ThriftBuildPyCommand
56 setup(
57 name="r2",
58 version="",
59 install_requires=[
60 "Pylons",
61 "Routes",
62 "mako>=0.5",
63 "boto >= 2.0",
64 "pytz",
65 "pycrypto",
66 "Babel>=1.0",
67 "cython>=0.14",
68 "SQLAlchemy",
69 "BeautifulSoup",
70 "chardet",
71 "psycopg2",
72 "pycassa>=1.7.0",
73 "pycaptcha",
74 "amqplib",
75 "py-bcrypt",
76 "snudown>=1.1.0",
77 "l2cs>=2.0.2",
78 "lxml",
79 "kazoo",
80 "stripe",
81 "requests",
82 "tinycss2",
83 "unidecode",
84 "PyYAML",
85 "Pillow",
86 "pylibmc==1.2.2",
87 "webob",
88 "webtest",
89 "python-snappy",
90 "httpagentparser==1.7.8",
92 # setup tests (allowing for "python setup.py test")
93 tests_require=['mock', 'nose', 'coverage'],
94 test_suite="nose.collector",
95 dependency_links=[
96 "https://github.com/reddit/snudown/archive/v1.1.3.tar.gz#egg=snudown-1.1.3",
97 "https://s3.amazonaws.com/code.reddit.com/pycaptcha-0.4.tar.gz#egg=pycaptcha-0.4",
99 packages=find_packages(exclude=["ez_setup"]),
100 cmdclass=commands,
101 ext_modules=pyx_extensions + [
102 Extension(
103 "Cfilters",
104 sources=[
105 "r2/lib/c/filters.c",
109 entry_points="""
110 [paste.app_factory]
111 main=r2:make_app
112 [paste.paster_command]
113 run = r2.commands:RunCommand
114 shell = pylons.commands:ShellCommand
115 [paste.filter_app_factory]
116 gzip = r2.lib.gzipper:make_gzip_middleware
117 [r2.provider.media]
118 s3 = r2.lib.providers.media.s3:S3MediaProvider
119 filesystem = r2.lib.providers.media.filesystem:FileSystemMediaProvider
120 [r2.provider.cdn]
121 cloudflare = r2.lib.providers.cdn.cloudflare:CloudFlareCdnProvider
122 null = r2.lib.providers.cdn.null:NullCdnProvider
123 [r2.provider.auth]
124 cookie = r2.lib.providers.auth.cookie:CookieAuthenticationProvider
125 http = r2.lib.providers.auth.http:HttpAuthenticationProvider
126 [r2.provider.support]
127 zendesk = r2.lib.providers.support.zendesk:ZenDeskProvider
128 [r2.provider.search]
129 cloudsearch = r2.lib.providers.search.cloudsearch:CloudSearchProvider
130 solr = r2.lib.providers.search.solr:SolrSearchProvider
131 [r2.provider.image_resizing]
132 imgix = r2.lib.providers.image_resizing.imgix:ImgixImageResizingProvider
133 no_op = r2.lib.providers.image_resizing.no_op:NoOpImageResizingProvider
134 unsplashit = r2.lib.providers.image_resizing.unsplashit:UnsplashitImageResizingProvider
135 [r2.provider.email]
136 null = r2.lib.providers.email.null:NullEmailProvider
137 mailgun = r2.lib.providers.email.mailgun:MailgunEmailProvider
138 """,