Merge branch 'master' of ssh://github.com/birkenfeld/flask

This commit is contained in:
Georg Brandl 2010-08-27 23:55:31 +02:00
commit d07b055d7a
13 changed files with 147 additions and 123 deletions

1
.gitignore vendored
View file

@ -7,3 +7,4 @@ dist
*.egg *.egg
*.egg-info *.egg-info
_mailinglist _mailinglist
.tox

View file

@ -3,10 +3,16 @@ Flask Changelog
Here you can see the full list of changes between each Flask release. Here you can see the full list of changes between each Flask release.
Version 0.7
-----------
Release date to be announced, codename to be selected
Version 0.6 Version 0.6
----------- -----------
Release date to be announced, codename to be decided. Released on July 27th 2010, codename Whisky
- after request functions are now called in reverse order of - after request functions are now called in reverse order of
registration. registration.

View file

@ -1,4 +1,5 @@
include Makefile CHANGES LICENSE AUTHORS include Makefile CHANGES LICENSE AUTHORS
recursive-include artwork *
recursive-include tests * recursive-include tests *
recursive-include examples * recursive-include examples *
recursive-include docs * recursive-include docs *

View file

@ -5,6 +5,9 @@ all: clean-pyc test
test: test:
python setup.py test python setup.py test
tox-test:
PYTHONDONTWRITEBYTECODE= tox
ext-test: ext-test:
python tests/flaskext_test.py --browse python tests/flaskext_test.py --browse

@ -1 +0,0 @@
Subproject commit 3d964b660442e23faedf801caed6e3c7bd42d5c9

View file

@ -314,8 +314,10 @@ extension to be approved you have to follow these guidelines:
link to the documentation, website (if there is one) and there link to the documentation, website (if there is one) and there
must be a link to automatically install the development version must be a link to automatically install the development version
(``PackageName==dev``). (``PackageName==dev``).
9. The ``zip_safe`` flag in the setup scrip must be set to ``False``, 9. The ``zip_safe`` flag in the setup script must be set to ``False``,
even if the extension would be safe for zipping. even if the extension would be safe for zipping.
10. An extension currently has to support Python 2.5, 2.6 as well as
Python 2.7
.. _Flask Extension Wizard: .. _Flask Extension Wizard:

View file

@ -40,8 +40,8 @@ was implemented in Flask itself. There are currently extensions for
object relational mappers, form validation, upload handling, various open object relational mappers, form validation, upload handling, various open
authentication technologies and more. authentication technologies and more.
However Flask is not much code and built in a very solid foundation and However Flask is not much code and it is built on a very solid foundation
with that very easy to adapt for large applications. If you are and with that it is very easy to adapt for large applications. If you are
interested in that, check out the :ref:`becomingbig` chapter. interested in that, check out the :ref:`becomingbig` chapter.
If you are curious about the Flask design principles, head over to the If you are curious about the Flask design principles, head over to the

View file

