Commit Graph

2771 Commits

Author SHA1 Message Date
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 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
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
Barry Warsaw 262e83cb1a This module is obsolete now that the standard exceptions are built-in. 2000-05-26 19:06:13 +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 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 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
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
Greg Ward 101de37907 Fix to use 'change_root()' rather than directly mangling path. 2000-05-25 02:14:26 +00:00
Greg Ward 80fa55e71f Improvements to Bastian's build_scripts command:
* 'first_line_re' loosened up
  * command description improved
  * replaced '_copy_files()' and '_adjust_files()' with one method
    that does everything, 'copy_scripts()' -- this should be more
    efficient than Bastian's version, should behave better in
    dry-run mode, and does timestamp dependency-checking
2000-05-25 02:03:56 +00:00
Greg Ward 029e302786 Added comment to remind us of the (temporary?) obsolescense of the
'install_misc' class.
2000-05-25 01:26:23 +00:00
Greg Ward e3d17526b2 Use Distribution's 'has_scripts()' method instead of directly accessing
its 'scripts' attribute.
2000-05-25 01:21:54 +00:00
Greg Ward a4efe65b43 Bastian Kleineidam: the "build_scripts" command. 2000-05-25 01:20:15 +00:00
Greg Ward 8d5881a2ba Bastian Kleineidam: the "build_scripts" command and changes
necessary to support it.

Details:
  - build command additionally calls build_scripts
  - build_scripts builds your scripts in 'build/scripts' and adjusts the
    first line if it begins with "#!" and ends with "python", optionally
    ending with commandline options (like -O, -t ...).  Adjusting means we
    write the current path to the Python interpreter in the first line.
  - install_scripts copies the scripts to the install_scripts dir
  - install_data copies your data_files in install_data. You can
    supply individual directories for your data_files:

    data_files = ['doc/info.txt', # copy this file in install_scripts dir
      ('testdata', ['a.dat', 'b.dat']), # copy these files in
                                        # install_scripts/testdata
      ('/etc', ['packagerc']),    # copy this in /etc. When --root is
                                  # given, copy this in rootdir/etc
    ]

    So you can use the --root option with absolute data paths.
2000-05-25 01:19:18 +00:00
Greg Ward fcd974efbb Normalized all the end-of-class lines. 2000-05-25 01:10:04 +00:00
Guido van Rossum c580dae6da Fix a problem reported by Oleg Broytmann, who complains that very
often, ftp URLs hang in the final close.  Further analysis suggests
that this is because the close hook in addclosehook() calls the hook
before acually closing the connection.  The hook, in this case, waits
for the '226 Transfer complete' status from the server on the command
socket.  However, more and more ftp servers only send this status when
the data socket has actually been closed -- causing a deadlock.

The fix is simple: in addclosehook.close(), call addbase.close()
*before* calling the closehook.
2000-05-24 13:21:46 +00:00
Greg Ward a570c05997 Catch failure to open installed Makefile, and report it as a
DistutilsPlatformError: "invalid Python installation".  (This will
happen on Red Hat-ish systems where the python-devel package is not
installed.)
2000-05-23 23:14:00 +00:00
Greg Ward 40313cfe6e Fix 'get_command_obj()' so it checks if a command object has an attribute
before setting it -- this will catch bad options (eg. typos) in config files.
2000-05-23 04:11:14 +00:00
Greg Ward 77751c0b49 Added some debuging output (actually moved here from dist.py) --
dump the Distribution's 'command_options' dict after parsing config files,
and then after parsing the command line.
2000-05-23 03:54:16 +00:00
Greg Ward 981f7368f6 Don't take advantage of OptionDummy's new "auto-initialization" feature
after all -- turns out it doesn't buy us much after all...
2000-05-23 03:53:10 +00:00
Greg Ward 474607777d Fixed so options from config files and command lines actually work:
* 'get_command_obj()' now sets command attributes based on
    the 'command_options' dictionary
  * some typos fixed
  * kludged 'parse_config_files()' to re-initialize the ConfigParser
    instance after each file, so we know for sure which config
    file each option comes form
  * added lots of handy debugging output
