Greg Ward [Fri, 31 Mar 2000 05:08:50 +0000 (05:08 +0000)]
Rename 'formats' option to 'format', and remove the ability to generate
multiple built distributions in one run -- it seemed a bit dodgy and I'd
rather remove it than try to beat it into submission right now.
Greg Ward [Fri, 31 Mar 2000 03:50:23 +0000 (03:50 +0000)]
Patch (mostly) from Thomas Heller for building on Windows:
* build to "Debug" or "Release" temp directory
* put linker turds (.lib and .exp files) in the build temp directory
* tack on "_d" to extensions built with debugging
* added 'get_ext_libname()' help in putting linker turds to temp dir
Also, moved the code that simplifies None to empty list for a bunch
of options to 'finalize_options()' instead of 'run()'.
Guido van Rossum [Fri, 31 Mar 2000 03:29:39 +0000 (03:29 +0000)]
Add back an obscure "feature" to the Obj version of Tkapp_Call(): a
None in an argument list *terminates* the argument list: further
arguments are *ignored*. This isn't kosher, but too much code relies
on it, implicitly. For example, IDLE was pretty broken.
Greg Ward [Fri, 31 Mar 2000 03:05:18 +0000 (03:05 +0000)]
Added 'get_name()' and 'get_full_name()' methods to Distribution.
Simplified 'Command.get_peer_option()' a tad -- just call 'find_peer()'
to get the peer command object.
Updated 'Command.copy_file()' to take a 'link' parameter, just like
'util.copy_file()' does now.
Added 'Command.make_archive()' to wrap 'util.make_archive()'.
Greg Ward [Fri, 31 Mar 2000 03:02:22 +0000 (03:02 +0000)]
Added 'create_tree()'.
Changes to 'copy_file()':
* added support for making hard links and symlinks
* noted that it silently clobbers existing files when copying, but
blows up if destination exists when linking -- hmmm...
* error message tweak
Added 'base_name' parameter to 'make_tarball()' and 'make_zipfile()'.
Added 'make_archive()' -- wrapper around 'make_tarball()' or
'make_zipfile()' to take care of the archive "root directory".
Greg Ward [Fri, 31 Mar 2000 02:56:34 +0000 (02:56 +0000)]
The 'bdist_dumb' command, the first worker bee for use by 'bdist'. This is
the command that actually creates "dumb" binary distributions, ie.
tarballs and zip files that you just unpack under <prefix> or <exec-prefix>.
Very limited, but it's a start.
Greg Ward [Fri, 31 Mar 2000 02:55:12 +0000 (02:55 +0000)]
The 'bdist' command, for creating "built" (binary) distributions.
Initial revision is pretty limited; it only knows how to generate "dumb"
binary distributions, i.e. a tarball on Unix and a zip file on Windows.
Also, due to limitations in the installation code, it only knows how to
distribute Python library code. But hey, it's a start.
Greg Ward [Fri, 31 Mar 2000 02:50:04 +0000 (02:50 +0000)]
Changed to use the new 'has_pure_modules()' and 'has_ext_modules()' methods
provided by Distribution.
Cosmetic and error message tweaks.
Simplified 'make_release_tree()':
* extracted 'distutils.util.create_tree()'
* don't have to do hard-linking ourselves -- it's now handled by
'distutils.util.copy_file()' (although the detection of
whether hard linking is available still needs to be factored out)
Removed 'make_tarball()' and 'make_zipfile()' entirely -- their role
is now amply filled by 'distutils.util.make_archive()'.
Simplified 'make_distribution()':
* use Distribution's new 'get_full_name()' method
* use 'make_archive()' instead of if/elif/.../else on the archive format
Guido van Rossum [Fri, 31 Mar 2000 01:17:07 +0000 (01:17 +0000)]
Hacked for Win32 by Mark Hammond.
Reformatted for 8-space tabs and fitted into 80-char lines by GvR.
Mark writes:
* the Win32 version now accepts the same args as the Unix version.
The win32 specific "tag" param is now optional. The end result is
that the exact same test suite runs on Windows (definately a worthy
goal!).
* I changed the error object. All occurences of the error, except
for 1, corresponds to an underlying OS error. This one was changed
to a ValueError (a better error for that condition), and the module
error object is now simply EnvironmentError. All win32 error
routines now call the new Windows specific error handler.
Guido van Rossum [Fri, 31 Mar 2000 00:51:37 +0000 (00:51 +0000)]
Don't use the object call interface in Tk 8.0 -- the EvalObj* API
changed from 8.0 to 8.1 and I see no big reason to use objects in 8.0.
At least now it works again with all versions from 8.0 - 8.3.
Jeremy Hylton [Thu, 30 Mar 2000 23:55:31 +0000 (23:55 +0000)]
Two fixes for extended call syntax:
If a non-tuple sequence is passed as the *arg, convert it to a tuple
before checking its length.
If named keyword arguments are used in combination with **kwargs, make
a copy of kwargs before inserting the new keys.
Guido van Rossum [Thu, 30 Mar 2000 19:45:39 +0000 (19:45 +0000)]
Revamped path access again, by Mark Hammond, to be more robust in the
light of three different situations: (1) running from build; (2)
running from installed; (3) running without being able to find an
installation (e.g. as a COM object). The system paths in the
repository are only used for (3); the path deduced from the
installation location are used otherwise. PYTHONHOME overrides in all
cases.
Guido van Rossum [Thu, 30 Mar 2000 15:02:11 +0000 (15:02 +0000)]
Michael Hudson: With the (cool!) new call syntax, the longest opcode
name is much longer, which fouls up dis's formatting slightly; this is
a "fix" for that.
Guido van Rossum [Thu, 30 Mar 2000 15:00:33 +0000 (15:00 +0000)]
Lawrence Kesteloot noted: Lib/user.py has a comment that says that the
script pointed to by PYTHONPATH will be executed on startup. That
should say PYTHONSTARTUP.
Barry Warsaw [Wed, 29 Mar 2000 21:05:53 +0000 (21:05 +0000)]
__pushtodev(): Ignore transient sunaudiodev.errors when setting the
device info. I don't know why these occur, but they seem to be
shortlived and harmless.
Barry Warsaw [Wed, 29 Mar 2000 18:36:49 +0000 (18:36 +0000)]
eval_code2(): Oops, in the last checkin, we shouldn't check for
PyErr_Occurred(), just set x=NULL and break. Oh, and make Jeremy stop
nagging me about the "special" indentation for this block.
Barry Warsaw [Wed, 29 Mar 2000 18:30:03 +0000 (18:30 +0000)]
eval_code2(): In the extended calling syntax opcodes, you must check
the return value of PySequence_Length(). If an exception occurred,
the returned length will be -1. Make sure this doesn't get obscurred,
and that the bogus length isn't used.
Greg Ward [Wed, 29 Mar 2000 03:29:34 +0000 (03:29 +0000)]
Patch inspired by Bastian Kleineidam <calvin@cs.uni-sb.de>:
use global __debug__ flag to determine if compiled files will be ".pyc"
or ".pyo". Tweaked compilation output messages too.
Greg Ward [Wed, 29 Mar 2000 02:47:29 +0000 (02:47 +0000)]
Moved the guts of 'make_tarball()' and 'make_zipfile()' to distutils.util
in preparation for the 'bdist_dumb' command; these methods remain as
trivial wrappers around the versions in distutils.util.
Greg Ward [Wed, 29 Mar 2000 02:17:42 +0000 (02:17 +0000)]
Be sure to run both 'build_py' and 'build_ext', now that this command
is responsible for installing all Python modules (pure and extensions).
Added 'get_outputs()' in preparation for the 'bdist' command, and
'_mutate_outputs()' to support 'get_outputs()'.
Greg Ward [Wed, 29 Mar 2000 02:15:57 +0000 (02:15 +0000)]
Changed so the sub-commands we rely on to do the real work is specified
in a class attribute 'sub_commands', rather than hard-coded in 'run()'.
This should make it easier to subclass 'install', and also makes it
easier to keep 'run()' and the new 'get_outputs()' consistent.
Added 'get_outputs()' in preparation for the 'bdist' command.
Greg Ward [Wed, 29 Mar 2000 02:14:21 +0000 (02:14 +0000)]
Use the new 'has_pure_modules()', 'has_ext_modules()', 'has_c_libraries()'
methods of Distribution instead of grovelling directly in self.distribution.
Greg Ward [Wed, 29 Mar 2000 02:13:09 +0000 (02:13 +0000)]
Added 'get_outputs()' in prepartion for the 'bdist' command.
Changed signature of 'build_extensions()': no longer takes the extension
list, but uses 'self.extensions' (just like 'get_outputs()' has to)
Moved call to 'check_extensions_list()' from 'run()' to 'build_extensions()',
again for consistency with 'get_outputs()'.
Greg Ward [Wed, 29 Mar 2000 02:10:51 +0000 (02:10 +0000)]
Deleted some crufty comments and code.
A host of improvements in preparation for the 'bdist' command:
- added 'get_outputs()' method (all the other improvements were to support
this addition)
- made 'find_package_modules()' and 'find_modules()' return similar
values (list of (package, module, module_filename) tuples)
- factored 'find_all_modules()' out of 'get_source_files()' (needed
by 'get_outputs()')
- factored 'get_module_outfile()' out of 'build_module()' (also needed
by 'get_outputs()')
- various little tweaks, improvements, comment/doc updates
Guido van Rossum [Wed, 29 Mar 2000 01:49:47 +0000 (01:49 +0000)]
Changes to completely ignore the registry when it detects that you are
running out of the build directory. This means that it will no longer
try to use an older version of the library when an older version has
been installed.
Guido van Rossum [Wed, 29 Mar 2000 00:19:50 +0000 (00:19 +0000)]
The Tcl_Obj patch discussed on the patches list.
This was originally submitted by Martin von Loewis as part of his
Unicode patch; all I did was add special cases for Python int and
float objects and rearrange the object type tests somewhat to speed up
the common cases (string, int, float, tuple, unicode, object).
Jeremy Hylton [Tue, 28 Mar 2000 23:49:17 +0000 (23:49 +0000)]
slightly modified version of Greg Ewing's extended call syntax patch
executive summary:
Instead of typing 'apply(f, args, kwargs)' you can type 'f(*arg, **kwargs)'.
Some file-by-file details follow.
Grammar/Grammar:
simplify varargslist, replacing '*' '*' with '**'
add * & ** options to arglist
Include/opcode.h & Lib/dis.py:
define three new opcodes
CALL_FUNCTION_VAR
CALL_FUNCTION_KW
CALL_FUNCTION_VAR_KW
Python/ceval.c:
extend TypeError "keyword parameter redefined" message to include
the name of the offending keyword
reindent CALL_FUNCTION using four spaces
add handling of sequences and dictionaries using extend calls
fix function import_from to use PyErr_Format
Guido van Rossum [Tue, 28 Mar 2000 21:42:38 +0000 (21:42 +0000)]
Fredrik Lundh:
The new filecmp module has an optional argument called use_statcache
which is documented as a true/false value, but used as an tuple index.
This patches replaces the tuple stuff with a good old if- statement,
and also removes a few other tuple pack/unpack constructs (if not
else, this saves a few bytes in the PYC file, and a few microseconds
when using the module ;-).