Changeset 791
- Timestamp:
- 08/19/07 10:59:28 (1 year ago)
- Files:
-
- pyrun/trunk/ChangeLog (modified) (1 diff)
- pyrun/trunk/examples/examples-as-tests.txt (modified) (1 diff)
- pyrun/trunk/pyrun.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pyrun/trunk/ChangeLog
r790 r791 3 3 4 4 0.1.1: 5 * Added support for including .pth files in the discovery phase. This 6 makes it possible to insert paths to directories which do not contain 7 an __init__.py or are the dirname() of an explicitly referenced module 8 file. 5 9 * bugfix: propagate source file name (or sensibly invented filename) to 6 10 the __file__ attribute of the code instance that becomes our __main__ pyrun/trunk/examples/examples-as-tests.txt
r783 r791 6 6 # or 7 7 cd pyrun-trunk 8 python pyrun.py - S`which nosetests` lib/ -v --with-doctest --doctest-extension=.rst -w examples/8 python pyrun.py -C `which nosetests` lib/ -v --with-doctest --doctest-extension=.rst -w examples/ 9 9 10 10 pyrun/trunk/pyrun.py
r790 r791 6 6 7 7 from os.path import join, dirname, basename, isfile, isdir, exists 8 from os.path import splitext 8 9 9 10 have_runpy=False … … 353 354 if not exists(a): 354 355 doesnotexist.append(a) 356 357 # Support .pth files but *dont* recurse. 358 # - we do not treat the directory containing the .pth file as though 359 # it was a python site directory. 360 # (See: http://docs.python.org/inst/search-path.html) 361 # - we ignore any entry in the .pth file that does not identify 362 # a file or directory (ie, setuptools style import tricks do not 363 # get eval'd) 364 # Note: that any findpaths which were encountered before the .pth file 365 # will appread in sys.path *before* the paths in the path file. Also 366 # note that using a .pth file is the only currently supported way to 367 # inject a directory onto the path which is not either an egg or a 368 # module or a toplevel package directory. 369 elif isfile(a) and splitext(a)[1] == '.pth': 370 if findpaths: 371 newpaths = find_package_paths(pth=pthset, 372 *findpaths 373 ) 374 pthextend.extend(newpaths) 375 findpaths[:] = [] 376 pthextend.extend(ln.strip() for ln in file(a) 377 if exists(ln.strip()) 378 ) 379 continue 355 380 356 381 minfo = path_pkg_moduleinfo(a)