Skip to content

Commit 64fc276

Browse files
committed
add INSTALL.txt, bin/tpath and tpath.bat
revise directions in bin/README.md, notes/test.txt and release-1.0.txt revise setup.py to install bin/tpath add docstring to pymodel/__init__.py INSTALL.txt just started, still incomplete
1 parent f772597 commit 64fc276

File tree

9 files changed

+81
-22
lines changed

9 files changed

+81
-22
lines changed

INSTALL.txt

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
To use PyModel, you do not need to install anything into any system
3+
directories. Just obtain the PyModel directory and place it at any
4+
convenient location. To get the current development version,
5+
6+
git clone git@github.com:jon-jacky/PyModel.git
7+
8+
To get version 1.0, download PyModel-1.0.tar.gz or PyModel-1.0.zip
9+
from
10+
11+
https://pypi.python.org/pypi/PyModel
12+
13+
or
14+
15+
http://staff.washington.edu/jon/pymodel/www/
16+
17+
Then unpack ...
18+
19+
... execute pymodel_paths ... rename PyModel-1.0 to just PyModel (or
20+
edit the commands) ...
21+
22+
The setup.py script now supports the install argument, to optionally
23+
install the PyModel python modules and commands in system directories.
24+
25+
... source tpath ...
26+
27+
... install does not do anything with samples or docs ...
28+

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ recursive-include notes *.txt *.rst *.md
33
recursive-include talks *.txt *.rst *.md *.pdf
44
recursive-include www *.txt *.rst *.md *.html
55
recursive-include pymodel *.txt *.rst *.md *.py
6-
recursive-include bin *.txt *.rst *.md *.bat clogdiff tdiff tclean dotpdf dotps dotsvg pma pmg pmt pmv pymodel_paths tpath trun wsgirunner
6+
recursive-include bin *.txt *.rst *.md *.bat clogdiff tpath trun tdiff tclean dotpdf dotps dotsvg pma pmg pmt pmv pymodel_paths wsgirunner
77
recursive-include samples *.txt *.rst *.md *.bat *.py *.ref *.svg *.pdf *.ps
88

99

bin/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,8 @@ The commands are:
6666
*.py* files in *PyModel/pymodel* without typing the *.py*
6767
extension on the command line.
6868

69-
Revised Apr 2013
69+
- *tpath*: puts the current directory on *PYTHONPATH*, alternative
70+
to *pymodel_paths* to use when PyModel is installed in system directories,
71+
might still be needed even then. See *test.txt* in the *notes* directory
72+
73+
Revised May 2013

bin/tpath

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# put the current directory on PYTHONPATH
2+
export PYTHONPATH=.:$PYTHONPATH

bin/tpath.bat

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rem put the current directory on PYTHONPATH
2+
set PYTHONPATH=.:%PYTHONPATH%

notes/release-1.0.txt

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ Version 1.0 adds new functionality:
4646
- The new command tclean removes test output files from the
4747
current directory.
4848

49+
- The revised setup.py now supports the install argument, to
50+
optionally install the PyModel python modules and commands in system
51+
directories.
52+
4953
Version 1.0 adds a new sample and revises all the others:
5054

5155
- The completely rewritten Socket sample includes new asynchronous

notes/test.txt

+32-18
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ distribution, including the tests of all the samples. These scripts
99
demonstrate the samples, as well as testing PyModel itself.
1010

1111
These notes describe our unit tests, along with our little homemade
12-
unit testing commands: trun, tdiff, and tclean. These commands are
13-
independent of the rest of PyModel (they could be used to test any
12+
unit testing commands: tpath, trun, tdiff, and tclean. These commands
13+
are independent of the rest of PyModel (they could be used to test any
1414
program that writes to stdout). We use these (instead of a
1515
conventional unit test framework like unittest or nose) because:
1616

@@ -24,25 +24,34 @@ conventional unit test framework like unittest or nose) because:
2424
The last section (below) explains how to script tests similar to ours
2525
using the unittest module from the Python standard library.
2626

