Permalink
Browse files

add custom tox config that creates a development environment

  • Loading branch information...
1 parent bcfd25c commit 00a08a307574b231a5a8c1142bc675732a03632b @tomster tomster committed Aug 16, 2013
Showing with 45 additions and 2 deletions.
  1. +20 −2 HACKING.txt
  2. +25 −0 hacking-tox.ini
View
@@ -16,13 +16,31 @@ checkout.
- Check out a read-only copy of the Pyramid source::
- $ git clone git://github.com/Pylons/pyramid.git
+ $ git clone git://github.com/Pylons/pyramid.git .
(alternately, create a writeable fork on GitHub and check that out).
+Since pyramid is a framework and not an application, it can be
+convenient to work against a sample application, preferably in its
+own virtualenv. A quick way to achieve this is to (ab-)use ``tox``
+with a custom configuration file that's part of the checkout::
+
+ tox -c hacking-tox.ini
+
+This will create a python-2.7 based virtualenv named ``env27`` (pyramid's
+``.gitconfig` ignores all top-level folders that start with ``env`` specifically
+for this use case) and inside that a simple pyramid application named
+``hacking`` that you can then fire up like so::
+
+ cd env27/hacking
+ ../bin/pserve development.ini
+
+Alternatively, if you don't want to install ``tox`` at this point,
+you an achieve the same manually by following these steps:
+
- Create a virtualenv in which to install Pyramid::
- $ virtualenv2.6 --no-site-packages env
+ $ virtualenv --no-site-packages env
- Install ``setuptools-git`` into the virtualenv (for good measure, as we're
using git to do version control)::
View
@@ -0,0 +1,25 @@
+[tox]
+envlist =
+ env27,ttw27-create,ttw27-install
+
+[testenv:env27]
+envdir = env27
+basepython = python2.7
+usedevelop = True
+deps = setuptools-git
+commands =
+ python setup.py dev
+
+[testenv:ttw27-create]
+envdir = env27
+usedevelop = True
+changedir = env27
+commands =
+ pcreate -s starter hacking
+
+[testenv:ttw27-install]
+envdir = env27
+usedevelop = True
+changedir = env27/hacking
+commands =
+ python setup.py develop

0 comments on commit 00a08a3

Please sign in to comment.