[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-09-06 Thread Brandon Craig Rhodes

Brandon Craig Rhodes bran...@rhodesmill.org added the comment:

Brett, yes, you are welcome to close this issue — Ned quite handily convinced 
me that coverage code belongs in the coverage distribution, not languishing 
about in the CPython source tree. That solution also quite beautifully solves 
the copyright problem. So I happily withdraw my request for this feature.

Nick, Brett is working on exactly the sort of devguide improvement that you 
suggest — not least because the devguide will now need to instruct people in 
how to build coverage so that its C-accelerated tracer is available, which 
Ned's own patch to coverage to cover stdlib tracing uses instead of the 
Python tracer that I cut-and-pasted into this patch.

Finally, it would be wonderful to have a more formal mechanism for boot-time 
interventions. I have mentioned before my wish that Python's first action be to 
open() the executable, check its tail to see if it's a valid zipfile, and if so 
to try loading and running startup.py from that zipfile. Among other things, 
that would allow single-file distribution of pure-Python applications without 
the py2exe/py2app mess that prevails in the projects I work with today. But 
since the whole issue of grabbing control at boot time raises hackles (why 
would you want to do that!?), and I needed something working immediately 
during the PyCon sprint, I elected to simply adopt encodings.py as my way in. 
It works great, and coverage can evolve to an even better mechanism as soon 
as one becomes available, should anyone want to take the bootup option and run 
with it.

One final thought: should PyPy etc also implement the same boot protocol, 
should one be invented, so that all mainline interpreters can be instrumented 
the same way?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-09-06 Thread Thomas Wouters

Thomas Wouters tho...@python.org added the comment:

For what it's worth, the need for a bootstrap-module has also come up within 
Google, where we have... somewhat different requirements than most.  In order 
to fix import paths in a way that works even when using python -S, I had a 
need to patch the very first module that gets imported. Unfortunately the 
actual first module that gets imported depends on the arguments passed to 
Python. So, I wrote the attached stdlib_landmark.diff patch, which makes a 
'stdlib_landmark.py' file that is both the stdlib landmark (used by Python to 
find the stdlib itself, currently 'os.py') *and* the very first module that is 
imported, always.

(The 'stdlib_landmark' name may be a little clunky; a better name, mirroring 
sitecustomize, may be stdlibcustomize or such.)

And yes, this could have been fixed in other ways. I could've patched the 
interpreter directly, or made Python understand symlinks to .py/.pyc files 
better, or tried to make a bunch of other tools work better with symlinks. This 
has turned out the most convenient solution for a number of reasons, though.

--
nosy: +twouters
Added file: http://bugs.python.org/file23107/stdlib_landmark.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-09-05 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

Brandon, can I go ahead and close this and consider the script you and Ned have 
in the coverage.py repo to be the canonical script to use?

--
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-09-05 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Do we really want to enshrine shadowing the encodings module as the one true 
way to do this kind of thing?

Although I guess defining a way to do it properly would be a fairly major 
undertaking, so perhaps blessing the encodings hack is the practical way 
forward...

If we do that, I'd like to see a devguide patch that better explains how to 
generate your own coverage data for the stdlib with coverage.py, the encodings 
hack and the standard library coverage option.

--
status: pending - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-08-21 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Added Ned to the nosy list.

For Python core, we should also keep in mind that we do have the option of 
adding a -X coverage option to avoid the need for the encodings module hack.

--
nosy: +nedbat

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-08-21 Thread Ned Batchelder

Ned Batchelder n...@nedbatchelder.com added the comment:

The tip of the coverage.py repo (https://bitbucket.org/ned/coveragepy) has a 
new implementation of the encodings hack which seems to work well.

Of course, an option to run a module before anything else in the interpreter 
would make the whole thing much simpler.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-08-04 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-08-02 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


Removed file: http://bugs.python.org/file22622/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-08-02 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 I think your suggestions are all good ones, and I have incorporated
 them into the file.
Great :)  You left some commented-out debugging prints.

 (But do note that the departures we are now making from Ned's own
 copy of the tracer code ­— removing the commented-out debugging
 statement, and the long comment, and the inheritance from object —
 might make it harder to bring in changes from his own copy if he
 should ever further improve it.)
I’m not concerned by this.  I’ve been doing merges all the time for more that a 
year, and having a few diverging lines is not a big deal.

 I have tried to write the comments to be more informative, while also
 addressing your own ideas; let me know if you like the result!
I do!

 Oh: and, I am continuing to use this new file in my own work on the
 Python core, and it has been working fine — so no problems with the
 actual code have developed over these first 3+ months of use.
This is a good thing to know.

I’ll let Brett take over now.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-08-01 Thread Brandon Craig Rhodes

Brandon Craig Rhodes bran...@rhodesmill.org added the comment:

Éric, I think your suggestions are all good ones, and I have incorporated them 
into the file. (But do note that the departures we are now making from Ned's 
own copy of the tracer code ­— removing the commented-out debugging statement, 
and the long comment, and the inheritance from object — might make it harder to 
bring in changes from his own copy if he should ever further improve it.) I 
have tried to write the comments to be more informative, while also addressing 
your own ideas; let me know if you like the result!

Oh: and, I am continuing to use this new file in my own work on the Python 
core, and it has been working fine — so no problems with the actual code have 
developed over these first 3+ months of use.

--
Added file: http://bugs.python.org/file22823/fullcoverage2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-07-11 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Thanks for your work on this.  I made some minor comments on Rietveld (you 
should get an email), waiting for the real import experts to comment on the 
meat of the patch.

