4 from fnmatch import fnmatchcase
5 from distutils.util import convert_path
6 from setuptools import setup, find_packages
9 'Django >=1.2.3, <1.3',
12 'feincms >=1.4.2, < 1.5'
17 # Provided as an attribute, so you can append to these instead
18 # of replicating them:
19 standard_exclude = ('*.py', '*.pyc', '*$py.class', '*~', '.*', '*.bak')
20 standard_exclude_directories = ('.*', 'CVS', '_darcs', './build',
21 './dist', 'EGG-INFO', '*.egg-info')
23 def find_package_data(
24 where='.', package='',
25 exclude=standard_exclude,
26 exclude_directories=standard_exclude_directories,
27 only_in_packages=True,
30 Return a dictionary suitable for use in ``package_data``
31 in a distutils ``setup.py`` file.
33 The dictionary looks like::
37 Where ``files`` is a list of all the files in that package that
38 don't match anything in ``exclude``.
40 If ``only_in_packages`` is true, then top-level directories that
41 are not packages won't be included (but directories under packages
44 Directories matching any pattern in ``exclude_directories`` will
45 be ignored; by default directories with leading ``.``, ``CVS``,
46 and ``_darcs`` will be ignored.
48 If ``show_ignored`` is true, then all the files that aren't
49 included in package data are shown on stderr (for debugging
52 Note patterns use wildcards, or can be exact paths (including
53 leading ``./``), and all searching is case-insensitive.
57 stack = [(convert_path(where), '', package, only_in_packages)]
59 where, prefix, package, only_in_packages = stack.pop(0)
60 for name in os.listdir(where):
61 fn = os.path.join(where, name)
64 for pattern in exclude_directories:
65 if (fnmatchcase(name, pattern)
66 or fn.lower() == pattern.lower()):
69 print >> sys.stderr, (
70 "Directory %s ignored by pattern %s"
75 if (os.path.isfile(os.path.join(fn, '__init__.py'))
80 new_package = package + '.' + name
81 stack.append((fn, '', new_package, False))
83 stack.append((fn, prefix + name + '/', package, only_in_packages))
84 elif package or not only_in_packages:
87 for pattern in exclude:
88 if (fnmatchcase(name, pattern)
89 or fn.lower() == pattern.lower()):
92 print >> sys.stderr, (
93 "File %s ignored by pattern %s"
98 out.setdefault(package, []).append(prefix+name)
101 from cloudcms import version
102 VERSION = version.__version__
105 name = 'snf-cloudcms',
108 url = 'http://code.grnet.gr/',
109 classifiers = CLASSIFIERS,
111 author = 'Package author',
112 author_email = 'author@grnet.gr',
113 maintainer = 'Package maintainer',
114 maintainer_email = 'maintainer@grnet.gr',
116 packages = find_packages('.'),
117 package_dir= {'': '.'},
118 include_package_data = True,
119 package_data=find_package_data('.'),
122 install_requires = INSTALL_REQUIRES,
124 dependency_links = ['http://docs.dev.grnet.gr/pypi'],
128 'default_settings = cloudcms.synnefo_settings',
129 'web_apps = cloudcms.synnefo_settings:CLOUDCMS_APPS',
130 'web_middleware = cloudcms.synnefo_settings:CLOUDCMS_MIDDLEWARES',
131 'web_context_processors = cloudcms.synnefo_settings:CLOUDCMS_CONTEXT_PROCESSORS',
132 'urls = cloudcms.urls:urlpatterns',
133 'web_static = cloudcms.synnefo_settings:CLOUDCMS_STATICFILES'