From 00a08a307574b231a5a8c1142bc675732a03632b Mon Sep 17 00:00:00 2001 From: Tom Lazar Date: Fri, 16 Aug 2013 14:26:57 +0200 Subject: add custom tox config that creates a development environment --- HACKING.txt | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'HACKING.txt') diff --git a/HACKING.txt b/HACKING.txt index 5b5dcc458..563903f2f 100644 --- a/HACKING.txt +++ b/HACKING.txt @@ -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):: -- cgit v1.2.3 From 7a2df29602b207954a4d00fae4556f57ed3675e1 Mon Sep 17 00:00:00 2001 From: Andreas Zeidler Date: Fri, 16 Aug 2013 16:42:08 +0200 Subject: add info how to run the tests using pytest (http://pytest.org/) --- HACKING.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'HACKING.txt') diff --git a/HACKING.txt b/HACKING.txt index 563903f2f..87538d0ad 100644 --- a/HACKING.txt +++ b/HACKING.txt @@ -128,6 +128,13 @@ Running Tests $ cd ~/hack-on-pyramid/pyramid $ /usr/bin/tox +- The tests can also be run usign ``pytest`` (http://pytest.org/). This is + intended as a convenience for people who are more used or fond of ``pytest``. + Run the tests like so:: + + $ pip install pytest + $ py.test --strict pyramid/ + Test Coverage ------------- -- cgit v1.2.3 From 852e015f9b3864b0c07569a9753c4107b8d1238a Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Fri, 16 Aug 2013 09:48:19 -0500 Subject: recommend easy_install until we don't --- HACKING.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'HACKING.txt') diff --git a/HACKING.txt b/HACKING.txt index 87538d0ad..5d33aa0ab 100644 --- a/HACKING.txt +++ b/HACKING.txt @@ -40,7 +40,7 @@ you an achieve the same manually by following these steps: - Create a virtualenv in which to install Pyramid:: - $ virtualenv --no-site-packages env + $ virtualenv env - Install ``setuptools-git`` into the virtualenv (for good measure, as we're using git to do version control):: @@ -132,7 +132,7 @@ Running Tests intended as a convenience for people who are more used or fond of ``pytest``. Run the tests like so:: - $ pip install pytest + $ $VENV/bin/easy_install pytest $ py.test --strict pyramid/ Test Coverage -- cgit v1.2.3 From 68d2a8cf14b940ffac796be663baeb0782640310 Mon Sep 17 00:00:00 2001 From: Tom Lazar Date: Sat, 17 Aug 2013 16:08:43 +0200 Subject: provide the tox url when mentioning it first. --- HACKING.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'HACKING.txt') diff --git a/HACKING.txt b/HACKING.txt index 563903f2f..2e444e781 100644 --- a/HACKING.txt +++ b/HACKING.txt @@ -23,7 +23,8 @@ checkout. 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:: +(http://codespeak.net/~hpk/tox/) with a custom configuration file that's part of +the checkout:: tox -c hacking-tox.ini -- cgit v1.2.3 From 98b383ef54d16c977561101dde1addd34ba34240 Mon Sep 17 00:00:00 2001 From: Tom Lazar Date: Sat, 17 Aug 2013 16:09:58 +0200 Subject: adjust the checkout path to the new value set above in a previous commit --- HACKING.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'HACKING.txt') diff --git a/HACKING.txt b/HACKING.txt index 2e444e781..d664d6bfc 100644 --- a/HACKING.txt +++ b/HACKING.txt @@ -126,7 +126,7 @@ Running Tests example:: $ /usr/bin/easy_install tox - $ cd ~/hack-on-pyramid/pyramid + $ cd ~/hack-on-pyramid/ $ /usr/bin/tox Test Coverage -- cgit v1.2.3 From 50f23dd4fb2ea8690893ac2cf20a0f0483b32a0d Mon Sep 17 00:00:00 2001 From: Tom Lazar Date: Sat, 17 Aug 2013 16:10:45 +0200 Subject: include and mention the `nose-selecttests `_ plugin --- HACKING.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'HACKING.txt') diff --git a/HACKING.txt b/HACKING.txt index d664d6bfc..0d28905b6 100644 --- a/HACKING.txt +++ b/HACKING.txt @@ -112,9 +112,13 @@ Coding Style Running Tests -------------- -- To run tests for Pyramid on a single Python version, run ``python setup.py - test`` against the Python interpreter from virtualenv into which - you've ``setup.py develop``-ed Pyramid. +- To run all tests for Pyramid on a single Python version, run ``nosetests`` from + your development virtualenv (See *Using a Development Checkout* above). + +- To run individual tests (i.e. during development) you can use a regular + expression with the ``-t`` parameter courtesy of the `nose-selecttests + `_ plugin that's been installed (along with nose itself) via ``python setup.py dev``. The easiest usage is to + simply provide the verbatim name of the test you're working on. - To run the full set of Pyramid tests on all platforms, install ``tox`` (http://codespeak.net/~hpk/tox/) into a system Python. The ``tox`` console -- cgit v1.2.3