Steve Piercy
2016-12-23 29394211eaeff1dff3cc6578761883f9fd0a1e8a
wiki2/src/installation - update files
2 files added
11 files modified
137 ■■■■■ changed files
docs/tutorials/wiki2/src/installation/.coveragerc 3 ●●●●● patch | view | raw | blame | history
docs/tutorials/wiki2/src/installation/CHANGES.txt 2 ●●● patch | view | raw | blame | history
docs/tutorials/wiki2/src/installation/MANIFEST.in 2 ●●● patch | view | raw | blame | history
docs/tutorials/wiki2/src/installation/README.txt 31 ●●●● patch | view | raw | blame | history
docs/tutorials/wiki2/src/installation/development.ini 5 ●●●●● patch | view | raw | blame | history
docs/tutorials/wiki2/src/installation/production.ini 8 ●●●● patch | view | raw | blame | history
docs/tutorials/wiki2/src/installation/pytest.ini 3 ●●●●● patch | view | raw | blame | history
docs/tutorials/wiki2/src/installation/setup.py 65 ●●●● patch | view | raw | blame | history
docs/tutorials/wiki2/src/installation/tutorial/models/__init__.py 2 ●●● patch | view | raw | blame | history
docs/tutorials/wiki2/src/installation/tutorial/templates/layout.jinja2 8 ●●●●● patch | view | raw | blame | history
docs/tutorials/wiki2/src/installation/tutorial/templates/mytemplate.jinja2 4 ●●●● patch | view | raw | blame | history
docs/tutorials/wiki2/src/installation/tutorial/tests.py 2 ●●● patch | view | raw | blame | history
docs/tutorials/wiki2/src/installation/tutorial/views/default.py 2 ●●● patch | view | raw | blame | history
docs/tutorials/wiki2/src/installation/.coveragerc
New file
@@ -0,0 +1,3 @@
[run]
source = tutorial
omit = tutorial/test*
docs/tutorials/wiki2/src/installation/CHANGES.txt
@@ -1,4 +1,4 @@
0.0
---
-  Initial version
- Initial version.
docs/tutorials/wiki2/src/installation/MANIFEST.in
@@ -1,2 +1,2 @@
include *.txt *.ini *.cfg *.rst
recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.jinja2 *.pt *.txt *.mak *.mako *.js *.html *.xml
recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2
docs/tutorials/wiki2/src/installation/README.txt
@@ -1,14 +1,33 @@
tutorial README
==================
myproj
===============================
Getting Started
---------------
- cd <directory containing this file>
- Change directory into your newly created project.
- $VENV/bin/pip install -e .
    cd myproj
- $VENV/bin/initialize_tutorial_db development.ini
- Create a Python virtual environment.
- $VENV/bin/pserve development.ini
    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]"
- Configure the database.
    env/bin/initialize_tutorial_db development.ini
- Run your project's tests.
    env/bin/pytest
- Run your project.
    env/bin/pserve development.ini
docs/tutorials/wiki2/src/installation/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,7 +13,6 @@
pyramid.default_locale_name = en
pyramid.includes =
    pyramid_debugtoolbar
    pyramid_tm
