From 94fd8de4263dc6294aa62425a5f98d905ef0584a Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 25 Dec 2019 03:35:14 -0800 Subject: Update quick_tour with cookiecutter master branch --- docs/quick_tour/logging/pytest.ini | 2 +- docs/quick_tour/package/pytest.ini | 2 +- docs/quick_tour/sessions/pytest.ini | 2 +- docs/quick_tour/sqla_demo/development.ini | 7 ++++++- docs/quick_tour/sqla_demo/production.ini | 7 ++++++- docs/quick_tour/sqla_demo/setup.py | 10 +++++----- docs/quick_tour/sqla_demo/sqla_demo/__init__.py | 2 +- docs/quick_tour/sqla_demo/sqla_demo/alembic/script.py.mako | 2 -- .../quick_tour/sqla_demo/sqla_demo/alembic/versions/README.txt | 2 +- docs/quick_tour/sqla_demo/sqla_demo/pshell.py | 1 + docs/quick_tour/sqla_demo/sqla_demo/templates/404.jinja2 | 2 +- docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 | 2 +- .../quick_tour/sqla_demo/sqla_demo/templates/mytemplate.jinja2 | 4 ++-- docs/quick_tour/sqla_demo/sqla_demo/tests.py | 3 ++- docs/quick_tour/sqla_demo/sqla_demo/views/default.py | 4 ++-- 15 files changed, 31 insertions(+), 21 deletions(-) (limited to 'docs/quick_tour') diff --git a/docs/quick_tour/logging/pytest.ini b/docs/quick_tour/logging/pytest.ini index f707d54e4..b419855e1 100644 --- a/docs/quick_tour/logging/pytest.ini +++ b/docs/quick_tour/logging/pytest.ini @@ -1,3 +1,3 @@ [pytest] testpaths = hello_world -python_files = *.py +python_files = test*.py diff --git a/docs/quick_tour/package/pytest.ini b/docs/quick_tour/package/pytest.ini index f707d54e4..b419855e1 100644 --- a/docs/quick_tour/package/pytest.ini +++ b/docs/quick_tour/package/pytest.ini @@ -1,3 +1,3 @@ [pytest] testpaths = hello_world -python_files = *.py +python_files = test*.py diff --git a/docs/quick_tour/sessions/pytest.ini b/docs/quick_tour/sessions/pytest.ini index f707d54e4..b419855e1 100644 --- a/docs/quick_tour/sessions/pytest.ini +++ b/docs/quick_tour/sessions/pytest.ini @@ -1,3 +1,3 @@ [pytest] testpaths = hello_world -python_files = *.py +python_files = test*.py diff --git a/docs/quick_tour/sqla_demo/development.ini b/docs/quick_tour/sqla_demo/development.ini index 056a672e4..a087e17a7 100644 --- a/docs/quick_tour/sqla_demo/development.ini +++ b/docs/quick_tour/sqla_demo/development.ini @@ -45,7 +45,7 @@ listen = localhost:6543 ### [loggers] -keys = root, sqla_demo, sqlalchemy +keys = root, sqla_demo, sqlalchemy, alembic [handlers] keys = console @@ -70,6 +70,11 @@ qualname = sqlalchemy.engine # "level = DEBUG" logs SQL queries and results. # "level = WARN" logs neither. (Recommended for production systems.) +[logger_alembic] +level = INFO +handlers = +qualname = alembic + [handler_console] class = StreamHandler args = (sys.stderr,) diff --git a/docs/quick_tour/sqla_demo/production.ini b/docs/quick_tour/sqla_demo/production.ini index fe7f946bd..ee588605d 100644 --- a/docs/quick_tour/sqla_demo/production.ini +++ b/docs/quick_tour/sqla_demo/production.ini @@ -39,7 +39,7 @@ listen = *:6543 ### [loggers] -keys = root, sqla_demo, sqlalchemy +keys = root, sqla_demo, sqlalchemy, alembic [handlers] keys = console @@ -64,6 +64,11 @@ qualname = sqlalchemy.engine # "level = DEBUG" logs SQL queries and results. # "level = WARN" logs neither. (Recommended for production systems.) +[logger_alembic] +level = WARN +handlers = +qualname = alembic + [handler_console] class = StreamHandler args = (sys.stderr,) diff --git a/docs/quick_tour/sqla_demo/setup.py b/docs/quick_tour/sqla_demo/setup.py index 28a8e0815..23740ba9f 100644 --- a/docs/quick_tour/sqla_demo/setup.py +++ b/docs/quick_tour/sqla_demo/setup.py @@ -9,17 +9,17 @@ with open(os.path.join(here, 'CHANGES.txt')) as f: CHANGES = f.read() requires = [ - 'alembic', 'plaster_pastedeploy', - 'pyramid >= 1.9', - 'pyramid_debugtoolbar', + 'pyramid', 'pyramid_jinja2', + 'pyramid_debugtoolbar', + 'waitress', + 'alembic', 'pyramid_retry', 'pyramid_tm', 'SQLAlchemy', 'transaction', 'zope.sqlalchemy', - 'waitress', ] tests_require = [ @@ -55,7 +55,7 @@ setup( 'main = sqla_demo:main', ], 'console_scripts': [ - 'initialize_sqla_demo_db = sqla_demo.scripts.initialize_db:main', + 'initialize_sqla_demo_db=sqla_demo.scripts.initialize_db:main', ], }, ) diff --git a/docs/quick_tour/sqla_demo/sqla_demo/__init__.py b/docs/quick_tour/sqla_demo/sqla_demo/__init__.py index 28bd1f80d..5c2ba5cc0 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/__init__.py +++ b/docs/quick_tour/sqla_demo/sqla_demo/__init__.py @@ -5,8 +5,8 @@ def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ with Configurator(settings=settings) as config: - config.include('pyramid_jinja2') config.include('.models') + config.include('pyramid_jinja2') config.include('.routes') config.scan() return config.make_wsgi_app() diff --git a/docs/quick_tour/sqla_demo/sqla_demo/alembic/script.py.mako b/docs/quick_tour/sqla_demo/sqla_demo/alembic/script.py.mako index 2c0156303..535780d13 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/alembic/script.py.mako +++ b/docs/quick_tour/sqla_demo/sqla_demo/alembic/script.py.mako @@ -15,10 +15,8 @@ down_revision = ${repr(down_revision)} branch_labels = ${repr(branch_labels)} depends_on = ${repr(depends_on)} - def upgrade(): ${upgrades if upgrades else "pass"} - def downgrade(): ${downgrades if downgrades else "pass"} diff --git a/docs/quick_tour/sqla_demo/sqla_demo/alembic/versions/README.txt b/docs/quick_tour/sqla_demo/sqla_demo/alembic/versions/README.txt index 09ed32c8d..b0d704d6a 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/alembic/versions/README.txt +++ b/docs/quick_tour/sqla_demo/sqla_demo/alembic/versions/README.txt @@ -1 +1 @@ -Placeholder for alembic versions \ No newline at end of file +Placeholder for alembic versions diff --git a/docs/quick_tour/sqla_demo/sqla_demo/pshell.py b/docs/quick_tour/sqla_demo/sqla_demo/pshell.py index 108c04d5e..b0847ee90 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/pshell.py +++ b/docs/quick_tour/sqla_demo/sqla_demo/pshell.py @@ -1,5 +1,6 @@ from . import models + def setup(env): request = env['request'] diff --git a/docs/quick_tour/sqla_demo/sqla_demo/templates/404.jinja2 b/docs/quick_tour/sqla_demo/sqla_demo/templates/404.jinja2 index 1917f83c7..aaf12413f 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/templates/404.jinja2 +++ b/docs/quick_tour/sqla_demo/sqla_demo/templates/404.jinja2 @@ -2,7 +2,7 @@ {% block content %}
-