--
nosy: +eric.araujo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-07-11 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +ericsnow

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-07-11 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

Which I have not forgotten about. Just waiting until I have the time to get
to this.

On Mon, Jul 11, 2011 at 08:50, Éric Araujo rep...@bugs.python.org wrote:


 Éric Araujo mer...@netwok.org added the comment:

 Thanks for your work on this.  I made some minor comments on Rietveld (you
 should get an email), waiting for the real import experts to comment on the
 meat of the patch.

 --
 nosy: +eric.araujo

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue11561
 ___


--
Added file: http://bugs.python.org/file22622/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___Which I have not forgotten about. Just waiting until I have the time to get to 
this.brbrdiv class=gmail_quoteOn Mon, Jul 11, 2011 at 08:50, Éric 
Araujo span dir=ltrlt;a 
href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;/span 
wrote:br

blockquote class=gmail_quote style=margin: 0pt 0pt 0pt 0.8ex; border-left: 
1px solid rgb(204, 204, 204); padding-left: 1ex;br
Éric Araujo lt;a href=mailto:mer...@netwok.org;mer...@netwok.org/agt; 
added the comment:br
br
Thanks for your work on this.  I made some minor comments on Rietveld (you 
should get an email), waiting for the real import experts to comment on the 
meat of the patch.br
br
--br
nosy: +eric.araujobr
divdiv/divdiv class=h5br
___br
Python tracker lt;a 
href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;br
lt;a href=http://bugs.python.org/issue11561; 
target=_blankhttp://bugs.python.org/issue11561/agt;br
___br
/div/div/blockquote/divbr
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-03-22 Thread Sandro Tosi

Changes by Sandro Tosi sandro.t...@gmail.com:


--
nosy: +sandro.tosi

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-03-21 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
assignee:  - brett.cannon
components: +Demos and Tools
stage:  - patch review
versions: +Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-03-15 Thread Brandon Craig Rhodes

New submission from Brandon Craig Rhodes bran...@rhodesmill.org:

When running the Python regression tests in coverage, the initial outer level 
of interpreted code in several standard library modules shows as not having 
been covered by the tests, because they were imported during the Python boot 
process and were already loaded when the coverage command got control.

--
messages: 131051
nosy: brandon-rhodes
priority: normal
severity: normal
status: open
title: coverage of Python regrtest cannot see initial import of libs

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-03-15 Thread Brandon Craig Rhodes

Brandon Craig Rhodes bran...@rhodesmill.org added the comment:

Here is a module that solves this problem if the tests are run with the 
fullcoverage directory at the front of the PYTHONPATH, like this:

PYTHONPATH=Tools/fullcoverage ./python -m coverage run --pylib 
Lib/test/regrtest.py test_copy

--
keywords: +patch
Added file: http://bugs.python.org/file21232/fullcoverage.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11561] coverage of Python regrtest cannot see initial import of libs

2011-03-15 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
nosy: +brett.cannon, ncoghlan

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11561
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com