sqlalchemy.url = sqlite:///%(here)s/tutorial.sqlite
@@ -31,7 +30,7 @@
###
# 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]
docs/tutorials/wiki2/src/installation/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]
@@ -14,13 +14,17 @@
sqlalchemy.url = sqlite:///%(here)s/tutorial.sqlite
###
# wsgi server configuration
###
[server:main]
use = egg:waitress#main
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]
docs/tutorials/wiki2/src/installation/pytest.ini
New file
@@ -0,0 +1,3 @@
[pytest]
testpaths = tutorial
python_files = *.py
docs/tutorials/wiki2/src/installation/setup.py
@@ -17,39 +17,42 @@
    'transaction',
    'zope.sqlalchemy',
    '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 wsgi bfg 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
      [console_scripts]
      initialize_tutorial_db = tutorial.scripts.initializedb: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',
        ],
        'console_scripts': [
            'initialize_tutorial_db = tutorial.scripts.initializedb:main',
        ],
    },
)
docs/tutorials/wiki2/src/installation/tutorial/models/__init__.py
@@ -5,7 +5,7 @@
# import or define all models here to ensure they are attached to the
# Base.metadata prior to any initialization routines
from .mymodel import MyModel  # noqa
from .mymodel import MyModel  # flake8: noqa
# run configure_mappers after defining all of the models to ensure
# all relationships can be setup
docs/tutorials/wiki2/src/installation/tutorial/templates/layout.jinja2
@@ -8,7 +8,7 @@
    <meta name="author" content="Pylons Project">
    <link rel="shortcut icon" href="{{request.static_url('tutorial:static/pyramid-16x16.png')}}">
    <title>Alchemy Scaffold for The Pyramid Web Framework</title>
    <title>Cookiecutter Alchemy project for the Pyramid Web Framework</title>
    <!-- Bootstrap core CSS -->
    <link href="//oss.maxcdn.com/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
@@ -29,7 +29,7 @@
      <div class="container">
        <div class="row">
          <div class="col-md-2">
            <img class="logo img-responsive" src="{{request.static_url('tutorial:static/pyramid.png')}}" alt="pyramid web framework">
            <img class="logo img-responsive" src="{{request.static_url('tutorial:static/pyramid.png') }}" alt="pyramid web framework">
          </div>
          <div class="col-md-10">
            {% block content %}
@@ -40,10 +40,8 @@
        <div class="row">
          <div class="links">
            <ul>
              <li class="current-version">Generated by v1.7</li>
              <li><i class="glyphicon glyphicon-bookmark icon-muted"></i><a href="http://docs.pylonsproject.org/projects/pyramid/en/1.7-branch/">Docs</a></li>
              <li><i class="glyphicon glyphicon-cog icon-muted"></i><a href="https://github.com/Pylons/pyramid">Github Project</a></li>
              <li><i class="glyphicon glyphicon-globe icon-muted"></i><a href="irc://irc.freenode.net#pyramid">IRC Channel</a></li>
              <li><i class="glyphicon glyphicon-globe icon-muted"></i><a href="https://webchat.freenode.net/?channels=pyramid">IRC Channel</a></li>
              <li><i class="glyphicon glyphicon-home icon-muted"></i><a href="http://pylonsproject.org">Pylons Project</a></li>
            </ul>
          </div>
docs/tutorials/wiki2/src/installation/tutorial/templates/mytemplate.jinja2
@@ -2,7 +2,7 @@
{% block content %}
<div class="content">
  <h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">Alchemy scaffold</span></h1>
  <p class="lead">Welcome to <span class="font-normal">{{project}}</span>, an&nbsp;application generated&nbsp;by<br>the <span class="font-normal">Pyramid Web Framework 1.7</span>.</p>
  <h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">Alchemy project</span></h1>
  <p class="lead">Welcome to <span class="font-normal">myproj</span>, a&nbsp;Pyramid application generated&nbsp;by<br><span class="font-normal">Cookiecutter</span>.</p>
</div>
{% endblock content %}
docs/tutorials/wiki2/src/installation/tutorial/tests.py
@@ -54,7 +54,7 @@
        from .views.default import my_view
        info = my_view(dummy_request(self.session))
        self.assertEqual(info['one'].name, 'one')
        self.assertEqual(info['project'], 'tutorial')
        self.assertEqual(info['project'], 'myproj')
class TestMyViewFailureCondition(BaseTest):
docs/tutorials/wiki2/src/installation/tutorial/views/default.py
@@ -13,7 +13,7 @@
        one = query.filter(MyModel.name == 'one').first()
    except DBAPIError:
        return Response(db_err_msg, content_type='text/plain', status=500)
    return {'one': one, 'project': 'tutorial'}
    return {'one': one, 'project': 'myproj'}
db_err_msg = """\