@@ 0,0 1,24 @@
+VERSION = (0, 1, 0, 'final', 0)
+
+
+# taken from django-registration
+
+def get_version():
+ "Returns a PEP 386-compliant version number from VERSION."
+ assert len(VERSION) == 5
+ assert VERSION[3] in ('alpha', 'beta', 'rc', 'final')
+
+ # Now build the two parts of the version number:
+ # main = X.Y[.Z]
+ # sub = .devN - for pre-alpha releases
+ # | {a|b|c}N - for alpha, beta and rc releases
+
+ parts = 2 if VERSION[2] == 0 else 3
+ main = '.'.join(str(x) for x in VERSION[:parts])
+
+ sub = ''
+ if VERSION[3] != 'final':
+ mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
+ sub = mapping[VERSION[3]] + str(VERSION[4])
+
+ return str(main + sub)
@@ 0,0 1,53 @@
+import os
+from distutils.core import setup
+
+project_name = 'form_guard'
+
+# Idea from django-registration setup.py
+packages, data_files = [], []
+root_dir = os.path.dirname(__file__)
+if root_dir:
+ os.chdir(root_dir)
+
+for dirpath, dirnames, filenames in os.walk(project_name):
+ # Ignore dirnames that start with '.'
+ for i, dirname in enumerate(dirnames):
+ if dirname.startswith('.') or dirname == '__pycache__':
+ del dirnames[i]
+ if '__init__.py' in filenames:
+ pkg = dirpath.replace(os.path.sep, '.')
+ if os.path.altsep:
+ pkg = pkg.replace(os.path.altsep, '.')
+ packages.append(pkg)
+ elif filenames:
+ prefix = dirpath[(len(project_name) + 1):]
+ for f in filenames:
+ data_files.append(os.path.join(prefix, f))
+
+setup(
+ name='django-form-guard',
+ version=__import__(project_name).get_version(),
+ package_dir={project_name: project_name},
+ packages=packages,
+ package_data={project_name: data_files},
+ description='Django Form Guard',
+ author='Netlandish Inc.',
+ author_email='geeks@netlandish.com',
+ license='BSD License',
+ url='http://bitbucket.org/netlandish/django-form-guard/',
+ long_description='Django Form Guard',
+ install_requires=['Django >= 1.7.0'],
+ platforms=['any'],
+ classifiers=[
+ 'Development Status :: 4 - Beta',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: BSD License',
+ 'Natural Language :: English',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.4',
+ 'Environment :: Web Environment',
+ ],
+)