From 63a37b75aca15085e685d99f8b7a2e79c83e1f57 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 26 Jul 2010 00:36:09 +0200 Subject: [PATCH 01/19] Improved extension test runner --- tests/flaskext_test.py | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/tests/flaskext_test.py b/tests/flaskext_test.py index c7eb37df..7a1f179b 100644 --- a/tests/flaskext_test.py +++ b/tests/flaskext_test.py @@ -74,6 +74,9 @@ RESULT_TEMPATE = u'''\ Author License Outcome + {%- for iptr, _ in results[0].logs|dictsort %} + {{ iptr }} + {%- endfor %} @@ -85,6 +88,9 @@ RESULT_TEMPATE = u'''\ {{ result.author }} {{ result.license }} {{ outcome }} + {%- for iptr, _ in result.logs|dictsort %} + see log + {%- endfor %} {%- endfor %} @@ -93,7 +99,8 @@ RESULT_TEMPATE = u'''\

Detailed test logs for all tests on all platforms: {%- for result in results %} {%- for iptr, log in result.logs|dictsort %} -

{{ result.name }} - {{ result.version }} [{{ iptr }}]

+

+ {{ result.name }} - {{ result.version }} [{{ iptr }}]

{{ log }}
{%- endfor %} {%- endfor %} @@ -237,14 +244,14 @@ def test_extension(name, interpreters, flask_dep): return TestResult(name, checkout_path, rv, interpreters) -def run_tests(interpreters, only_approved=True): +def run_tests(extensions, interpreters): results = {} create_tdir() log('Packaging Flask') flask_dep = package_flask() log('Running extension tests') log('Temporary Environment: %s', tdir) - for name in iter_extensions(only_approved): + for name in extensions: log('Testing %s', name) result = test_extension(name, interpreters, flask_dep) if result.success: @@ -272,10 +279,21 @@ def main(): help='run against all extensions, not just approved') parser.add_argument('--browse', dest='browse', action='store_true', 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() - results = run_tests(['py26'], not args.all) - filename = render_results(results, not args.all) + if args.extension is not None: + 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: import webbrowser webbrowser.open('file:///' + filename.lstrip('/')) From 140fc45ebd052ea07492c068e45d755d4b42c65c Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 26 Jul 2010 00:59:41 +0200 Subject: [PATCH 02/19] Added another workaround. the extension tester is now a pile of hacks --- tests/flaskext_test.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/flaskext_test.py b/tests/flaskext_test.py index 7a1f179b..84f28b57 100644 --- a/tests/flaskext_test.py +++ b/tests/flaskext_test.py @@ -36,6 +36,10 @@ flaskdir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) +# virtualenv hack *cough* +os.environ['PYTHONDONTWRITEBYTECODE'] = '' + + RESULT_TEMPATE = u'''\ Flask-Extension Test Results From 8bd8b014a8393d4b94e6fd192b64e3a2d2f65fce Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 26 Jul 2010 02:30:52 +0200 Subject: [PATCH 03/19] Small fixes in the extension tester --- tests/flaskext_test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/flaskext_test.py b/tests/flaskext_test.py index 84f28b57..6b669475 100644 --- a/tests/flaskext_test.py +++ b/tests/flaskext_test.py @@ -27,13 +27,16 @@ from setuptools.archive_util import unpack_archive 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': _tempdir = '/private/tmp' else: _tempdir = tempfile.gettempdir() 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* From 4ab21cd7489e6a7b4e64beda7d8e44fd93557964 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 26 Jul 2010 02:30:58 +0200 Subject: [PATCH 04/19] Approved Flask-Genshi --- extreview/approved.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/extreview/approved.rst b/extreview/approved.rst index 526a181a..a23f5cf8 100644 --- a/extreview/approved.rst +++ b/extreview/approved.rst @@ -42,3 +42,13 @@ Flask-Creole Notes: Flask-Markdown and this should share API, consider that when approving Flask-Markdown + + +Flask-Genshi +------------ + +:Last-Review: 2010-07-26 +:Reviewed Version: 0.3.1 + +Notes: This is the first template engine extension. When others come +around it would be a good idea to decide on a common interface. From c468ad0bfe8608d28e65a0a2c8ba1093dbd7167c Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 26 Jul 2010 02:37:16 +0200 Subject: [PATCH 05/19] Forgot to unlist flask-genshi --- extreview/listed.rst | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/extreview/listed.rst b/extreview/listed.rst index a54c8a77..c5b38b02 100644 --- a/extreview/listed.rst +++ b/extreview/listed.rst @@ -43,19 +43,6 @@ Name is not following Flask extension naming rules. 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 ------------- From 6aeb6a09aff3115466eb39253ec236ec98348d9e Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 26 Jul 2010 02:52:05 +0200 Subject: [PATCH 06/19] Added standard dep on py because some extensions might use py.test and the default available version is on the wrong python path --- tests/flaskext_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/flaskext_test.py b/tests/flaskext_test.py index 6b669475..11cb9fb0 100644 --- a/tests/flaskext_test.py +++ b/tests/flaskext_test.py @@ -200,7 +200,9 @@ tox_template = """[tox] envlist=%(env)s [testenv] -deps=%(deps)s +deps= + %(deps)s + py commands=bash flaskext-runtest.sh {envlogdir}/test.log downloadcache=%(cache)s """ From 89ed7e616e8b1bd16285703e44ecb40c953671cb Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 26 Jul 2010 13:20:46 +0200 Subject: [PATCH 07/19] Approved Flask-Script --- extreview/approved.rst | 18 ++++++++++++++++-- extreview/listed.rst | 14 -------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/extreview/approved.rst b/extreview/approved.rst index a23f5cf8..0e404ac8 100644 --- a/extreview/approved.rst +++ b/extreview/approved.rst @@ -47,8 +47,22 @@ approving Flask-Markdown Flask-Genshi ------------ -:Last-Review: 2010-07-26 -:Reviewed Version: 0.3.1 +: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. diff --git a/extreview/listed.rst b/extreview/listed.rst index c5b38b02..f39a0e20 100644 --- a/extreview/listed.rst +++ b/extreview/listed.rst @@ -91,20 +91,6 @@ Flask-OpenID 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 ------------- From 27ce5cc0a139d06ed83bd60ace20ad38cdf4ec8f Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 26 Jul 2010 16:02:36 +0200 Subject: [PATCH 08/19] Added another rule to the approval list. 2.5-2.7 compatibility --- docs/extensiondev.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/extensiondev.rst b/docs/extensiondev.rst index c2a6d2f7..1505e69c 100644 --- a/docs/extensiondev.rst +++ b/docs/extensiondev.rst @@ -316,6 +316,8 @@ extension to be approved you have to follow these guidelines: (``PackageName==dev``). 9. The ``zip_safe`` flag in the setup scrip must be set to ``False``, 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: From 3da165f2f56fe7f1b71242157fd4d02d3e37128f Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 26 Jul 2010 17:14:17 +0200 Subject: [PATCH 09/19] Fixed typo --- docs/extensiondev.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extensiondev.rst b/docs/extensiondev.rst index 1505e69c..44633b33 100644 --- a/docs/extensiondev.rst +++ b/docs/extensiondev.rst @@ -314,7 +314,7 @@ extension to be approved you have to follow these guidelines: link to the documentation, website (if there is one) and there must be a link to automatically install the development version (``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. 10. An extension currently has to support Python 2.5, 2.6 as well as Python 2.7 From 2594602076e223f237a5cf4d0f8742ebc3ad3ab1 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 26 Jul 2010 17:14:25 +0200 Subject: [PATCH 10/19] Approved Flask-CouchDB --- extreview/approved.rst | 12 ++++++++++++ extreview/listed.rst | 16 ---------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/extreview/approved.rst b/extreview/approved.rst index 0e404ac8..59dc2e54 100644 --- a/extreview/approved.rst +++ b/extreview/approved.rst @@ -66,3 +66,15 @@ Flask-Script 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. diff --git a/extreview/listed.rst b/extreview/listed.rst index f39a0e20..c4a436c8 100644 --- a/extreview/listed.rst +++ b/extreview/listed.rst @@ -57,22 +57,6 @@ Considered for unlisting, improved version should release as 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 ----------- From c18f032a822fa6db560c440d7faa7c615826aa30 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 27 Jul 2010 01:29:21 +0200 Subject: [PATCH 11/19] Added a tox-test command that runs Flask tests with tox --- .gitignore | 1 + Makefile | 3 +++ tox.ini | 5 +++++ 3 files changed, 9 insertions(+) create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 4844be8e..5c012aaa 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ dist *.egg *.egg-info _mailinglist +.tox diff --git a/Makefile b/Makefile index 8055e8ef..ab0a8d97 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,9 @@ all: clean-pyc test test: python setup.py test +tox-test: + PYTHONDONTWRITEBYTECODE= tox + ext-test: python tests/flaskext_test.py --browse diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..15911b4c --- /dev/null +++ b/tox.ini @@ -0,0 +1,5 @@ +[tox] +envlist=py25,py26,py27 + +[testenv] +commands=make test From 28f7c1956bc60a81be9a9e5935d72d25b444f3f3 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 27 Jul 2010 14:10:42 +0200 Subject: [PATCH 12/19] Approved WTF and Testing --- extreview/approved.rst | 22 ++++++++++++++++++++++ extreview/listed.rst | 33 --------------------------------- 2 files changed, 22 insertions(+), 33 deletions(-) diff --git a/extreview/approved.rst b/extreview/approved.rst index 59dc2e54..13db5e66 100644 --- a/extreview/approved.rst +++ b/extreview/approved.rst @@ -78,3 +78,25 @@ Flask-CouchDB 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. diff --git a/extreview/listed.rst b/extreview/listed.rst index c4a436c8..efd8571b 100644 --- a/extreview/listed.rst +++ b/extreview/listed.rst @@ -6,17 +6,6 @@ extension is on the list of extensions on the website. It does not 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 ---------------- @@ -75,17 +64,6 @@ Flask-OpenID Short long description, missing tests. -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 ------------ @@ -108,17 +86,6 @@ 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 ------------- From 5cadd9d34da46b909f91a5379d41b90f258d5998 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 27 Jul 2010 14:38:59 +0200 Subject: [PATCH 13/19] Picked codename for 0.6 --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c1f50998..54a65836 100644 --- a/CHANGES +++ b/CHANGES @@ -6,7 +6,7 @@ Here you can see the full list of changes between each Flask release. 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 registration. From 16b101edb6c10a984b0f2960feeeca5a458845a1 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 27 Jul 2010 14:40:21 +0200 Subject: [PATCH 14/19] HEAD is 0.7-dev --- CHANGES | 6 ++++++ setup.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 54a65836..a195fd1f 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,12 @@ Flask Changelog 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 ----------- diff --git a/setup.py b/setup.py index b97a33f7..78bd25d0 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ def run_tests(): setup( name='Flask', - version='0.6', + version='0.7', url='http://github.com/mitsuhiko/flask/', license='BSD', author='Armin Ronacher', From 3e297e89d895262e4cf18bfa860f83fbe4b86a61 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 27 Jul 2010 17:15:20 +0200 Subject: [PATCH 15/19] Approved Flask-Themes and Flask-Uploads --- extreview/approved.rst | 22 ++++++++++++++++++++++ extreview/listed.rst | 22 ---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/extreview/approved.rst b/extreview/approved.rst index 13db5e66..78299933 100644 --- a/extreview/approved.rst +++ b/extreview/approved.rst @@ -100,3 +100,25 @@ Flask-WTF :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. diff --git a/extreview/listed.rst b/extreview/listed.rst index efd8571b..7510c8ac 100644 --- a/extreview/listed.rst +++ b/extreview/listed.rst @@ -64,28 +64,6 @@ Flask-OpenID Short long description, missing tests. -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-XML-RPC ------------- From 750c3a07d8a82bde3cf8d60c7ef29e26ef149a1c Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 27 Jul 2010 18:46:29 +0200 Subject: [PATCH 16/19] Added artwork to MANIFEST.in --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index 166311d4..3fef8b5b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ include Makefile CHANGES LICENSE AUTHORS +recursive-include artwork * recursive-include tests * recursive-include examples * recursive-include docs * From 3561a398b1a9ad4cfe7f056fe10811930f54b502 Mon Sep 17 00:00:00 2001 From: Aku Kotkavuo Date: Wed, 28 Jul 2010 05:27:10 +0800 Subject: [PATCH 17/19] Made one sentence easier to parse in docs/foreword --- docs/foreword.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/foreword.rst b/docs/foreword.rst index 3a7521d4..308de9c5 100644 --- a/docs/foreword.rst +++ b/docs/foreword.rst @@ -40,8 +40,8 @@ was implemented in Flask itself. There are currently extensions for object relational mappers, form validation, upload handling, various open authentication technologies and more. -However Flask is not much code and built in a very solid foundation and -with that very easy to adapt for large applications. If you are +However Flask is not much code and it is built on a very solid foundation +and with that it is very easy to adapt for large applications. If you are interested in that, check out the :ref:`becomingbig` chapter. If you are curious about the Flask design principles, head over to the From 4cd5201cdd03e14edbceb24620717bbe82300524 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Mon, 26 Jul 2010 14:45:05 +0800 Subject: [PATCH 18/19] use custom tox file named tox-flask-test.ini, dont delete the real tox.ini --- tests/flaskext_test.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/flaskext_test.py b/tests/flaskext_test.py index 11cb9fb0..9dc9ad67 100644 --- a/tests/flaskext_test.py +++ b/tests/flaskext_test.py @@ -209,7 +209,7 @@ downloadcache=%(cache)s 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): with open(tox_path, 'w') as f: f.write(tox_template % { @@ -217,6 +217,7 @@ def create_tox_ini(checkout_path, interpreters, flask_dep): 'cache': tdir, 'deps': flask_dep }) + return tox_path def iter_extensions(only_approved=True): @@ -244,12 +245,9 @@ def test_extension(name, interpreters, flask_dep): # if there is a tox.ini, remove it, it will cause troubles # for us. Remove it if present, we are running tox ourselves # 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) - 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) From 0906f7d58930e047f7ec67290997b552e587e219 Mon Sep 17 00:00:00 2001 From: florentx Date: Wed, 28 Jul 2010 00:19:47 +0800 Subject: [PATCH 19/19] Typos. --- docs/_themes | 1 - docs/styleguide.rst | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) delete mode 160000 docs/_themes diff --git a/docs/_themes b/docs/_themes deleted file mode 160000 index 3d964b66..00000000 --- a/docs/_themes +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3d964b660442e23faedf801caed6e3c7bd42d5c9 diff --git a/docs/styleguide.rst b/docs/styleguide.rst index 1387d4a6..ec699052 100644 --- a/docs/styleguide.rst +++ b/docs/styleguide.rst @@ -31,7 +31,7 @@ Continuing long statements: .order_by(MyModel.name.desc()) \ .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:: this_is_a_very_long(function_call, 'with many parameters', @@ -105,8 +105,8 @@ Yoda statements are a nogo: pass Comparisons: - - against arbitary types: ``==`` and ``!=`` - - against singletones with ``is`` and ``is not`` (eg: ``foo is not + - against arbitrary types: ``==`` and ``!=`` + - against singletons with ``is`` and ``is not`` (eg: ``foo is not None``) - never compare something with `True` or `False` (for example never do ``foo == False``, do ``not foo`` instead) @@ -125,7 +125,7 @@ Naming Conventions - Class names: ``CamelCase``, with acronyms kept uppercase (``HTTPWriter`` and not ``HttpWriter``) - Variable names: ``lowercase_with_underscores`` -- Method and functin names: ``lowercase_with_underscores`` +- Method and function names: ``lowercase_with_underscores`` - Constants: ``UPPERCASE_WITH_UNDERSCORES`` - precompiled regular expressions: ``name_re`` @@ -151,9 +151,9 @@ Docstrings Docstring conventions: All docstrings are formatted with reStructuredText as understood by 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 - 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:: def foo():