2000-05-23 03:47:35 +00:00
Greg Ward d7ad5039cb Fixed command description. 2000-05-23 01:55:16 +00:00
Greg Ward 5edcd90f8c Use 'get_command_obj()' instead of 'find_command_obj()'. 2000-05-23 01:55:01 +00:00
Greg Ward 3c67b1dd08 OptionDummy now has a constructor that takes a list of options: each string
in the option list is an attribute of the OptionDummy that will be
initialized to None.
2000-05-23 01:44:20 +00:00
Greg Ward 732745bb70 Tweaked usage message. 2000-05-23 01:43:08 +00:00
Greg Ward d5d8a9982b Marching towards full support of config files: thoroughly overhauled the
command-line parsing code, splitting it up into several methods (new
methods: '_parse_command_opts()', '_show_help()') and making it put options
into the 'command_options' dictionary rather than instantiating command
objects and putting them there.

Lots of other little changes:
  * merged 'find_command_class()' and 'create_command_obj()' and
    called the result 'get_command_class()'
  * renamed 'find_command_obj()' to 'get_command_obj()', and added
    command object creation and maintenance of the command object cache to
    its responsibilities (taken over from 'create_command_obj()')
  * parse config files one-at-a-time, so we can keep track of the
    filename for later error reporting
  * tweaked some help messages
  * fixed up many obsolete comments and docstrings
