Commit Graph

13000 Commits

Author SHA1 Message Date
Greg Ward 3ca54bc846 Provides the Extension class, a nicer way to describe C/C++ extensions than
the old (ext_name, build_info) tuple.
2000-05-31 01:05:35 +00:00
Fred Drake 6c16019136 Fixed typo noted by Guido Kollerie <gkoller@cs.vu.nl> in example code. 2000-05-30 14:39:45 +00:00
Guido van Rossum 7f91cf9a68 Add 'r' to docstrings to avoid expanded backslash escapes. (Ka-Ping Yee) 2000-05-30 13:25:35 +00:00
Greg Ward 3e7b133c95 Added concrete example of when separate build and install might be
useful (suggested by Moshe Zadka).
2000-05-30 03:00:43 +00:00
Greg Ward 98150114e0 Cosmetic tweak. 2000-05-30 02:04:54 +00:00
Greg Ward 66ac93e6f7 Catch CCompiler exceptions in 'setup()'. 2000-05-30 02:04:29 +00:00
Greg Ward 3add77f611 Import exceptions from errors.py, not ccompiler.py. 2000-05-30 02:02:49 +00:00
Greg Ward 39804cbc60 Removed exceptions -- now in errors.py to avoid expensive import of ccompiler. 2000-05-30 02:02:48 +00:00
Greg Ward c1cb0493f8 Moved the CCompiler exceptions here, to avoid having to import ccompiler.py
just to get a little exception class.
No more string-based exceptions.
2000-05-30 02:02:14 +00:00
Greg Ward d151711e66 Changed to catch compile/link failures and raise CompileError, LibError,
or LinkError (exception classes defined in ccompiler.py).
2000-05-30 01:56:44 +00:00
Greg Ward adda156a13 Added 'dump_options()' for debugging output. 2000-05-28 23:54:00 +00:00
Greg Ward c32d9a6952 Factored '_set_command_options()' out of 'get_command_obj()'.
Added 'reinitialize_command()' -- lets us "push" option values in
  a controlled, safe way; this is a small change to the code, but
  a big change to the Distutils philosophy of passing option values
  around.  The preferred mode is still definitely to "pull" options
  from another command (eg. "install" fetches the base build directory
  from "build"), but it is now feasible to "push" options onto another
  command, when you know what's best for it.  One possible application
  will be a "config" command, which pokes around the system and pushes
  values (eg. include and library directories) onto the "build" command.
Added 'dump_option_dicts()' method (for debugging output).
2000-05-28 23:53:06 +00:00
Greg Ward 2129032bc6 Changed order so 'clean' is right after the 'build' commands. 2000-05-28 23:49:03 +00:00
Greg Ward fbb04c448c Only print debugging output if DEBUG (imported from distutils.core) is true. 2000-05-28 23:47:31 +00:00
Greg Ward 0eeebfda98 Moved warnings out of 'finalize_options()' into 'run()'.
Added a warning for 'bdist_base' directory.
2000-05-28 23:47:00 +00:00
Greg Ward 9581144329 Typo fix in comment. 2000-05-28 20:29:48 +00:00
Greg Ward 4fb29e55f8 Some far-reaching naming changes:
* Command method 'find_peer()' -> 'get_finalized_command()'
  * Command method 'run_peer()' -> 'run_command()'
Also deleted the 'get_command_option()' method from Command, and
  fixed the one place where it was used (in "bdist_dumb").
2000-05-27 17:27:23 +00:00
Andrew M. Kuchling 25bfd0e8d0 Article about 1.6 new features 2000-05-27 11:28:26 +00:00
Greg Ward e5b267ccb6 Patch from Andrew Kuchling: prune out the build and source distribution
directories after all is said and done, so we don't accidentally include
those files in the source distribution.