27-
These directions apply to both Windows and Unix-like systems
28-
(including Linux and Mac OS X). The directions assume that Python is
29-
already installed and your environment is configured so you can run it
30-
(if not, see http://docs.python.org/2/using/). It also assumes that
31-
PyModel is present on your system, the contents of its PyModel/pymodel
32-
directory are on your Python path, the current directory is on your
33-
Pyton path, and the contents of its PyModel/bin directory are on your
34-
execution path. You can achieve this by executing
35-
PyModel/bin/pymodel_paths, or the commands therein.
36-
37-
Quick Start
38-
Summary
27+
Prerequisites
28+
Running tests
29+
Command summary
3930
Commands and modules
4031
Test scripts
4132
Checking test script output
4233
Output files
4334
Using other unit testing frameworks
4435

45-
Quick Start
36+
37+
Prerequisites
38+
39+
These directions apply to both Windows and Unix-like systems
40+
(including Linux and Mac OS X). The directions assume that Python is
41+
already installed and your environment is configured so you can run it
42+
(if not, see http://docs.python.org/2/using/). It also assumes that
43+
the upacked PyModel directories are present on your system, the
44+
contents of its PyModel/pymodel directory are on your Python path, the
45+
contents of its PyModel/bin directory are on your execution path, and
46+
your current directory is on your Python path. You can achieve this
47+
by executing PyModel/bin/pymodel_paths, or the commands therein.
48+
Alternatively, you can install the contents of PyModel/pymodel and
49+
PyModel/bin into system directories (see INSTALL.txt) but then you may
50+
need to execute the command "source tpath" in each session (terminal
51+
window) before you execute any PyModel commands.
52+
53+
54+
Running tests
4655

4756
In each subdirectory of samples, type:
4857

@@ -59,11 +68,13 @@ script is not deterministic and the tdiff command is not meaningful
5968
-- instead just run trun test (or whatever).
6069

6170

62-
Summary
71+
Command Summary
6372

6473
commands in bin directory
65-
trun - execute test script module
66-
tdiff - execute test script, compare output to reference
74+
tpath - put current directory on PYTHONPATH, needed by trun
75+
tpath.bat - ditto, batch script for Windows
76+
trun - execute test script module named in argument
77+
tdiff - execute command (usually trun ...), compare output to reference
6778
tdiff.bat - ditto, batch script for Windows
6879
tclean - remove output files created by running test scripts
6980
tclean.bat - ditto, batch script for Windows
@@ -76,6 +87,7 @@ Programs and scripts in the pymodel directory
7687
trun.py - executes test script module given as argument
7788

7889
In each model directory: samples/PowerSwitch, samples/WebApplication/Model,...
90+
7991
test.py - test script module, executed by trun
8092
test.log - most recent output from test.py, including stdout and stderr,
8193
saved by tdiff
@@ -89,6 +101,7 @@ In each model directory: samples/PowerSwitch, samples/WebApplication/Model,...
89101
dot scripts (maybe via pmv.py), moved here by hand
90102
pdf/ - ditto, .pdf (not many of these), moved here by hand
91103

104+
92105
Programs, Modules, and Commands
93106

94107
In these notes, "the foo module" or "the foo program" means the Python
@@ -222,6 +235,7 @@ If a test case crashes (raises an unhandled exception) on Windows, the
222235
traceback goes to the screen, not the log file. I can't find anything
223236
in Windows like Unix >& to redirect error output also.
224237

238+
225239
Output files
226240

227241
The PyModel pmt command only writes to the terminal (to stdout and

pymodel/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""
2+
Make this directory a package so it can be installed with one line in setup.py
3+
"""

setup.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
author_email = 'jon.p.jacky@gmail.com',
3333
maintainer = 'Jonathan Jacky',
3434
maintainer_email = 'jon.p.jacky@gmail.com',
35-
url = 'http://staff.washington.edu/jon/pymodel/www/',
35+
url = 'https://github.com/jon-jacky/PyModel',
3636
description = 'Model-based testing in Python',
3737
long_description = open('README.md').read(),
38-
download_url = 'http://staff.washington.edu/jon/pymodel/www/',
38+
download_url = 'https://pypi.python.org/pypi/PyModel',
3939
license = 'BSD License',
4040

4141
packages = ['pymodel'],
@@ -60,6 +60,8 @@
6060
'bin/tclean.bat',
6161
'bin/tdiff',
6262
'bin/tdiff.bat',
63+
'bin/tpath',
64+
'bin/tpath.bat',
6365
'bin/trun',
6466
'bin/wsgirunner', ],
6567

0 commit comments

Comments
 (0)