Pyramid Alchemy scaffold

+

Pyramid Starter project

404 Page Not Found

{% endblock content %} diff --git a/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 b/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 index 107691acf..82017688a 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 +++ b/docs/quick_tour/sqla_demo/sqla_demo/templates/layout.jinja2 @@ -8,7 +8,7 @@ - Cookiecutter Alchemy project for the Pyramid Web Framework + Cookiecutter Starter project for the Pyramid Web Framework diff --git a/docs/quick_tour/sqla_demo/sqla_demo/templates/mytemplate.jinja2 b/docs/quick_tour/sqla_demo/sqla_demo/templates/mytemplate.jinja2 index d8b0a4232..f2e7283f8 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/templates/mytemplate.jinja2 +++ b/docs/quick_tour/sqla_demo/sqla_demo/templates/mytemplate.jinja2 @@ -2,7 +2,7 @@ {% block content %}
-

Pyramid Alchemy project

+

Pyramid Starter project

Welcome to {{project}}, a Pyramid application generated by
Cookiecutter.

-{% endblock content %} \ No newline at end of file +{% endblock content %} diff --git a/docs/quick_tour/sqla_demo/sqla_demo/tests.py b/docs/quick_tour/sqla_demo/sqla_demo/tests.py index 6db538ffd..df9b58780 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/tests.py +++ b/docs/quick_tour/sqla_demo/sqla_demo/tests.py @@ -1,8 +1,9 @@ import unittest -import transaction from pyramid import testing +import transaction + def dummy_request(dbsession): return testing.DummyRequest(dbsession=dbsession) diff --git a/docs/quick_tour/sqla_demo/sqla_demo/views/default.py b/docs/quick_tour/sqla_demo/sqla_demo/views/default.py index f7ad4c8f2..a6b05c558 100644 --- a/docs/quick_tour/sqla_demo/sqla_demo/views/default.py +++ b/docs/quick_tour/sqla_demo/sqla_demo/views/default.py @@ -1,5 +1,5 @@ -from pyramid.response import Response from pyramid.view import view_config +from pyramid.response import Response from sqlalchemy.exc import DBAPIError @@ -21,7 +21,7 @@ Pyramid is having a problem using your SQL database. The problem might be caused by one of the following things: 1. You may need to initialize your database tables with `alembic`. - Check your README.txt for description and try to run it. + Check your README.txt for descriptions and try to run it. 2. Your database server may not be running. Check that the database server referred to by the "sqlalchemy.url" setting in -- cgit v1.2.3