(This is the quick and easy way to fix this; Andrew says: "Changing
findall() looked like it was going to be messy, so I tried this instead.
The only problem is that redundant directory traversals are being done,
walking through build/ only to throw out all the files found at the end.").
2000-05-27 03:03:23 +00:00
Greg Ward 51def7d667 Support for the "install_headers" command: distribution option 'headers'
and method 'has_headers()'.
2000-05-27 01:36:14 +00:00
Greg Ward 2d238c56a6 'mkpath()' now detects non-string 'name' arguments -- this is a fairly common
bug when adding new code, so I thought I'd make it blow up earlier
than deep in posix.py.
2000-05-27 01:35:27 +00:00
Greg Ward 46380906d1 Tweaked description, help text. 2000-05-27 01:33:49 +00:00
Greg Ward cae5a1f444 Support for the "install_headers" command:
* 'headers' entry added to all the install schemes
  * '--install-headers' option added
  * 'install_headers' added to 'sub_commands'
  * added 'dist_name' to configuration variables (along with a few
    others that seem handy: 'dist_version', 'dist_fullname', and
    'py_version'
  * in 'finalize_unix()', make sure 'install_headers' defined if
    user specified 'install_base' and/or 'install_platbase'
  * added 'has_headers()'
  * a few other small changes
2000-05-27 01:33:12 +00:00
Greg Ward aa0e77115f Added 'install_headers' command to install C/C++ header files. 2000-05-27 01:25:16 +00:00
Jeremy Hylton 847a9968e9 Patch from M.-A. Lemburg:
Python on UNIX now trusts PYTHONHOME unconditionally

Modules/getpath.c:

Landmark changed to os.py.

Setting PYTHONHOME now unconditionally sets sys.prefix
(and sys.exec_prefix). No further checks are done whether the
standard lib can be found in that location or not. This is in
sync with the PC subdir getpath implementations.

PC/getpathp.c:

Landmark changed to os.py.

PC/os2vacpp/getpathp.c:

Landmark changed to os.py.

Note: BAW's checkin on exceptions.c eliminates earlier concerns about
a bogus PYTHONHOME value leading to a core dump.  Instead it causes a
useless sys.path and prevents imports.
2000-05-26 21:49:07 +00:00
Fred Drake b80a777859 Added documentation for gettempprefix().
Deprecated direct access to template.
Added note about past need to modify template so that legacy code has a
better chance of being understood, noting that the requirement to reset
template after os.fork() disappeared in 1.5.2.
2000-05-26 19:32:14 +00:00
Barry Warsaw 262e83cb1a This module is obsolete now that the standard exceptions are built-in. 2000-05-26 19:06:13 +00:00
Fred Drake 0233075fce Added documentation for TemporaryFile() and the siffix parameter to mktemp().
Removed obsolete comments about this module not creating or removing actual
files.
Removed obsolete comment about users needing to set template to None after
calling os.fork().
2000-05-26 19:05:16 +00:00
Barry Warsaw 675ac285ae The standard exception classes. Moved here from ../Modules/_exceptions.c 2000-05-26 19:05:16 +00:00
Barry Warsaw f17861badc Added exceptions.o to the list of object to build in this subdir. 2000-05-26 19:04:27 +00:00
Barry Warsaw c8019add6c _exceptions.c is moved to ../Python/exceptions.c 2000-05-26 19:03:19 +00:00
Barry Warsaw b1387aa7af The _exceptions module is moved to the Python subdirectory. 2000-05-26 19:02:42 +00:00
Greg Ward 57c9a663cb When building on Solaris and the compiler is GCC, use '$(CC) -G' to
create shared extensions rather than 'ld -G'.  This ensures that shared
extensions link against libgcc.a, in case there are any functions in the
GCC runtime not already in the Python core.
2000-05-26 12:22:54 +00:00
Fred Drake 99d707af47 Piers Lauder <piers@cs.su.oz.au>:
I've added an extra comment about quoting arguments to
IMAP4 commands. Also changed the command descriptions
to show optional extra commands where appropriate.

Fred Drake:
Added example usage for the search() method based on comments from
<Lucas.DeJonge@awtpl.com.au>; elaborated error handling information
when arguments are missing from search() and uid().
2000-05-26 04:08:37 +00:00
Greg Ward 6153fa19ce Guido's rewording of my definition of "root package", with an addition by me. 2000-05-26 02:24:28 +00:00
Greg Ward 521340034e Rene Liebscher: check if the extension file (.so or .pyd) is
up-to-date with respect to the source files; that way, we
don't needlessly rebuild just because object files go away.
2000-05-26 01:31:53 +00:00
Greg Ward 59d382e482 A grab-bag of wording tweakage. 2000-05-26 01:04:47 +00:00
Greg Ward 0e48cfd2c5 Factored out code for extracting-or-creating one of the option
dictionaries in 'self.command_options' to 'get_option_dict()'.
Simplified code in 'parse_config_files()' and 'parse_command_line()'
  accordingly.
Fixed code in constructor that processes the 'options' dictionary
  from the setup script so it actually works: uses the new
  'self.command_options' dictionary rather than creating command
  objects and calling 'set_option()' on them.
2000-05-26 01:00:15 +00:00
Greg Ward 37af1c3807 Added the DEBUG global (set from the DISTUTILS_DEBUG environment variable).
Changed the exception-handling code in 'setup()' to re-raise exceptions
  if DEBUG is true.
2000-05-26 00:54:52 +00:00
Greg Ward 8bbba17d38 Fixed a couple of long-hidden bugs (amazing what you find when you
attempt to verify the bold assertions in the documentation):
  * entries for the "root package" in 'package_dir' didn't work --
    fixed by improving the fall-through code in 'get_package_dir()'
  * __init__.py files weren't installed when modules-in-packages
    were listed individually (ie. in 'py_modules' in the setup script);
    fixed by making 'check_package()' return the name of the __init__
    file if it exists, and making 'find_modules()' add an entry to
    the module list for __init__ if applicable
2000-05-26 00:44:06 +00:00
Barry Warsaw 8415edb433 Built-in class-based standard exceptions. Written by Fredrik Lundh.
Modified, proofread, and integrated for Python 1.6 by Barry Warsaw.
2000-05-25 23:18:47 +00:00
Barry Warsaw 992cb8ab53 Added a test to catch the base class. 2000-05-25 23:16:54 +00:00
Barry Warsaw 9357854187 For backwards compatibility, simply import everything from the
_exceptions module, including __doc__.
2000-05-25 23:15:52 +00:00
Barry Warsaw 78e6c671db All the exception building related stuff has been moved out of this
module and into _exceptions.c.  This includes all the PyExc_* globals,
the bltin_exc table, init_class_exc(), fini_instances(),
finierrors().

Renamed _PyBuiltin_Init_1() to _PyBuiltin_Init() since the two phase
initializations are necessary any more.

Removed as obsolete _PyBuiltin_Init_2(), _PyBuiltin_Fini_1() and
_PyBuiltin_Fini_2().
2000-05-25 23:15:05 +00:00
Barry Warsaw cfa2dba720 Added the _exceptions module, implementing the built-in class-based
standard exceptions.
2000-05-25 23:10:52 +00:00
Barry Warsaw f242aa0d1e Py_Initialize(): Now that standard exceptions are builtin, we don't
need two phase init or fini of the builtin module.  Change the call of
_PyBuiltin_Init_1() to _PyBuiltin_Init().  Add a call to
init_exceptions().

Py_Finalize(): Don't call _PyBuiltin_Fini_1().  Instead call
fini_exceptions() but move this to before the thread state is
cleared.
2000-05-25 23:09:49 +00:00
Barry Warsaw c094ac856f Now that standard exceptions are builtin, we don't need two phase init
or fini of the builtin module.

_PyBuiltin_Init_1 => _PyBuiltin_Init
_PyBuiltin_Init_2 removed
_PyBuiltin_Fini_1 removed
_PyBuiltin_Fini_2 removed

These functions are used to initialize the _exceptions module.

init_exceptions added
fini_exceptions added
2000-05-25 23:05:36 +00:00
Greg Ward fe55e86a0a Take the basename of the script before concatenating it with the build dir. 2000-05-25 20:05:52 +00:00
Fred Drake fd267d998d Piers Lauder <piers@cs.su.oz.au>:
This patch adds a comment about quoting to the doc string,
and also checks that the 'flags' argument to the STORE command
is appropriately enclosed inside parentheses to avoid quoting.
2000-05-25 03:25:26 +00:00
Barry Warsaw 1226588e57 bltin_exc: Removed the leaf_exc flag in the structure, which was only
used to build the fallback string-based exception.
2000-05-25 03:18:53 +00:00