From 0fb992d2eb0edeab67c4c57212244d6c6a6c515b Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 23 Dec 2016 04:21:00 -0800 Subject: wiki/src/models updates --- docs/tutorials/wiki/src/models/CHANGES.txt | 2 +- docs/tutorials/wiki/src/models/README.txt | 27 ++++++++-- docs/tutorials/wiki/src/models/development.ini | 7 +-- docs/tutorials/wiki/src/models/production.ini | 8 +-- docs/tutorials/wiki/src/models/setup.py | 60 +++++++++++----------- .../tutorials/wiki/src/models/tutorial/__init__.py | 2 + .../src/models/tutorial/templates/mytemplate.pt | 10 ++-- docs/tutorials/wiki/src/models/tutorial/tests.py | 2 +- docs/tutorials/wiki/src/models/tutorial/views.py | 2 +- 9 files changed, 66 insertions(+), 54 deletions(-) (limited to 'docs') diff --git a/docs/tutorials/wiki/src/models/CHANGES.txt b/docs/tutorials/wiki/src/models/CHANGES.txt index 35a34f332..14b902fd1 100644 --- a/docs/tutorials/wiki/src/models/CHANGES.txt +++ b/docs/tutorials/wiki/src/models/CHANGES.txt @@ -1,4 +1,4 @@ 0.0 --- -- Initial version +- Initial version. diff --git a/docs/tutorials/wiki/src/models/README.txt b/docs/tutorials/wiki/src/models/README.txt index dcb3605b8..bd67221cc 100644 --- a/docs/tutorials/wiki/src/models/README.txt +++ b/docs/tutorials/wiki/src/models/README.txt @@ -1,12 +1,29 @@ -tutorial README -================== +myproj +=============================== Getting Started --------------- -- cd +- Change directory into your newly created project. -- $VENV/bin/pip install -e . + cd myproj -- $VENV/bin/pserve development.ini +- Create a Python virtual environment. + python3 -m venv env + +- Upgrade packaging tools. + + env/bin/pip install --upgrade pip setuptools wheel + +- Install the project in editable mode with its testing requirements. + + env/bin/pip install -e ".[testing]" + +- Run your project's tests. + + env/bin/pytest + +- Run your project. + + env/bin/pserve development.ini diff --git a/docs/tutorials/wiki/src/models/development.ini b/docs/tutorials/wiki/src/models/development.ini index 78542a1d5..82c8cf3a1 100644 --- a/docs/tutorials/wiki/src/models/development.ini +++ b/docs/tutorials/wiki/src/models/development.ini @@ -1,6 +1,6 @@ ### # app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/1.7-branch/narr/environment.html +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html ### [app:main] @@ -13,10 +13,7 @@ pyramid.debug_routematch = false pyramid.default_locale_name = en pyramid.includes = pyramid_debugtoolbar - pyramid_zodbconn - pyramid_tm -tm.attempts = 3 zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000 # By default, the toolbar only appears for clients from IP addresses @@ -33,7 +30,7 @@ listen = 127.0.0.1:6543 [::1]:6543 ### # logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/1.7-branch/narr/logging.html +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html ### [loggers] diff --git a/docs/tutorials/wiki/src/models/production.ini b/docs/tutorials/wiki/src/models/production.ini index 0c6aa152b..60b6fe253 100644 --- a/docs/tutorials/wiki/src/models/production.ini +++ b/docs/tutorials/wiki/src/models/production.ini @@ -1,6 +1,6 @@ ### # app configuration -# http://docs.pylonsproject.org/projects/pyramid/en/1.7-branch/narr/environment.html +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html ### [app:main] @@ -11,11 +11,7 @@ pyramid.debug_authorization = false pyramid.debug_notfound = false pyramid.debug_routematch = false pyramid.default_locale_name = en -pyramid.includes = - pyramid_tm - pyramid_zodbconn -tm.attempts = 3 zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000 ### @@ -28,7 +24,7 @@ listen = *:6543 ### # logging configuration -# http://docs.pylonsproject.org/projects/pyramid/en/1.7-branch/narr/logging.html +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html ### [loggers] diff --git a/docs/tutorials/wiki/src/models/setup.py b/docs/tutorials/wiki/src/models/setup.py index 46b395568..5d1e9c7b5 100644 --- a/docs/tutorials/wiki/src/models/setup.py +++ b/docs/tutorials/wiki/src/models/setup.py @@ -17,37 +17,39 @@ requires = [ 'transaction', 'ZODB3', 'waitress', - ] +] tests_require = [ 'WebTest >= 1.3.1', # py3 compat - 'pytest', # includes virtualenv + 'pytest', 'pytest-cov', - ] +] -setup(name='tutorial', - version='0.0', - description='tutorial', - long_description=README + '\n\n' + CHANGES, - classifiers=[ - "Programming Language :: Python", - "Framework :: Pyramid", - "Topic :: Internet :: WWW/HTTP", - "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", - ], - author='', - author_email='', - url='', - keywords='web pylons pyramid', - packages=find_packages(), - include_package_data=True, - zip_safe=False, - extras_require={ - 'testing': tests_require, - }, - install_requires=requires, - entry_points="""\ - [paste.app_factory] - main = tutorial:main - """, - ) +setup( + name='tutorial', + version='0.0', + description='myproj', + long_description=README + '\n\n' + CHANGES, + classifiers=[ + 'Programming Language :: Python', + 'Framework :: Pyramid', + 'Topic :: Internet :: WWW/HTTP', + 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application', + ], + author='', + author_email='', + url='', + keywords='web pyramid pylons', + packages=find_packages(), + include_package_data=True, + zip_safe=False, + extras_require={ + 'testing': tests_require, + }, + install_requires=requires, + entry_points={ + 'paste.app_factory': [ + 'main = tutorial:main', + ], + }, +) diff --git a/docs/tutorials/wiki/src/models/tutorial/__init__.py b/docs/tutorials/wiki/src/models/tutorial/__init__.py index f2a86df47..728f7ac02 100644 --- a/docs/tutorials/wiki/src/models/tutorial/__init__.py +++ b/docs/tutorials/wiki/src/models/tutorial/__init__.py @@ -13,6 +13,8 @@ def main(global_config, **settings): """ config = Configurator(root_factory=root_factory, settings=settings) config.include('pyramid_chameleon') + config.include('pyramid_tm') + config.include('pyramid_zodbconn') config.add_static_view('static', 'static', cache_max_age=3600) config.scan() return config.make_wsgi_app() diff --git a/docs/tutorials/wiki/src/models/tutorial/templates/mytemplate.pt b/docs/tutorials/wiki/src/models/tutorial/templates/mytemplate.pt index f8cbe2e2c..3ac122711 100644 --- a/docs/tutorials/wiki/src/models/tutorial/templates/mytemplate.pt +++ b/docs/tutorials/wiki/src/models/tutorial/templates/mytemplate.pt @@ -8,7 +8,7 @@ - ZODB Scaffold for The Pyramid Web Framework + Cookiecutter ZODB project for the Pyramid Web Framework @@ -33,18 +33,16 @@
-

Pyramid ZODB scaffold

-

Welcome to ${project}, an application generated by
the Pyramid Web Framework 1.7.

+

Pyramid ZODB Project

+

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

diff --git a/docs/tutorials/wiki/src/models/tutorial/tests.py b/docs/tutorials/wiki/src/models/tutorial/tests.py index 40f3c47af..ca7a47279 100644 --- a/docs/tutorials/wiki/src/models/tutorial/tests.py +++ b/docs/tutorials/wiki/src/models/tutorial/tests.py @@ -14,4 +14,4 @@ class ViewTests(unittest.TestCase): from .views import my_view request = testing.DummyRequest() info = my_view(request) - self.assertEqual(info['project'], 'tutorial') + self.assertEqual(info['project'], 'myproj') diff --git a/docs/tutorials/wiki/src/models/tutorial/views.py b/docs/tutorials/wiki/src/models/tutorial/views.py index 628ce15ed..c1878bdd0 100644 --- a/docs/tutorials/wiki/src/models/tutorial/views.py +++ b/docs/tutorials/wiki/src/models/tutorial/views.py @@ -4,4 +4,4 @@ from .models import MyModel @view_config(context=MyModel, renderer='templates/mytemplate.pt') def my_view(request): - return {'project': 'tutorial'} + return {'project': 'myproj'} -- cgit v1.2.3