Skip to content

Commit

Permalink
Added various missing files to make this a real Python package.
Browse files Browse the repository at this point in the history
Fix bug #2.
  • Loading branch information
jezdez committed Oct 5, 2014
1 parent b11c437 commit 6be811f
Show file tree
Hide file tree
Showing 11 changed files with 350 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
source = formtools
branch = 1

[report]
omit = localflavor/*tests*
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8

[*.bat]
end_of_line = crlf
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.pyc
.*.swp
MANIFEST
build
dist
*.egg-info
docs/_build
.tox/
*.egg/
.coverage
9 changes: 9 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[main]
host = https://www.transifex.com
lang_map = sr@latin:sr_Latn
type = PO

[django-formtools.main]
file_filter = formtools/locale/<lang>/LC_MESSAGES/django.po
source_file = formtools/locale/en/LC_MESSAGES/django.po
source_lang = en
48 changes: 48 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Authors
=======

* Adam Haney
* Adrian Holovaty
* Alasdair Nicol
* Alex Gaynor
* Andrew Godwin
* Anubhav Joshi
* Areski Belaid
* Aymeric Augustin
* Berker Peksag
* Bouke Haarsma
* Carl Meyer
* Christopher Medrela
* Claude Paroz
* Curtis Maloney
* Erik Romijn
* Florian Apolloner
* Gary Wilson Jr
* Hiroki Kiyohara
* Honza Král
* Ian Clelland
* Ilya Baryshev
* Jacob Kaplan-Moss
* James Jenkins
* Jannis Leidel
* Jason Myers
* Julian Wachholz
* Julien Phalip
* Justin Bronn
* Karen Tracey
* Kathryn Killebrew
* Kent Hauser
* Loic Bistuer
* Luke Plant
* Malcolm Tredinnick
* Maurycy
* Preston Holmes
* Preston Timmons
* Ramiro Morales
* Rodolfo Carvalho
* Russell Keith-Magee
* Simon Charette
* Stephan Jaekel
* Tim Graham
* Trey Hunner
* Vishal Lal
60 changes: 60 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
================================
Contributing to django-formtools
================================

As an open source project, django-formtools welcomes contributions of many
forms, similar to its origin in the Django framework.

Examples of contributions include:

* Code patches
* Documentation improvements
* Bug reports and patch reviews

Extensive contribution guidelines are available online at:

https://docs.djangoproject.com/en/dev/internals/contributing/

`File a ticket`__ to suggest changes or send pull requests.

django-formtools uses Github's issue system to keep track of bugs, feature
requests, and pull requests for patches.

Running tests is as simple as `installing Tox`__ and running it in the root
Git clone directory::

$ git clone https://github.com/django/django-formtools
[..]
$ cd django-formtools
$ tox
[..]
congratulations :)

The previous command will run the tests in different combinations of Python
(if available) and Django versions. To see the full list of combinations use
the ``-l`` option::

$ tox -l
py26-1.5
py26-1.6
py27-1.5
py27-1.6
py32-1.5
py32-1.6
py33-1.5
py33-1.6

You can run each environment with the ``-e`` option::

$ tox -e py27-1.6 # runs the tests only on Pyton 2.7 and Django 1.6.x

Optionally you can also specify a country whose tests you want to run::

$ COUNTRY=us tox

And combine both options::

$ COUNTRY=us tox -e py27-1.6

__ https://github.com/django/django-formtools/issues
__ http://tox.readthedocs.org/en/latest/install.html
27 changes: 27 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) Django Software Foundation and individual contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

3. Neither the name of django-formtools nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10 changes: 10 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include LICENSE
include AUTHORS.rst
include README.rst
include CONTRIBUTING.rst
include tasks.py
include tox.ini
include .coveragerc
recursive-include formtools/locale *.po *.mo
recursive-include docs *
recursive-include tests *
22 changes: 22 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
================
django-formtools
================

.. image:: https://secure.travis-ci.org/django/django-formtools.png
:target: http://travis-ci.org/django/django-formtools

.. image:: https://coveralls.io/repos/django/django-formtools/badge.png?branch=master
:target: https://coveralls.io/r/django/django-formtools

Django's "formtools" is a set of high-level abstractions for Django forms.
Currently for form previews and multi-step forms.

This code used to live in Django proper -- in ``django.contrib.formtools``
-- but was separated into a standalone package in Django 1.8 to keep the
framework's core clean.

For a full list of available formtoolss, see
http://django-formtools.readthedocs.org/

django-formtools can also be found on and installed from the Python
Package Index: https://pypi.python.org/pypi/django-formtools
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[metadata]
license-file = LICENSE

[wheel]
universal=1
139 changes: 139 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import os
import re
import sys
import codecs
from fnmatch import fnmatchcase
from distutils.util import convert_path
from setuptools import setup, find_packages


def read(*parts):
filename = os.path.join(os.path.dirname(__file__), *parts)
with codecs.open(filename, encoding='utf-8') as fp:
return fp.read()


def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")


# Provided as an attribute, so you can append to these instead
# of replicating them:
standard_exclude = ('*.py', '*.pyc', '*$py.class', '*~', '.*', '*.bak')
standard_exclude_directories = ('.*', 'CVS', '_darcs', './build',
'./dist', 'EGG-INFO', '*.egg-info')


# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
# Note: you may want to copy this into your setup.py file verbatim, as
# you can't import this from another package, when you don't know if
# that package is installed yet.
def find_package_data(where='.', package='',
exclude=standard_exclude,
exclude_directories=standard_exclude_directories,
only_in_packages=True,
show_ignored=False):
"""
Return a dictionary suitable for use in ``package_data``
in a distutils ``setup.py`` file.
The dictionary looks like::
{'package': [files]}
Where ``files`` is a list of all the files in that package that
don't match anything in ``exclude``.
If ``only_in_packages`` is true, then top-level directories that
are not packages won't be included (but directories under packages
will).
Directories matching any pattern in ``exclude_directories`` will
be ignored; by default directories with leading ``.``, ``CVS``,
and ``_darcs`` will be ignored.
If ``show_ignored`` is true, then all the files that aren't
included in package data are shown on stderr (for debugging
purposes).
Note patterns use wildcards, or can be exact paths (including
leading ``./``), and all searching is case-insensitive.
"""

out = {}
stack = [(convert_path(where), '', package, only_in_packages)]
while stack:
where, prefix, package, only_in_packages = stack.pop(0)
for name in os.listdir(where):
fn = os.path.join(where, name)
if os.path.isdir(fn):
bad_name = False
for pattern in exclude_directories:
if (fnmatchcase(name, pattern) or fn.lower() == pattern.lower()):
bad_name = True
if show_ignored:
print >> sys.stderr, (
"Directory %s ignored by pattern %s"
% (fn, pattern))
break
if bad_name:
continue
if (os.path.isfile(os.path.join(fn, '__init__.py')) and not prefix):
if not package:
new_package = name
else:
new_package = package + '.' + name
stack.append((fn, '', new_package, False))
else:
stack.append((fn, prefix + name + '/', package, only_in_packages))
elif package or not only_in_packages:
# is a file
bad_name = False
for pattern in exclude:
if (fnmatchcase(name, pattern) or fn.lower() == pattern.lower()):
bad_name = True
if show_ignored:
print >> sys.stderr, (
"File %s ignored by pattern %s"
% (fn, pattern))
break
if bad_name:
continue
out.setdefault(package, []).append(prefix + name)
return out

setup(
name="django-formtools",
version=find_version("formtools", "__init__.py"),
url='http://django-formtools.readthedocs.org/en/latest/',
license='BSD',
description="A set of high-level abstractions for Django forms",
# long_description=read('README.rst'),
author='Django Software Foundation',
author_email='[email protected]',
packages=find_packages(exclude=['tests', 'tests.*']),
package_data=find_package_data(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Topic :: Internet :: WWW/HTTP',
],
zip_safe=False,
)

0 comments on commit 6be811f

Please sign in to comment.