Based on lsprof (patch #1212837) by Brett Rosen and Ted Czotter.
With further editing by Michael Hudson and myself.
History in svn repo: http://codespeak.net/svn/user/arigo/hack/misc/lsprof
* Module/_lsprof.c is the internal C module, Lib/cProfile.py a wrapper.
* pstats.py updated to display cProfile's caller/callee timings if available.
* setup.py and NEWS updated.
* documentation updates in the profiler section:
- explain the differences between the three profilers that we have now
- profile and cProfile can use a unified documentation, like (c)Pickle
- mention that hotshot is "for specialized usage" now
- removed references to the "old profiler" that no longer exists
* test updates:
- extended test_profile to cover delicate cases like recursion
- added tests for the caller/callee displays
- added test_cProfile, performing the same tests for cProfile
* TO-DO:
- cProfile gives a nicer name to built-in, particularly built-in methods,
which could be backported to profile.
- not tested on Windows recently!
A new hashlib module to replace the md5 and sha modules. It adds
support for additional secure hashes such as SHA-256 and SHA-512. The
hashlib module uses OpenSSL for fast platform optimized
implementations of algorithms when available. The old md5 and sha
modules still exist as wrappers around hashlib to preserve backwards
compatibility.
properly build the module.
Also moved up the creation of config_h_vars (from
distutils.sysconfig.parse_config_h()) higher on up in detect_modules() so that
it can be used sooner).
LDFLAGS and CPPFLAGS for library and include directories, respectively. Solves
issue of either env var containing other options that do not pertain to the
directories being searched for.
This is to avoid a problem that inconsistently comes up where the environment
variable is unset while the Makefile clearly has the values set and are used
during ``make``.
Closes bug #1081045.
directories) and the include directories specified in CPPFLAGS (``-I``
directories) for compiling the extension modules.
This has led to the core being compiled with the values in the shell's
CPPFLAGS. It has also removed the need for special casing to use Fink and
DarwinPorts under darwin since the needed directories can now be specified in
LDFLAGS and CPPFLAGS (e.g., DarwinPorts users can now do
``LDFLAGS=-L/opt/local/lib; CPPFLAGS=-I/opt/local/include; ./configure`` for
everything to work properly).
Parsing the values in the environment variables is done with getopt. While optparse
would have been a nicer solution it cannot be used because of dependency issues
at execution time; optparse uses gettext which uses struct which will not have
been compiled when the code is imported. If optparse ever makes its
importation of gettext optional by catching ImportError and setting _() to an
identity function then it can be used.
regrtest.py: skip rgbimg and imageop as they are not built on 64-bit systems.
_tkinter.c: replace %.8x with %p for printing pointers.
setup.py: add lib64 into the library directories.
Mac-specific modules. Before all modules were compiled but would fail thanks
to a dependence on the code included when Python was built without the compiler
flag.
Closes bug #991962.
and installed layouts to make maintenance simple and easy. And it
also adds four new codecs; big5hkscs, euc-jis-2004, shift-jis-2004
and iso2022-jp-2004.
by request of Donovan Preston. In return, he promised to use this
to create a Python OSA component, which would turn Python
into a first-class OSA scripting language (like AppleScript itself).
Change setup.py to catch all exceptions.
- Rename module if the exception was an ImportError
- Only warn if the exception was any other error
Revert _iconv_codec to raising a RuntimeError.
It also prevents building against the real X headers, if installed.
After discussions with the Cygwin project lead, I believe that building
against the real X headers is OK. Especially, since the psuedo-X headers
are *not* installed by the Cygwin Tcl/Tk binary package.
Note that this patch just reverts the lib_prefix (i.e., "cyg") portion
of my Tcl/Tk 8.3 patch. It seems that Cygwin Tcl/Tk is using a more
normal file naming convention again.
compiler flags which are necessary to get a clean compile. The former is
for user-specified optimizer, debug, trace fiddling. See patch 640843.
Add /sw/lib and /sw/include to setup.py search paths on Darwin to take
advantage of fink goodies.
Add scriptsinstall target to Makefile to install certain scripts from
Tools/scripts directory.
The attached patch enables Cygwin Python to
build cleanly against the latest Cygwin Tcl/Tk
which is based on Tcl/Tk 8.3. It also prevents
building against the real X headers, if installed.
of using the CCompiler.find_library_file() provided by the Distutils.
This patch fixes it to use the Distutils method at the cost of some
additional glue.
(The duplication resulted in the SSL module not being automatically
built on Macs; the Distutils knew that shared libraries on OS X have a
.dylib extension, but the setup.py code didn't.)
whether they crash or not is not a matter of using a framework or not,
but whether the code is run from an app bundle or not. And that it
_can_ crash (instead of tracing back) is Apple's bug anyway, not ours.
Push /usr/... further down the list - always check /usr/local/... before
/usr/...
Doubt this will help with http://python.org/sf/589427 or not, but these
changes were prompted by my investigation of that bug report. I wasn't able
to reproduce that problem though
This patch enables setup.py to find gettext routines when they are
located in libintl instead of libc. Although I developed this patch for
Cygwin, I hope that it can be easily updated to support other platforms
(if necessary). I tested this patch under Cygwin and Red Hat Linux 7.1.
setup.py (indirectly) script to build the standard dynamically loaded
modules, the errno module is being made static so it will always be
available.
Closes SF bug #591205 (needed on trunk only).
OSX framework build process. Things fixed/modified:
- the filesystem case-sensitivity test now works for builds outside
the source directory
- various other fixes for building outside the source directory
- python.app now has a target in the main Makefile
- WASTE and AquaTk are found more automatically
library. Since multiple versions can be installed simultaneously, it's
crucial that you only select libraries and header files which are compatible
with each other. Version checking is done from highest version to lowest.
Building using version 1 of Berkeley DB is disabled by default because of
the hash file bugs people keep rediscovering. It can be enabled by
uncommenting a few lines in setup.py. Closes patch 553108.
modules, distutils does not understand that the build version of the
source tree is needed.
This patch fixes distutils.sysconfig to understand that the running
Python is part of the build tree and needs to use the appropriate
"shape" of the tree. This does not assume anything about the current
directory, so can be used to build 3rd-party modules using Python's
build tree as well.
This is useful since it allows us to use a non-installed debug-mode
Python with 3rd-party modules for testing. It as the side-effect that
set_python_build() is no longer needed (the hack which was added to
allow distutils to be used to build the "standard" extension modules).
This closes SF patch #547734.
mwh wrote:
> Jason, feel free to complain if you think this isn't
> the right thing to do.
I guess that I would like to complain and reopen this
issue. :,) I cannot build a Python 2.2.1 with threads
under Cygwin without this patch even though I'm using
Michael's static _socket workaround. This is due to the
Cygwin fork() problem with DLL base address conflicts
that are triggered by importing many modules during the
setup.py run. Similar problems can also be caused by
regrtest.py.
Even after my rebase patch is accepted into Cygwin's
setup.exe, I feel this patch will still be necessary.
This is because during the build process, the shared
extensions (i.e., DLLs) will not be rebased yet. Hence,
the potential for DLL base address conflicts will exist.
One way to obviate this patch is to push the rebase
functionality into Cygwin's ld. Unfortunately, I don't
think this is likely to happen. Another possible way,
is to use the yet to be defined and implemented unload
module functionality:
http://mail.python.org/pipermail/python-dev/2001-December/019028.html