From 7082b0742fb2c60177831ca02f485494d394137e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 27 Apr 2011 08:27:52 -0400 Subject: Luckily, tools are getting better at supporting Py3 --- howto.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/howto.txt b/howto.txt index 2b1536bd..13dc41a8 100644 --- a/howto.txt +++ b/howto.txt @@ -52,7 +52,7 @@ * Building -- Install fixtar on any Python used to make source kits: http://bitbucket.org/ned/fixtar +- Install fixtar on any Windows Python used to make source kits: http://bitbucket.org/ned/fixtar - Create PythonXX\Lib\distutils\distutils.cfg:: [build] compiler = mingw32 @@ -64,10 +64,6 @@ - On Py 2.x: need setuptools installed - On Py 3.x: need Distribute installed - Need nose installed - - nose for py 2.x - - nose3 for py 3.x - - copy Scripts\nosetest3.exe to Scripts\nosetests.exe - - copy Scripts\nosetest3-script.py to Scripts\nosetests-script.py - Need to have coverage dev-installed - In each Python installation to be used, create a "coverage_test_egg.pth" containing:: -- cgit v1.2.1 From aa7bd954cba086567c87b085a3ba1f5d045898a2 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 27 Apr 2011 08:29:50 -0400 Subject: Latest thinking on how to do testing on Windows. --- alltests.cmd | 8 ++++---- switchpy.cmd | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 switchpy.cmd diff --git a/alltests.cmd b/alltests.cmd index 425fe1c1..213c71b9 100644 --- a/alltests.cmd +++ b/alltests.cmd @@ -1,11 +1,11 @@ @echo off @rem all the Python installs have a .pth pointing to the egg file created by -@rem 2.5, so install the testdata in 2.5 -call \ned\bin\switchpy c:\vpy\coverage\25 quiet +@rem 2.6, so install the testdata in 2.5 +call switchpy c:\vpy\coverage\26 quiet make --quiet testdata -for %%v in (23 24 25 26 27 31 32) do ( - call \ned\bin\switchpy c:\vpy\coverage\%%v +for %%v in (24 25 26 27 31 32) do ( + call switchpy c:\vpy\coverage\%%v python setup.py -q develop set COVERAGE_TEST_TRACER=c nosetests %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/switchpy.cmd b/switchpy.cmd new file mode 100644 index 00000000..089df2a5 --- /dev/null +++ b/switchpy.cmd @@ -0,0 +1,14 @@ +@echo off +set PATH=.;%HOME%\bin +set PATH=%PATH%;c:\windows\system32;c:\windows +set PATH=%PATH%;%1\scripts;%1 +set PATH=%PATH%;C:\Program Files\Mercurial\bin +set PATH=%PATH%;c:\cygwin\bin +set PATH=%PATH%;c:\app\MinGW\bin +set PYTHONPATH=;c:\ned\py +set PYHOME=%1 +rem title Py %1 +if "%2"=="quiet" goto done +python -c "import sys; print ('\n=== Python %%s %%s' %% (sys.version.split()[0], '='*80))" + +:done -- cgit v1.2.1 From 157f374e4ed110094ed2f9e4a4d63a928523df1a Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 27 Apr 2011 08:30:10 -0400 Subject: This changes whenever I have a different quirk to examine. --- lab/trace_sample.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/lab/trace_sample.py b/lab/trace_sample.py index 2fec9424..9fa37249 100644 --- a/lab/trace_sample.py +++ b/lab/trace_sample.py @@ -21,7 +21,37 @@ def trace(frame, event, arg): return trace +def trace2(frame, event, arg): + #if event == 'line': + global nest + + print "2: %s%s %s %d" % ( + " " * nest, + event, + os.path.basename(frame.f_code.co_filename), + frame.f_lineno, + ) + + if event == 'call': + nest += 1 + if event == 'return': + nest -= 1 + + return trace2 + sys.settrace(trace) -import sample +def bar(): + print "nar" + +a = 26 +def foo(n): + a = 28 + sys.settrace(sys.gettrace()) + bar() + a = 30 + return 2*n + +print foo(a) +#import sample #import littleclass -- cgit v1.2.1