Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 155 lines (135 sloc) 5.672 kb
5ae7f27 @kmike Fix line breaks in setup.py. They used to be Windows (CRLF) and this …
kmike authored
1 #!/usr/bin/env python
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
2 from distutils.util import convert_path
5ae7f27 @kmike Fix line breaks in setup.py. They used to be Windows (CRLF) and this …
kmike authored
3 from django_facebook import __version__, __maintainer__, __email__
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
4 from fnmatch import fnmatchcase
5 import os
6 import sys
c5ce7f2 @tschellenbach setup.py
authored
7 try:
8 from setuptools import setup, find_packages
9 except ImportError:
10 from distutils.core import setup, find_packages
5ae7f27 @kmike Fix line breaks in setup.py. They used to be Windows (CRLF) and this …
kmike authored
11
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
12
13 standard_exclude = ['*.py', '*.pyc', '*~', '.*', '*.bak']
14 standard_exclude_directories = [
b273f90 @tschellenbach excluded docs
authored
15 '.*', 'CVS', '_darcs', './build', './docs',
ed0c5d2 @tschellenbach travis?
authored
16 './dist', 'EGG-INFO', '*.egg-info', 'facebook_profiles'
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
17 ]
18
b8daf74 @tschellenbach pep8 cleanup
authored
19
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
20 def find_package_data(where='.', package='', exclude=standard_exclude,
b8daf74 @tschellenbach pep8 cleanup
authored
21 exclude_directories=standard_exclude_directories,
22 only_in_packages=True, show_ignored=False):
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
23 """
24 Return a dictionary suitable for use in ``package_data``
25 in a distutils ``setup.py`` file.
3eb279d Small fixes to setup.py and README files.
Ramiro Morales authored
26
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
27 The dictionary looks like::
3eb279d Small fixes to setup.py and README files.
Ramiro Morales authored
28
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
29 {'package': [files]}
3eb279d Small fixes to setup.py and README files.
Ramiro Morales authored
30
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
31 Where ``files`` is a list of all the files in that package that
32 don't match anything in ``exclude``.
3eb279d Small fixes to setup.py and README files.
Ramiro Morales authored
33
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
34 If ``only_in_packages`` is true, then top-level directories that
35 are not packages won't be included (but directories under packages
36 will).
3eb279d Small fixes to setup.py and README files.
Ramiro Morales authored
37
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
38 Directories matching any pattern in ``exclude_directories`` will
39 be ignored; by default directories with leading ``.``, ``CVS``,
40 and ``_darcs`` will be ignored.
3eb279d Small fixes to setup.py and README files.
Ramiro Morales authored
41
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
42 If ``show_ignored`` is true, then all the files that aren't
43 included in package data are shown on stderr (for debugging
44 purposes).
3eb279d Small fixes to setup.py and README files.
Ramiro Morales authored
45
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
46 Note patterns use wildcards, or can be exact paths (including
47 leading ``./``), and all searching is case-insensitive.
48 """
3eb279d Small fixes to setup.py and README files.
Ramiro Morales authored
49
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
50 out = {}
51 stack = [(convert_path(where), '', package, only_in_packages)]
52 while stack:
53 where, prefix, package, only_in_packages = stack.pop(0)
54 for name in os.listdir(where):
55 fn = os.path.join(where, name)
56 if os.path.isdir(fn):
57 bad_name = False
58 for pattern in exclude_directories:
59 if (fnmatchcase(name, pattern)
b8daf74 @tschellenbach pep8 cleanup
authored
60 or fn.lower() == pattern.lower()):
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
61 bad_name = True
62 if show_ignored:
63 print >> sys.stderr, (
64 'Directory %s ignored by pattern %s'
65 % (fn, pattern))
66 break
67 if bad_name:
68 continue
69 if (os.path.isfile(os.path.join(fn, '__init__.py'))
b8daf74 @tschellenbach pep8 cleanup
authored
70 and not prefix):
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
71 if not package:
72 new_package = name
73 else:
74 new_package = package + '.' + name
75 stack.append((fn, '', new_package, False))
76 else:
b8daf74 @tschellenbach pep8 cleanup
authored
77 stack.append(
78 (fn, prefix + name + '/', package, only_in_packages))
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
79 elif package or not only_in_packages:
80 # is a file
81 bad_name = False
82 for pattern in exclude:
83 if (fnmatchcase(name, pattern)
b8daf74 @tschellenbach pep8 cleanup
authored
84 or fn.lower() == pattern.lower()):
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
85 bad_name = True
86 if show_ignored:
87 print >> sys.stderr, (
88 'File %s ignored by pattern %s'
89 % (fn, pattern))
90 break
91 if bad_name:
92 continue
b8daf74 @tschellenbach pep8 cleanup
authored
93 out.setdefault(package, []).append(prefix + name)
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
94 return out
95
96
b8daf74 @tschellenbach pep8 cleanup
authored
97 excluded_directories = standard_exclude_directories + ['./requirements',
98 './scripts']
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
99 package_data = find_package_data(exclude_directories=excluded_directories)
5ae7f27 @kmike Fix line breaks in setup.py. They used to be Windows (CRLF) and this …
kmike authored
100 license_text = open('LICENSE.txt').read()
0528e15 @tschellenbach minor cleanups
authored
101 long_description = open('README.rest').read()
5ae7f27 @kmike Fix line breaks in setup.py. They used to be Windows (CRLF) and this …
kmike authored
102
2561864 @tschellenbach dynamic development status
authored
103 if 'alpha' in __version__:
104 development_status = 'Development Status :: 3 - Alpha'
105 else:
106 development_status = 'Development Status :: 5 - Production/Stable'
107
5ae7f27 @kmike Fix line breaks in setup.py. They used to be Windows (CRLF) and this …
kmike authored
108 CLASSIFIERS = [
2561864 @tschellenbach dynamic development status
authored
109 development_status,
b8daf74 @tschellenbach pep8 cleanup
authored
110 'Intended Audience :: Developers',
7c7dcbf @jrabbit reflect license.txt in classifiers
jrabbit authored
111 'License :: OSI Approved :: BSD License',
b8daf74 @tschellenbach pep8 cleanup
authored
112 'Natural Language :: English',
113 'Operating System :: OS Independent',
114 'Programming Language :: Python',
8a1fe74 @tschellenbach test
authored
115 'Programming Language :: Python :: 2.7',
86b7f34 @chhantyal add Python 3 as language supported
chhantyal authored
116 'Programming Language :: Python :: 3',
117 'Programming Language :: Python :: 3.3',
b8daf74 @tschellenbach pep8 cleanup
authored
118 'Topic :: Scientific/Engineering :: Mathematics',
119 'Topic :: Software Development :: Libraries :: Python Modules',
b9e34e5 @tschellenbach removed download url
authored
120 'Framework :: Django',
8a1fe74 @tschellenbach test
authored
121 'Environment :: Web Environment',
b8daf74 @tschellenbach pep8 cleanup
authored
122 ]
5ae7f27 @kmike Fix line breaks in setup.py. They used to be Windows (CRLF) and this …
kmike authored
123
588f33c @tschellenbach Django Facebook 2.0:
authored
124 DESCRIPTION = """Facebook open graph API client in python. Enables django applications to register users using facebook.
125 Fixes issues with the official but unsupported Facebook python-sdk. Enables mobile facebook authentication.
3eb279d Small fixes to setup.py and README files.
Ramiro Morales authored
126 Canvas page authentication for facebook applications. FQL access via the server side api.
588f33c @tschellenbach Django Facebook 2.0:
authored
127 """
5ae7f27 @kmike Fix line breaks in setup.py. They used to be Windows (CRLF) and this …
kmike authored
128
8a1fe74 @tschellenbach test
authored
129 download_url = 'https://github.com/tschellenbach/Django-facebook/archive/v%s.tar.gz' % __version__
130
5ae7f27 @kmike Fix line breaks in setup.py. They used to be Windows (CRLF) and this …
kmike authored
131 setup(
b8daf74 @tschellenbach pep8 cleanup
authored
132 name='django-facebook',
133 version=__version__,
134 url='http://github.com/tschellenbach/Django-facebook',
135 author=__maintainer__,
136 author_email=__email__,
137 license=license_text,
c5ce7f2 @tschellenbach setup.py
authored
138 packages=find_packages(),
341dbf7 @tschellenbach ok seriously is someone just trying to make setup.py impossibly compl…
authored
139 package_data=package_data,
b8daf74 @tschellenbach pep8 cleanup
authored
140 description=DESCRIPTION,
5ae7f27 @kmike Fix line breaks in setup.py. They used to be Windows (CRLF) and this …
kmike authored
141 long_description=long_description,
fb5e733 @tschellenbach wip
authored
142 classifiers=CLASSIFIERS,
6fffca6 @tschellenbach added requirements
authored
143 install_requires=['unidecode'],
fb5e733 @tschellenbach wip
authored
144 tests_require=[
145 'django',
146 'python-memcached',
147 'pil',
d7634a6 @tschellenbach support for pythons setup.py test, boy that was a pain to add
authored
148 'mock',
149 'pytest',
1d1fcfb @troygrosfield setup cleanup.
troygrosfield authored
150 'pytest-django'
fb5e733 @tschellenbach wip
authored
151 ],
d7634a6 @tschellenbach support for pythons setup.py test, boy that was a pain to add
authored
152 test_suite='runtests.runtests',
58e11fa @ncadou fixed migration failure
ncadou authored
153 zip_safe=False, # South can't run migrations on zipped eggs.
5ae7f27 @kmike Fix line breaks in setup.py. They used to be Windows (CRLF) and this …
kmike authored
154 )
Something went wrong with that request. Please try again.