From 75bf9c6dc0ab6b753b3d6a472ee1cdd1f1fe4482 Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Sat, 9 Jan 2016 03:05:44 +0100 Subject: [PATCH] Migrate setup.py from distutils -> setuptools Update repository URL, clean up some whitespace (editor setting) --- .gitignore | 4 ++-- AUTHORS | 1 + README.rst | 18 +++++++++--------- setup.cfg | 4 ++++ setup.py | 39 +++++++++++++++++++++++++-------------- 5 files changed, 41 insertions(+), 25 deletions(-) create mode 100644 setup.cfg mode change 100644 => 100755 setup.py diff --git a/.gitignore b/.gitignore index d76d3cfa..8c6de35d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -*.pyc +*.py[cod] .* dist MANIFEST - +*.egg-info diff --git a/AUTHORS b/AUTHORS index 95195f41..e86a03a1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -27,3 +27,4 @@ Estuans (estuans) bloynd mrmachine (Tai Lee) Ben Waters (the-ben-waters) +Peter Bittner (bittner) diff --git a/README.rst b/README.rst index ddab475e..0ea40ab2 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ Django Form Designer ******************** -A Django admin app with a GUI to create complex forms without any programming skills; +A Django admin app with a GUI to create complex forms without any programming skills; complete with logging, validation, and redirects. **Key features**: @@ -10,10 +10,10 @@ complete with logging, validation, and redirects. * Form data can be logged and CSV-exported, sent via e-mail, or forwarded to any web address * Integration with `Django CMS `_: Add forms to any page * Use drag & drop to change the position of your form fields -* Fully collapsible admin interface for better overview over your form +* Fully collapsible admin interface for better overview over your form * Implements many form fields included with Django (TextField, EmailField, DateField etc) -* Validation rules as supplied by Django are fully configurable (maximum length, regular - expression etc) +* Validation rules as supplied by Django are fully configurable (maximum length, regular + expression etc) * Customizable messages and labels * Supports POST and GET forms * Signals on form render, submission, success, error. @@ -26,9 +26,9 @@ This install guide assumes that you are familiar with Python and Django. - Install the module using pip:: - $ pip install git+git://github.com/philomat/django-form-designer.git#egg=django-form-designer + $ pip install git+git://github.com/samluescher/django-form-designer.git#egg=django-form-designer - **or** download it from http://github.com/philomat/django-form-designer, and run the installation + **or** download it from https://github.com/samluescher/django-form-designer, and run the installation script:: $ python setup.py install @@ -80,10 +80,10 @@ Basic setup public, this step is not necessary. -Using Django Form Designer with Django CMS +Using Django Form Designer with Django CMS ========================================== -- Add ``form_designer.contrib.cms_plugins.form_designer_form`` to your ``INSTALLED_APPS`` +- Add ``form_designer.contrib.cms_plugins.form_designer_form`` to your ``INSTALLED_APPS`` setting:: INSTALLED_APPS = ( @@ -95,7 +95,7 @@ Using Django Form Designer with Django CMS $ manage.py syncdb -You can now add forms to pages created with Django CMS. +You can now add forms to pages created with Django CMS. Optional requirements diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..5a4e7801 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,4 @@ +[flake8] +max-line-length = 120 +max-complexity = 10 +exclude = build,dist,*/migrations,*.egg-info diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index 7c693e0a..08fd2e41 --- a/setup.py +++ b/setup.py @@ -1,23 +1,34 @@ +#!/usr/bin/env python # encoding=utf8 -import os -from distutils.core import setup +from pip.req import parse_requirements +from os.path import dirname, join +from setuptools import setup + + +def read_requirements(): + filepath = join(dirname(__file__), 'requirements.txt') + generator = parse_requirements(filepath, session=False) + return [str(requirement.req) for requirement in generator] + def read(fname): - return open(os.path.join(os.path.dirname(__file__), fname)).read() + return open(join(dirname(__file__), fname)).read() README = read('README.rst') setup( - name = "django-form-designer", - version = "0.8.0", - url = 'http://github.com/philomat/django-form-designer', - license = 'BSD', - description = "Design contact forms, search forms etc from the Django admin, without writing any code. Integrates with Django CMS.", - long_description = README, + name="django-form-designer", + version="0.8.0", + url='https://github.com/samluescher/django-form-designer', + license='BSD', + description="Design contact forms, search forms etc from the Django admin," + " without writing any code. Integrates with Django CMS.", + long_description=README, - author = 'Samuel Luescher', - author_email = 'sam at luescher dot org', - packages = [ + author='Samuel Luescher', + author_email='sam at luescher dot org', + install_requires=read_requirements(), + packages=[ 'form_designer', 'form_designer.migrations', 'form_designer.templatetags', @@ -26,7 +37,7 @@ def read(fname): 'form_designer.contrib.cms_plugins', 'form_designer.contrib.cms_plugins.form_designer_form', ], - package_data = { + package_data={ 'form_designer': [ 'static/form_designer/js/*.js', 'templates/admin/form_designer/formlog/change_list.html', @@ -37,7 +48,7 @@ def read(fname): 'locale/*/LC_MESSAGES/*', ], }, - classifiers = [ + classifiers=[ 'Development Status :: 4 - Beta', 'Framework :: Django', 'Intended Audience :: Developers',