@ -31,7 +31,7 @@ Continuing long statements:
.order_by(MyModel.name.desc()) \ .order_by(MyModel.name.desc()) \
.limit(10) .limit(10)
If you break in a statement with parentheses or brances, align to the If you break in a statement with parentheses or braces, align to the
braces:: braces::
this_is_a_very_long(function_call, 'with many parameters', this_is_a_very_long(function_call, 'with many parameters',
@ -105,8 +105,8 @@ Yoda statements are a nogo:
pass pass
Comparisons: Comparisons:
- against arbitary types: ``==`` and ``!=`` - against arbitrary types: ``==`` and ``!=``
- against singletones with ``is`` and ``is not`` (eg: ``foo is not - against singletons with ``is`` and ``is not`` (eg: ``foo is not
None``) None``)
- never compare something with `True` or `False` (for example never - never compare something with `True` or `False` (for example never
do ``foo == False``, do ``not foo`` instead) do ``foo == False``, do ``not foo`` instead)
@ -125,7 +125,7 @@ Naming Conventions
- Class names: ``CamelCase``, with acronyms kept uppercase (``HTTPWriter`` - Class names: ``CamelCase``, with acronyms kept uppercase (``HTTPWriter``
and not ``HttpWriter``) and not ``HttpWriter``)
- Variable names: ``lowercase_with_underscores`` - Variable names: ``lowercase_with_underscores``
- Method and functin names: ``lowercase_with_underscores`` - Method and function names: ``lowercase_with_underscores``
- Constants: ``UPPERCASE_WITH_UNDERSCORES`` - Constants: ``UPPERCASE_WITH_UNDERSCORES``
- precompiled regular expressions: ``name_re`` - precompiled regular expressions: ``name_re``
@ -151,9 +151,9 @@ Docstrings
Docstring conventions: Docstring conventions:
All docstrings are formatted with reStructuredText as understood by All docstrings are formatted with reStructuredText as understood by
Sphinx. Depending on the number of lines in the docstring, they are Sphinx. Depending on the number of lines in the docstring, they are
layed out differently. If it's just one line, the closing tripple layed out differently. If it's just one line, the closing triple
quote is on the same line as the opening, otherwise the text is on quote is on the same line as the opening, otherwise the text is on
the same line as the opening quote and the tripple quote that closes the same line as the opening quote and the triple quote that closes
the string on its own line:: the string on its own line::
def foo(): def foo():

View file

@ -42,3 +42,83 @@ Flask-Creole
Notes: Flask-Markdown and this should share API, consider that when Notes: Flask-Markdown and this should share API, consider that when
approving Flask-Markdown approving Flask-Markdown
Flask-Genshi
------------
:First Approval: 2010-07-26
:Last Review: 2010-07-26
:Approved Version: 0.3.1
:Approved License: BSD
Notes: This is the first template engine extension. When others come
around it would be a good idea to decide on a common interface.
Flask-Script
------------
:First Approval: 2010-07-26
:Last Review: 2010-07-26
:Approved Version: 0.3
:Approved License: BSD
Notes: Flask-Actions has some overlap. Consider that when approving
Flask-Actions or similar packages.
Flask-CouchDB
-------------
:First Approval: 2010-07-26
:Last Review: 2010-07-26
:Approved Version: 0.2.1
:Approved License: MIT
There is also Flask-CouchDBKit. Both are fine because they are doing
different things, but the latter is not yet approved.
Flask-Testing
-------------
:First Approval: 2010-07-27
:Last Review: 2010-07-27
:Approved Version: 0.2.3
:Approved License: BSD
All fine.
Flask-WTF
---------
:First Approval: 2010-07-27
:Last Review: 2010-07-27
:Approved Version: 0.2.3
:Approved License: BSD
All fine.
Flask-Themes
------------
:First Approval: 2010-07-27
:Last Review: 2010-07-27
:Approved Version: 0.1.2
:Approved License: MIT
All fine.
Flask-Uploads
-------------
:First Approval: 2010-07-27
:Last Review: 2010-07-27
:Approved Version: 0.1.2
:Approved License: MIT
All fine.

View file

@ -6,17 +6,6 @@ extension is on the list of extensions on the website. It does not
contain extensions that are approved. contain extensions that are approved.
Flask-CouchDB
-------------
:Last-Review: 2010-07-25
:Reviewed version: 0.2
Would be fine for approval, but the test suite is not part of the sdist
package (missing entry in MANIFEST.in) and the test suite does not respond
to either "make test" or "python setup.py test".
Flask-CouchDBKit Flask-CouchDBKit
---------------- ----------------
@ -43,19 +32,6 @@ Name is not following Flask extension naming rules.
Considered for unlisting. Considered for unlisting.
Flask-Genshi
------------
:Last-Review: 2010-07-25
:Reviewed Version: 0.3
Would be fine for approval, but the test suite is not part of the sdist
package (missing entry in MANIFEST.in) and the test suite does not respond
to either "make test" or "python setup.py test". Furthermore the long
description is empty. The zip_safe flag is not set to False which is a
requirement for approved extensions.
flask-lesscss flask-lesscss
------------- -------------
@ -70,22 +46,6 @@ Considered for unlisting, improved version should release as
as a testsuite. as a testsuite.
flask-mail
----------
:Last-Review: 2010-07-25
:Reviewed Version: 0.3.1
Would be fine for approval, but the test suite is not part of the sdist
package (missing entry in MANIFEST.in) and the test suite does not respond
to either "make test" or "python setup.py test". Furthermore the long
description in the package index is a little bit too short.
Package name should be changed to Flask-Mail with the approval to be
consistent, this might also be the change to improve the API if necessary,
but I don't see any big design problems there.
Flask-OAuth Flask-OAuth
----------- -----------
@ -104,64 +64,6 @@ Flask-OpenID
Short long description, missing tests. Short long description, missing tests.
Flask-Script
------------
:Last-Review: 2010-07-25
:Reviewed Version: 0.2
Would be fine for approval, but the test suite is not part of the sdist
package (missing entry in MANIFEST.in) and the test suite does not respond
to either "make test" or "python setup.py test".
The upcoming 0.3 release looks promising, could need a longer "long
description" in the package index though.
Flask-Testing
-------------
:Last-Review: 2010-07-25
:Reviewed Version: 0.2
Would be fine for approval, but the test suite is not part of the sdist
package (missing entry in MANIFEST.in) and the test suite does not respond
to either "make test" or "python setup.py test".
Flask-Themes
------------
:Last-Review: 2010-07-25
:Reviewed Version: 0.1
Would be fine for approval, but the test suite is not part of the sdist
package (missing entry in MANIFEST.in) and the test suite does not respond
to either "make test" or "python setup.py test".
Flask-Uploads
-------------
:Last-Review: 2010-07-25
:Reviewed Version: 0.1
Would be fine for approval, but the test suite is not part of the sdist
package (missing entry in MANIFEST.in) and the test suite does not respond
to either "make test" or "python setup.py test".
Flask-WTF
---------
:Last-Review: 2010-07-25
:Reviewed Version: 0.2.1
Would be fine for approval, but the test suite is not part of the sdist
package (missing entry in MANIFEST.in) and the test suite does not respond
to either "make test" or "python setup.py test".
Flask-XML-RPC Flask-XML-RPC
------------- -------------

View file

@ -50,7 +50,7 @@ def run_tests():
setup( setup(
name='Flask', name='Flask',
version='0.6', version='0.7',
url='http://github.com/mitsuhiko/flask/', url='http://github.com/mitsuhiko/flask/',
license='BSD', license='BSD',
author='Armin Ronacher', author='Armin Ronacher',

View file

@ -27,13 +27,20 @@ from setuptools.archive_util import unpack_archive
flask_svc_url = 'http://flask.pocoo.org/extensions/' flask_svc_url = 'http://flask.pocoo.org/extensions/'
# OS X has awful paths when using mkstemp or gettempdir(). I don't
# care about security or clashes here, so pick something that is
# actually rememberable.
if sys.platform == 'darwin': if sys.platform == 'darwin':
_tempdir = '/private/tmp' _tempdir = '/private/tmp'
else: else:
_tempdir = tempfile.gettempdir() _tempdir = tempfile.gettempdir()
tdir = _tempdir + '/flaskext-test' tdir = _tempdir + '/flaskext-test'
flaskdir = os.path.abspath(os.path.join(os.path.dirname(__file__), flaskdir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
'..'))
# virtualenv hack *cough*
os.environ['PYTHONDONTWRITEBYTECODE'] = ''
RESULT_TEMPATE = u'''\ RESULT_TEMPATE = u'''\
@ -74,6 +81,9 @@ RESULT_TEMPATE = u'''\
<th>Author <th>Author
<th>License <th>License
<th>Outcome <th>Outcome
{%- for iptr, _ in results[0].logs|dictsort %}
<th>{{ iptr }}
{%- endfor %}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -85,6 +95,9 @@ RESULT_TEMPATE = u'''\
<td>{{ result.author }} <td>{{ result.author }}
<td>{{ result.license }} <td>{{ result.license }}
<td>{{ outcome }} <td>{{ outcome }}
{%- for iptr, _ in result.logs|dictsort %}
<td><a href="#{{ result.name }}-{{ iptr }}">see log</a>
{%- endfor %}
</tr> </tr>
{%- endfor %} {%- endfor %}
</tbody> </tbody>
@ -93,7 +106,8 @@ RESULT_TEMPATE = u'''\
<p>Detailed test logs for all tests on all platforms: <p>Detailed test logs for all tests on all platforms:
{%- for result in results %} {%- for result in results %}
{%- for iptr, log in result.logs|dictsort %} {%- for iptr, log in result.logs|dictsort %}
<h3>{{ result.name }} - {{ result.version }} [{{ iptr }}]</h3> <h3 id="{{ result.name }}-{{ iptr }}">
{{ result.name }} - {{ result.version }} [{{ iptr }}]</h3>
<pre>{{ log }}</pre> <pre>{{ log }}</pre>
{%- endfor %} {%- endfor %}
{%- endfor %} {%- endfor %}
@ -186,14 +200,16 @@ tox_template = """[tox]
envlist=%(env)s envlist=%(env)s
[testenv] [testenv]
deps=%(deps)s deps=
%(deps)s
py
commands=bash flaskext-runtest.sh {envlogdir}/test.log commands=bash flaskext-runtest.sh {envlogdir}/test.log
downloadcache=%(cache)s downloadcache=%(cache)s
""" """
def create_tox_ini(checkout_path, interpreters, flask_dep): def create_tox_ini(checkout_path, interpreters, flask_dep):
tox_path = os.path.join(checkout_path, 'tox.ini') tox_path = os.path.join(checkout_path, 'tox-flask-test.ini')
if not os.path.exists(tox_path): if not os.path.exists(tox_path):
with open(tox_path, 'w') as f: with open(tox_path, 'w') as f:
f.write(tox_template % { f.write(tox_template % {
@ -201,6 +217,7 @@ def create_tox_ini(checkout_path, interpreters, flask_dep):
'cache': tdir, 'cache': tdir,
'deps': flask_dep 'deps': flask_dep
}) })
return tox_path
def iter_extensions(only_approved=True): def iter_extensions(only_approved=True):
@ -228,23 +245,20 @@ def test_extension(name, interpreters, flask_dep):
# if there is a tox.ini, remove it, it will cause troubles # if there is a tox.ini, remove it, it will cause troubles
# for us. Remove it if present, we are running tox ourselves # for us. Remove it if present, we are running tox ourselves
# afterall. # afterall.
toxini = os.path.join(checkout_path, 'tox.ini')
if os.path.isfile(toxini):
os.remove(toxini)
create_tox_ini(checkout_path, interpreters, flask_dep) create_tox_ini(checkout_path, interpreters, flask_dep)
rv = subprocess.call(['tox'], cwd=checkout_path) rv = subprocess.call(['tox', '-c', 'tox-flask-test.ini'], cwd=checkout_path)
return TestResult(name, checkout_path, rv, interpreters) return TestResult(name, checkout_path, rv, interpreters)
def run_tests(interpreters, only_approved=True): def run_tests(extensions, interpreters):
results = {} results = {}
create_tdir() create_tdir()
log('Packaging Flask') log('Packaging Flask')
flask_dep = package_flask() flask_dep = package_flask()
log('Running extension tests') log('Running extension tests')
log('Temporary Environment: %s', tdir) log('Temporary Environment: %s', tdir)
for name in iter_extensions(only_approved): for name in extensions:
log('Testing %s', name) log('Testing %s', name)
result = test_extension(name, interpreters, flask_dep) result = test_extension(name, interpreters, flask_dep)
if result.success: if result.success:
@ -272,10 +286,21 @@ def main():
help='run against all extensions, not just approved') help='run against all extensions, not just approved')
parser.add_argument('--browse', dest='browse', action='store_true', parser.add_argument('--browse', dest='browse', action='store_true',
help='show browser with the result summary') help='show browser with the result summary')
parser.add_argument('--env', dest='env', default='py25,py26,py27',
help='the tox environments to run against')
parser.add_argument('--extension=', dest='extension', default=None,
help='tests a single extension')
args = parser.parse_args() args = parser.parse_args()
results = run_tests(['py26'], not args.all) if args.extension is not None:
filename = render_results(results, not args.all) only_approved = False
extensions = [args.extension]
else:
only_approved = not args.all
extensions = iter_extensions(only_approved)
results = run_tests(extensions, [x.strip() for x in args.env.split(',')])
filename = render_results(results, only_approved)
if args.browse: if args.browse:
import webbrowser import webbrowser
webbrowser.open('file:///' + filename.lstrip('/')) webbrowser.open('file:///' + filename.lstrip('/'))

5
tox.ini Normal file
View file

@ -0,0 +1,5 @@
[tox]
envlist=py25,py26,py27
[testenv]
commands=make test