Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 140 lines (120 sloc) 4.77 kB
4bed315 @paltman updated setup.py
paltman authored
1 import codecs
d2d2548 @paltman updated setup.py
paltman authored
2 import os
3 import sys
4
5 from distutils.util import convert_path
6 from fnmatch import fnmatchcase
7 from setuptools import setup, find_packages
8
9
10 def read(fname):
4bed315 @paltman updated setup.py
paltman authored
11 return codecs.open(os.path.join(os.path.dirname(__file__), fname)).read()
d2d2548 @paltman updated setup.py
paltman authored
12
13
14 # Provided as an attribute, so you can append to these instead
15 # of replicating them:
16 standard_exclude = ["*.py", "*.pyc", "*$py.class", "*~", ".*", "*.bak"]
17 standard_exclude_directories = [
18 ".*", "CVS", "_darcs", "./build", "./dist", "EGG-INFO", "*.egg-info"
19 ]
20
21
22 # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
23 # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
24 # Note: you may want to copy this into your setup.py file verbatim, as
25 # you can't import this from another package, when you don't know if
26 # that package is installed yet.
27 def find_package_data(
28 where=".",
29 package="",
30 exclude=standard_exclude,
31 exclude_directories=standard_exclude_directories,
32 only_in_packages=True,
33 show_ignored=False):
34 """
35 Return a dictionary suitable for use in ``package_data``
36 in a distutils ``setup.py`` file.
37
38 The dictionary looks like::
39
40 {"package": [files]}
41
42 Where ``files`` is a list of all the files in that package that
43 don"t match anything in ``exclude``.
44
45 If ``only_in_packages`` is true, then top-level directories that
46 are not packages won"t be included (but directories under packages
47 will).
48
49 Directories matching any pattern in ``exclude_directories`` will
50 be ignored; by default directories with leading ``.``, ``CVS``,
51 and ``_darcs`` will be ignored.
52
53 If ``show_ignored`` is true, then all the files that aren"t
54 included in package data are shown on stderr (for debugging
55 purposes).
56
57 Note patterns use wildcards, or can be exact paths (including
58 leading ``./``), and all searching is case-insensitive.
59 """
60 out = {}
61 stack = [(convert_path(where), "", package, only_in_packages)]
62 while stack:
63 where, prefix, package, only_in_packages = stack.pop(0)
64 for name in os.listdir(where):
65 fn = os.path.join(where, name)
66 if os.path.isdir(fn):
67 bad_name = False
68 for pattern in exclude_directories:
69 if (fnmatchcase(name, pattern)
70 or fn.lower() == pattern.lower()):
71 bad_name = True
72 if show_ignored:
73 print >> sys.stderr, (
74 "Directory %s ignored by pattern %s"
75 % (fn, pattern))
76 break
77 if bad_name:
78 continue
79 if (os.path.isfile(os.path.join(fn, "__init__.py"))
80 and not prefix):
81 if not package:
82 new_package = name
83 else:
84 new_package = package + "." + name
85 stack.append((fn, "", new_package, False))
86 else:
87 stack.append((fn, prefix + name + "/", package, only_in_packages))
88 elif package or not only_in_packages:
89 # is a file
90 bad_name = False
91 for pattern in exclude:
92 if (fnmatchcase(name, pattern)
93 or fn.lower() == pattern.lower()):
94 bad_name = True
95 if show_ignored:
96 print >> sys.stderr, (
97 "File %s ignored by pattern %s"
98 % (fn, pattern))
99 break
100 if bad_name:
101 continue
102 out.setdefault(package, []).append(prefix+name)
103 return out
104
105
106 PACKAGE = "kaleo"
107 NAME = "kaleo"
108 DESCRIPTION = "a user to user join invitations app"
109 AUTHOR = "Eldarion"
110 AUTHOR_EMAIL = "paltman@eldarion.com"
111 URL = "http://github.com/eldarion/kaleo"
7a56b79 @paltman initial commit
paltman authored
112
113
114 setup(
d2d2548 @paltman updated setup.py
paltman authored
115 name=NAME,
4bed315 @paltman updated setup.py
paltman authored
116 version=":versiontools:%s:" % PACKAGE,
d2d2548 @paltman updated setup.py
paltman authored
117 description=DESCRIPTION,
118 long_description=read("README.rst"),
119 author=AUTHOR,
120 author_email=AUTHOR_EMAIL,
121 license="BSD",
122 url=URL,
123 packages=find_packages(exclude=["tests.*", "tests"]),
124 package_data=find_package_data(PACKAGE),
125 classifiers=[
126 "Development Status :: 3 - Alpha",
127 "Environment :: Web Environment",
128 "Intended Audience :: Developers",
129 "License :: OSI Approved :: BSD License",
130 "Operating System :: OS Independent",
131 "Programming Language :: Python",
132 "Framework :: Django",
1d43cb8 @paltman fixed package to include templates
paltman authored
133 ],
d2d2548 @paltman updated setup.py
paltman authored
134 zip_safe=False,
4bed315 @paltman updated setup.py
paltman authored
135 setup_requires=[
136 "versiontools >= 1.6"
137 ]
7a56b79 @paltman initial commit
paltman authored
138 )
d2d2548 @paltman updated setup.py
paltman authored
139
Something went wrong with that request. Please try again.