2000-05-23 01:42:17 +00:00
Guido van Rossum 1d10f3eac2 Changed list_directory() somewhat. It is now only called when there
is no index.htm[l] file, and when it is called, it also spits out the
headers.  When an index.htm[l] file is present, the regular (file
access) path is followed.  Also, when the guessed content-type matches
text/*, open the file in text mode; otherwise in binary mode.
2000-05-21 16:25:29 +00:00
Greg Ward 4355093f94 Tweaked output of 'copy_file()': if copying to a new name, show the whole
destination path, otherwise show just the directory.
2000-05-20 16:05:34 +00:00
Greg Ward a4adafd55b Changed the semantics of the 'sub_commands' list: instead of function
objects, it now has method names.
Added three methods, 'has_lib()', 'has_scripts()', and 'has_data()'
  to determine if we need to run each of the three possible sub-commands.
Added 'get_sub_commands()' to take care of finding the methods named
  in 'sub_commands', running them, and interpreting the results to
  build a list of sub-commands that actually have to be run.
2000-05-20 15:17:09 +00:00
Greg Ward f355d473fa Check if the claimed build directory doesn't exist, and warn that we don't
have any Python modules to install (rather than bomb when we try to copy
a non-existent directory).
2000-05-20 15:08:57 +00:00
Greg Ward 44a61bbb66 Added 'has_scripts()', 'has_data_files()' methods. 2000-05-20 15:06:48 +00:00
Greg Ward 36c36fec7c Added missing import. 2000-05-20 14:07:59 +00:00
Greg Ward f7edea749d Lyle Johnson: added stubs for the four miscellaneous methods that must be
implemented by subclasses, since they are needed by 'gen_lib_options()'.
2000-05-20 13:31:32 +00:00
Greg Ward 5299b6afc5 Added support for the 'export_symbols' parameter to 'link_shared_object()'
and 'link_shared_lib()'.  In MSVCCompiler, this is meaningful: it adds
/EXPORT: options to the linker command line.  In UnixCCompiler, it
is ignored.
2000-05-20 13:23:21 +00:00
Guido van Rossum 974f70d97b Add call to putheader('Host', 'www.python.org') to the example. 2000-05-19 23:06:45 +00:00
Gregory P. Smith 8711a2e150 Changed default developer name.
Added some guiding comments.
2000-05-13 03:35:05 +00:00
Gregory P. Smith 2c067ef904 Template for writing Distutils command modules. 2000-05-13 03:32:36 +00:00
Gregory P. Smith 86ee81e34b Contribution from Harry Henry Gebel: the 'bdist_rpm' command.
(Completely uninspected and untested by me, this is just to
get the code into CVS!)
2000-05-13 03:11:40 +00:00
Gregory P. Smith 21b9e910a5 In 'install_misc': 'self.outfiles' defaults to the empty list, so we don't
have to worry about "or []" in 'get_outputs()'.
2000-05-13 03:10:30 +00:00
Gregory P. Smith 6a901dd1bd List data files are listed in the Distribution attribute 'data_files',
rather than 'data'.
2000-05-13 03:09:50 +00:00
Gregory P. Smith c59d4e0777 Added the 'bdist_base' option, the base temp directory for all bdist commands. 2000-05-13 03:08:28 +00:00
Gregory P. Smith e30b7a91c7 Added 'get_inputs()' methods, needed by the "install" command's
'get_inputs()'.
2000-05-13 03:07:53 +00:00
Gregory P. Smith ba0506b349 Drastically simplified by taking advantage of the "install" command's
new flexibility, specifically the 'root' option.  Now, we just use
"install" to do a fake installation into a temporary directory
(the 'bdist_dir' option, which derives from the 'bdist_base' option of
"bdist"), and then tar/zip up that directory.  This means that dumb
built distributions are now relative to the root directory, rather than
the prefix or exec-prefix; this is probably a feature, but does make
them slightly less flexible.
2000-05-13 03:06:56 +00:00
Gregory P. Smith a04d807127 Rename 'build_bdist' to 'bdist_base', and get it by default from the
"bdist" command rather than "build".
2000-05-13 02:30:15 +00:00
Gregory P. Smith c008488981 Typo fix. 2000-05-13 02:20:43 +00:00
Gregory P. Smith 0ec8ef1601 Made the '--record' option take an argument, which is the name of the
file to write the list of installed files to.
2000-05-13 02:16:45 +00:00
Gregory P. Smith 7e855ef6ad Ditch the explicit search for *.py[co] files -- they're now included in
the list returned by 'get_outputs()', thanks to changes in the
"install_lib" command.
2000-05-13 02:13:53 +00:00
Gregory P. Smith 11fb783fa4 Added '_bytecode_filenames()' method, and use it in 'get_outputs()'
to ensure that compiled bytecode files are considered part of the output
of the "install_lib" command.
2000-05-13 02:11:10 +00:00
Gregory P. Smith f9ebf98725 Moved check for installation to non-sys.path location so it comes
last (after writing list of installed files) -- that way, the warning
is more visible.
2000-05-13 02:01:22 +00:00
Gregory P. Smith 8cb676195b Harry Henry Gebel: add the "--record" option to write the list of
installed files to INSTALLED_FILES.
2000-05-13 01:58:19 +00:00
Gregory P. Smith a190268bf6 Added the 'build_bdist' option and code to clean it up -- this is the
top-level temporary directory for creating built distributions.  (Won't
work yet, since the "build" command doesn't yet have a 'build_bdist'
option, and none of the "bdist" commands support it yet.)
2000-05-13 01:56:55 +00:00
Gregory P. Smith b5ebe5d640 Harry Henry Gebel: get extra compiler flags from the CFLAGS environment
variable.

(Is this really needed?  Can we drop it when the config file mechanism
allows users to set compiler flags in setup.cfg?)
2000-05-13 01:52:14 +00:00
Gregory P. Smith 52e399c904 Harry Henry Gebel: add support for the 'bdist_rpm' command, specifically
the 'no_format_option' class attribute.
2000-05-13 01:49:56 +00:00
Gregory P. Smith d5b53df18c Harry Henry Gebel: add 'bdist_rpm' command. 2000-05-13 01:48:15 +00:00
Gregory P. Smith de5c953a2b From Lyle Johnson: renamed 'implib_dir' to 'implib_file', and
correctly ensure that it's 'dirname' exists.
2000-05-13 01:35:33 +00:00
Gregory P. Smith 6fafca4e1d Added comment/docstring/revision header. 2000-05-12 01:58:29 +00:00
Gregory P. Smith 17f641c143 Fixed 'select_scheme()' so it doesn't override a directory attribute that's
already been set (eg. by a command-line option).
2000-05-12 01:54:50 +00:00
Gregory P. Smith 74ead8ff5d Added --skip-build option, so lazy debuggers/testers (mainly me) don't
have to wade through all the 'build' output when testing installation.
2000-05-12 01:46:47 +00:00
Gregory P. Smith f8f2b98bdd Caught up with renaming in 'install_misc' base class. 2000-05-12 01:34:33 +00:00
Gregory P. Smith ae988a57d2 Deleted some cruft.
Caught up with renaming in 'install_misc' base class.
Changed 'run()' to chmod installed scripts under Unix.
2000-05-12 01:32:30 +00:00
Gregory P. Smith ce2b6b838f In 'install_misc' class:
- renamed '_copydata()' to 'copy_files()'
  - changed it to record complete output filenames
  - dropped '_outputdata()' in favour of much simpler 'get_outputs()'
2000-05-12 01:31:37 +00:00
Gregory P. Smith b2e3bb3d6a Patch from Bastien Kleineidam:
adds the 'install_data' and 'install_scripts' commands; these two
are trivial thanks to the 'install_misc' base class in cmd.py.
(Minor tweaks and commentary by me; the code is untested so far.)
2000-05-12 00:52:23 +00:00
Gregory P. Smith bb8c71d563 Call 'parse_config_files()' at the appropriate point.
Tweaked error-generating code.
2000-05-12 00:42:19 +00:00
Gregory P. Smith 1426354cf6 Preliminary support for config files:
- added 'find_config_files()' and 'parse_config_files()' methods
  - added 'command_options' attribute
Comment/docstring updates.
2000-05-12 00:41:33 +00:00
Gregory P. Smith e7e35ac1c2 Made 'check_environ()' "public" by stripping the leading underscore;
added a global '_environ_checked' so we know if it's already been
called.
2000-05-12 00:40:00 +00:00
Gregory P. Smith 6cd0c43366 Fix from Lyle Johnson: add the '--compiler' option.
Also added creation of 'implib_dir', a temporary directory specific to
  MSVC++ -- but I checked in two ways of fixing it (Lyle's and mine),
  because I'm not sure which is right.
2000-05-12 00:34:12 +00:00
Gregory P. Smith 9668b78b9f Fix from Lyle Johnson: add the '--compiler' option. 2000-05-12 00:33:14 +00:00
Guido van Rossum 71260b846e Added math.rint() -- round according to current IEEE754 mode 2000-05-11 18:19:42 +00:00
Fred Drake 774c931c12 M.-A. Lemburg <mal@lemburg.com>:
Added another test for string formatting (the one that
produced the core dump now fixed in unicodeobject.c).
2000-05-09 19:57:46 +00:00
Guido van Rossum 57af072e5c Add a simple directory listing function. 2000-05-09 14:57:09 +00:00
Guido van Rossum 18865de7bd Set HTTPServer class variable allow_reuse_address to 1, so restarting
the server after it died doesn't require a wait period.
2000-05-09 14:54:13 +00:00
Guido van Rossum e3c7a5fbf5 Add class variable allow_reuse_address in TCPServer -- if nonzero, the
server_bind() method calls setsockopt(SOL_SOCKET, SO_REUSEADDR, 1).
2000-05-09 14:53:29 +00:00
Fred Drake fd4114e7b8 ConfigParser.read():
Instead of wrapping 'filenames' value in a list if it's a
        string, wrap it if it's a string or unicode string.
2000-05-09 14:46:40 +00:00
Guido van Rossum 2a91cd463a Caolan McNamara: properly undo the byte-stuffing of lines starting
with a dot.  [GvR change: only unstuff when line starts with two dots.]
2000-05-09 10:56:00 +00:00
Greg Ward 1500374667 Added comment about the MSVC-specific kludge. 2000-05-09 01:50:41 +00:00
Guido van Rossum 5879a533f1 Deleted some modules that are no longer supported. 2000-05-08 17:42:17 +00:00
Guido van Rossum aad6761cce The usual... 2000-05-08 17:31:04 +00:00
Guido van Rossum 0b095bc092 Deleted the stdwin-based test() function. 2000-05-08 17:29:50 +00:00
Guido van Rossum 813008e506 Deleting all stdwin library modules. 2000-05-08 17:25:17 +00:00
Jeremy Hylton e298c3018c if the GzipFile constructor fails, the __del__ method is still
called.  catch the resulting AttributeError and exit cleanly.
2000-05-08 16:59:59 +00:00
Greg Ward 4779cdfae8 Don't use 'set_option()' or 'get_option()' method -- direct attribute access,
or getattr/setattr, is all that's needed.
2000-05-07 15:32:13 +00:00
Greg Ward c4537ac9b6 Got rid of several little-used and not-very-useful methods: 'get_option()',
'get_options()', 'get_command_option()', 'get_command_options()'.
2000-05-07 15:30:31 +00:00
Greg Ward f4f8e64957 Got rid of some little-used and not-very-useful methods: 'get_option()' and
'get_options()'.
2000-05-07 15:29:15 +00:00
Greg Ward 18856b80e2 Added the ability to sneak extra flags onto the C compiler command line
via an 'extra_compile_args' option in the 'build_info' dictionary.
2000-05-06 13:12:59 +00:00
Guido van Rossum 5193114442 Alas, Vladimir's patch was too aggressive, and started causing really
weird errors.  (E.g. see thread "weird bug in test_winreg" in python-dev.)

Since it's actually useful to be able to re-run an individual test
after running test.autotest, we keep the unloading code, but only for
modules whose full name starts with "test.".
2000-05-05 14:27:39 +00:00
Guido van Rossum 4951782178 Raise ImportError when os.fork does not exist. 2000-05-04 00:36:42 +00:00
Jeremy Hylton be317e615e patches from Mark Hammond
Attached is a set of diffs for the .py compiler that adds support
for the new extended call syntax.

compiler/ast.py:
CallFunc node gets 2 new children to support extended call syntax -
"star_args" (for "*args") and "dstar_args" (for "**args")

compiler/pyassem.py
It appear that self.lnotab is supposed to be responsible for
tracking line numbers, but self.firstlineno was still hanging
around.  Removed self.firstlineno completely.  NOTE - I didnt
actually test that the generated code has the correct line numbers!!

Stack depth tracking appeared a little broken - the checks never
made it beyond the "self.patterns" check - thus, the custom methods
were never called!  Fixed this.

(XXX Jeremy notes: I think this code is still broken because it
doesn't track stack effects across block bounaries.)

Added support for the new extended call syntax opcodes for depth
calculations.

compiler/pycodegen.py

Added support for the new extended call syntax opcodes.

compiler/transformer.py

Added support for the new extended call syntax.
2000-05-02 22:32:59 +00:00
Guido van Rossum 1b6aecb08c I know this is only a temporary stop-gap measure, but the match() and
search() functions didn't even work because _fixflags() isn't
idempotent.  I'm adding another stop-gap measure so that you can at
least use sre.search() and sre.match() with a zero flags arg.
2000-05-02 15:52:33 +00:00
Guido van Rossum 823eb4ba81 Caolan McNamara:
telnetlib is unable to connect to a few telnet daemons because of
improper IAC handling, heres an attached oneliner to reject WILL
messages which will allow many more telnet daemons to work with it,
namely FreeBSD.
2000-05-02 14:32:11 +00:00
Guido van Rossum 4b83ecbbaa Eric Raymond:
Add a convenience function to generate C-compiler style error leaders.
2000-05-01 20:14:12 +00:00
Guido van Rossum eb4e11ae44 Eric Raymond:
Added and documented the capability for shlex to handle lexical-level
inclusion and a stack of input sources.  Also, the input stream member
is now documented, and the constructor takes an optional source-filename.
The class provides facilities to generate error messages that track
file and line number.

[GvR: I changed the __main__ code so that it actually stops at EOF, as
Eric surely intended -- however it returned '' instead of the None he
was testing for.]
2000-05-01 20:08:46 +00:00
Guido van Rossum d58c26fec6 Marc-Andre Lemburg:
The two methods .readline() and .readlines() in StreamReaderWriter
didn't define the self argument. Found by Tom Emerson.
2000-05-01 16:17:32 +00:00
Guido van Rossum 6650320349 Get rid of memory leak caused by assingning sys.exc_info() to a local.
Store sys.exc_info()[:2] instead.
2000-04-28 20:39:58 +00:00
Jeremy Hylton 7c4f96f442 Deviant1 didn't work as advertised 2000-04-27 21:42:48 +00:00
Jeremy Hylton 035a07e263 add some more contains tests on the builtin types 2000-04-27 21:40:08 +00:00
Greg Ward 6a647bb910 Added the "--root" option as a sort of meta-install-base; if supplied,
it is forcibly prepended onto all installation directories, even if
  they are already absolute.
Added 'dump_dirs()' to clean up the debug output a bit.
2000-04-27 01:56:38 +00:00
Greg Ward 67f75d4bcb Added 'change_root()' to forcibly slap a new root directory onto a pathname,
even if it's already absolute.  Currently only implemented for Unix; I'm
not entirely sure of the right thing to do for DOS/Windows, and have no
clue what to do for Mac OS.
2000-04-27 01:53:46 +00:00
Guido van Rossum 868b50af17 Michael Hudson fixes a case where execv() is called (for a test) with
an empty argument list -- another patch he's checking in will make
this illegal (the first argument should always be the program name).
2000-04-26 20:32:08 +00:00
Greg Ward ff2d9b7154 Hacked things up a bit so that configuration variables are expanded
in command-line options, and in two phases at that: first, we expand
'install_base' and 'install_platbase', and then the other 'install_*'
options.  This lets us do tricky stuff like
    install --prefix='/tmp$sys_prefix'
...oooh, neat.

Simplified 'select_scheme()' -- it's no longer responsible for expanding
config vars, tildes, etc.

Define installation-specific config vars in 'self.config_vars', rather than
in a local dictionary of one method.  Also factored '_expand_attrs()' out
of 'expand_dirs()' and added 'expand_basedirs()'.

Added a bunch of debugging output so I (and others) can judge the
success of this crazy scheme through direct feedback.
2000-04-26 02:38:01 +00:00
Greg Ward 6ce94b72c6 Harry Henry Gebel: import exception classes. 2000-04-26 02:29:51 +00:00
Greg Ward e5a584e865 Harry Henry Gebel: add 'long_description' to DistributionMetadata. 2000-04-26 02:26:55 +00:00
Greg Ward 839d532e50 Supply short form for --manifest-only (-o) and --force-manifest (-f)
options.
2000-04-26 01:14:33 +00:00
Greg Ward 1b8e1d4c0d Harry Henry Gebel:
Fix 'sdist.write_manifest()' to respect the value of dry_run.
2000-04-26 01:12:40 +00:00
Guido van Rossum 7da3cc5dfb Michael Hudson:
I think that after this patch, all objects in the os module (with names
that don't start with "_") that can have docstrings, do, on Linux at
least.

Also fix a nit in one of my spawn* docstrings.
2000-04-25 10:53:22 +00:00
Greg Ward a74ce01c98 Bumped version to 0.8.2. 2000-04-25 01:55:58 +00:00
Greg Ward f194878d6a Harry Henry Gebel:
Adds bztar format to generate .tar.bz2 tarballs

Uses the -f argument to overright old tarballs automatically, I am
assuming that if the old tarball was wanted it would have been moved or
else the version number would have been changed.

Uses the -9 argument to bzip2 and gzip to use maximum
compression. Compress uses the maximum compression by default.

Tests for correct value for the 'compress' argument of make_tarball. This
is one less place for someone adding new compression programs to forget to
change.
2000-04-25 01:38:20 +00:00
Greg Ward 464023fb64 Lyle Johnson: fixed broken logic in 'native_path()'. 2000-04-25 01:33:11 +00:00
Andrew M. Kuchling 43c5af026f Fix to previous patch: send the request data when it's provided 2000-04-24 14:17:06 +00:00
Guido van Rossum c1488413e4 Added a provision to stop all threads before exiting from the test:
the change to regrtest.py to unload all newly imported modules did
something bad to the threads -- and I realized that they would never
stop!
2000-04-24 14:07:03 +00:00
Guido van Rossum 2512d6d83a Fix spelling error and remove Windows line endings. 2000-04-24 14:01:51 +00:00
Guido van Rossum 00f09b3821 Security patch for Unix by Chris McDonough.
This uses the same precautions when trying to find a temporary
directory as when the actual tempfile is created (using O_CREAT and
O_EXCL).  On non-posix platforms, nothing is changed.
2000-04-24 13:28:02 +00:00
Andrew M. Kuchling 141e9894b7 Fixed bug reported by JP Calderone: https:// URL's didn't work.
The fix also adds support for POSTing to an https URL
2000-04-23 02:53:11 +00:00
Greg Ward 66bf446273 Patch from Harry Henry Gebel: fix two stupid bugs in help-printing stuff. 2000-04-23 02:50:45 +00:00
Greg Ward 3af07e9a78 Sporadic, untested Python 1.5.1 compatibility changes. 2000-04-22 15:17:14 +00:00
Greg Ward aa458bc465 Merged in Python 1.5.1 compatibility changes from the 0.1.3 branch:
added 'abspath()' and 'extend()'.
2000-04-22 15:14:58 +00:00
Greg Ward d80506c238 Merged in code from the 0.1.5 release to handle IOError and OSError
exceptions better.
2000-04-22 03:20:49 +00:00
Greg Ward 6a9a545ab1 Check that 'self.formats' is good early on. 2000-04-22 03:11:55 +00:00
Greg Ward ddad73bca9 Catch DistutilsOptionError in 'setup()' -- it's thrown either because of
errors in the setup script or on the command line, so shouldn't result
in a traceback.
2000-04-22 03:11:17 +00:00
Greg Ward db80754abc Extracted the "what-do-I-do-for-this-format" logic from code in
'make_archive()' to a global static dictionary, ARCHIVE_FORMATS.
Added 'check_archive_formats()', which obviously makes good use of
  this dictionary.
2000-04-22 03:09:56 +00:00
Greg Ward 4982f98bc9 Fix how we generate the meta-data query methods to include 'get_fullname()'
and the other "composite meta-data" methods.
2000-04-22 02:52:44 +00:00
Greg Ward 0ae7f76b40 Changed to call 'get_fullname()', not 'get_full_name()', on Distribution object. 2000-04-22 02:51:25 +00:00
Guido van Rossum 5796d26794 Patch by Vladimir Marangozov to unload additionally imported modules
after each test has been run.  This avoids excessive memory growth
during the tests.
2000-04-21 21:35:06 +00:00
Guido van Rossum cdd092fe48 Added test_winsound by Mark Hammond. 2000-04-21 21:28:47 +00:00
Guido van Rossum 84219682fb Charles Waldman writes:
"""
In the course of debugging this I also saw that cPickle is
inconsistent with pickle - if you attempt a pickle.load or pickle.dump
on a closed file, you get a ValueError, whereas the corresponding
cPickle operations give an IOError.  Since cPickle is advertised as
being compatible with pickle, I changed these exceptions to match.
"""
2000-04-21 20:49:58 +00:00
Guido van Rossum e0cd291b81 Doc strings for the spawn* functions, by Michael Hudson. 2000-04-21 18:35:36 +00:00
Greg Ward 535f2d9ace Fix 'check_metadata()' so it grovels through the distribution's metadata
object, rather than through the distribution itself (since I moved the meta-
data out to a DistributionMetadata instance).
2000-04-21 04:37:12 +00:00
Greg Ward 9d5afa9894 Patch from Andrew Kuchling: allow multiple include/exclude patterns
for all commands except 'prune' and 'graft'.
2000-04-21 04:31:10 +00:00
Greg Ward 58ec6ede20 Fixed the '--license' option so it's officially an alias for '--licence',
and now actually works.
2000-04-21 04:22:49 +00:00
Greg Ward 1e7b509526 Added the capability for alias options. 2000-04-21 04:22:01 +00:00
Greg Ward 320df700dc Added 'has_option()', 'get_attr_name()' methods. 2000-04-21 02:31:07 +00:00
Greg Ward 82715e1f11 Patch, originally from Bastian Kleineidam and savagely mutilated by me,
to add the "display metadata" options: --name, --version, --author,
and so forth.  Main changes:
  * added 'display_options' class attribute to list all the "display only"
    options (--help-commands plus the metadata options)
  * added DistributionMetadata class as a place to put the actual
    metadata information from the setup script (not to be confused with
    the metadata display options); the logic dealing with metadata
    (eg. return self.name or "UNKNOWN") is now  in this class
  * changed 'parse_command_line()' to use the new OO interface provided
    by fancy_getopt, mainly so we can get at the original order of
    options on the command line, so we can print multiple lines of
    distribution meta-data in the order specified by the user
  * added 'handle_display_options()' to handle display-only options
Also fixed some crufty old comments/docstrings.
2000-04-21 02:28:14 +00:00
Greg Ward 283c745c57 Made 'generate_help()' and 'print_help()' methods of FancyGetopt.
Added 'set_option_table()' method.
Added missing 'self' to 'get_option_order()'.
Cosmetic/comment/docstring tweaks.
2000-04-21 02:09:26 +00:00
Greg Ward ead5c291bb Continuing the refactoring: deleted the old 'fancy_getopt()' function,
leaving in its place a tiny wrapper around the FancyGetopt class
for backwards compatibility.
2000-04-21 01:44:00 +00:00
Greg Ward ffc10d9a2e Hefty refactoring: converted 'fancy_getopt()' function into FancyGetopt
class.  (Mainly this was to support the ability to go back after the
getopt operation is done and get extra information about the parse,
in particular the original order of options seen on the command line.
But it's a big improvement and should make it a lot easier to add
functionality in the future.)
2000-04-21 01:41:54 +00:00
Greg Ward 3314c8efc9 Bumped version to 0.8.1. 2000-04-19 02:23:21 +00:00