Commit Graph

262 Commits

Author SHA1 Message Date
Greg Ward 7a0620c3a5 Try to deal with pre-1.5.2 IOError exception objects. 2000-02-26 00:49:40 +00:00
Greg Ward 4f08e4facb Unfinished, untested implementation of the lovely baroque installation scheme
cooked up by Fred Drake and me.  Only saved for posterity (whoever posterity
is), as it is about to be ditched in favour of GvR's much simpler design.
2000-02-26 00:49:04 +00:00
Greg Ward 4840112121 Fix from est@hyperreal.org: missing initialize in 'find_defaults()'. 2000-02-24 03:17:43 +00:00
Greg Ward 18c05f240e Changed all references to command methods 'set_default_options()' and
'set_final_options()' to 'initialize_options()' and 'finalize_options()'.
2000-02-18 00:36:20 +00:00
Greg Ward e01149cbe8 Renamed 'set_default_options()' to 'initialize_options()', and
'set_final_options()' to 'finalize_options()'.
2000-02-18 00:35:22 +00:00
Greg Ward 4c96db1a65 Changed references to the command class 'options' attribute to 'user_options'.
Related docstring changes.
Unrelated comment changes.
2000-02-18 00:26:23 +00:00
Greg Ward bbeceeaf9a Renamed all 'options' class attributes to 'user_options'. 2000-02-18 00:25:39 +00:00
Greg Ward 592f28272e Command classes are now named identically to their commands, so reflect this
in 'find_command_class()' method.
2000-02-18 00:14:21 +00:00
Greg Ward 1993f9ad0e Renamed all command classes so they're exactly the same as the name of the
command itself: no more of this "FooBar class for foo_bar command"
silliness.
2000-02-18 00:13:53 +00:00
Greg Ward e1b1c94a0c Changed 'dist' to 'sdist'. 2000-02-18 00:11:52 +00:00
Greg Ward a82122b887 The 'sdist' command to create a source distribution. This is derived from the
old 'dist' command, but the code for dealing with manifests is completely
redone -- and renaming the command to 'sdist' is more symmetric with the
soon-to-exist 'bdist' command.
2000-02-17 23:56:15 +00:00
Greg Ward 3d6b023f5c The 'dist' command is dead -- long live the 'sdist' command! 2000-02-17 23:54:55 +00:00
Greg Ward 5de8cee73f Ditched '_find_SET()', since it was a no-value-added wrapper around
'get_msvc_paths()'.
Renamed '_do_SET()' to 'set_path_env_var()', tweaked docstring, and
  cosmetically tweaked code.
Stylistic changes to MSVCCompiler constructor (variable renaming
  and type consistency).
2000-02-11 02:52:39 +00:00
Greg Ward 699880931e Latest patch from Thomas Heller/Robin Becker:
* tweak my docstrings
  * fix None returns to empty list
  * reshuffle responsibilities between '_find_exe()', '_find_SET()', and
    the MSVCCompiler constructor -- now the constructor worries about
    fetching the version list and determining the most recent one
  * added "/W3" compile option
Also, I added/tweaked some docstrings.
2000-02-11 02:47:15 +00:00
Greg Ward 62e3393e4d Stylistic changes to the registry-grovelling code: code formatting, changed
function names, dbetter (hopefully) ocstrings, and comments.
2000-02-10 02:52:42 +00:00
Greg Ward 10ca82b57c Typecheck 'output_dir' argument to compile/link methods. 2000-02-10 02:51:32 +00:00
Greg Ward 968d883be5 Path from Thomas Heller: resurrect the .def file kludge while preserving the
/export option mini-kludge.
2000-02-10 02:17:06 +00:00
Greg Ward 4ba9b2e3b6 Patch from Thomas heller:
* don't need to mention python<ver>.lib -- it's done by a pragma
  * add debug flags for compile and link, and use them
  * fix 'link_shared_library()' to pass everything to 'link_shared_object()'
  * change filename when shared object with debug info (ugh)
2000-02-10 02:15:52 +00:00
Greg Ward e8c6ce4684 Added 'debug' option, and changed compile/link calls to use it. 2000-02-09 02:20:14 +00:00
Greg Ward 324620015d Added 'debug' option (just there for 'build_ext' and 'build_lib' commands
to fallback to if the user doesn't set it for those commands.
2000-02-09 02:19:49 +00:00
Greg Ward 386b84439f Added 'debug' flags to compile and link methods, and added dummy code for
someone who knows Windows/MSVC++ to come along and add the right flags.
Comment noting that 'link_static_lib()' signature is inconsistent with
  the other compiler classes (uh-oh!)
2000-02-09 02:18:39 +00:00
Greg Ward ba233fbe92 Added 'debug' flags to compile and link methods, and modified code to add
'-g' flag to compiler/linker command lines when it's true.
2000-02-09 02:17:00 +00:00
Greg Ward 3c045a5766 Added 'debug' flag to compile and link method signatures.
Doc fix: several paragraphs under 'link_static_lib()' moved to
  'link_shared_lib()', where they belong.
2000-02-09 02:16:14 +00:00
Fred Drake 69e2c6efbb get_config_h_filename(): Support NT as well as Posix systems.
_init_nt():  Use get_config_h_filename() instead of figuring out the
             name directly.

             g['SO'] should be set to '.pyd'.

             Adjust some minor coding nits.
2000-02-08 15:55:42 +00:00
Greg Ward 1b9c6f7788 Revised version (thank to Thomas Heller and Robin Becker) that tries a lot
harder to find the MSVC compiler (mainly by using the registry).
2000-02-08 02:39:44 +00:00
Greg Ward f0219ba290 Ditch .def file kludge for (much smaller) /export option kludge. 2000-02-08 02:37:15 +00:00
Greg Ward 1bea7ab7bd Added 'libraries' option for use by the 'build_lib' command.
Typo fix.
2000-02-05 02:24:52 +00:00
Greg Ward 5f7c18e816 Run the 'build_lib' command before building extensions, if necessary. 2000-02-05 02:24:16 +00:00
Greg Ward aaf27ee07b New command to build C (and C++, hopefully) libraries needed by extensions
in the current distribution: motivated by PIL's libImaging.
2000-02-05 02:23:59 +00:00
Greg Ward c1854673e2 Tweaked various comments, docstrings, and error messages. 2000-02-05 02:23:16 +00:00
Greg Ward 7f0fb0b01e Improved an error message.
Announce when we start building each extension (better feedback).
2000-02-03 23:07:54 +00:00
Greg Ward ef6f515d49 Changed 'compile()' method to compile files one-at-a-time -- gives better
feedback and, theoretically, the opportunity to set compiler flags
on a per-file basis.
2000-02-03 23:07:19 +00:00
Greg Ward 113e70efa2 Patch from Joe Van Andel: fix arg to % operator in warning. 2000-02-02 00:07:14 +00:00
Greg Ward a0ca3f24f9 Comment fix.
Always use normalized (with os.path.normpath()) versions of prefix and
  exec_prefix.
2000-02-02 00:05:14 +00:00
Greg Ward d1466b968f Allow either README or README.txt as a "standard file". 2000-01-30 20:22:27 +00:00
Greg Ward a002edc85b Fixed broken list extend in 'copy_tree()'. 2000-01-30 19:57:48 +00:00
Greg Ward 37bc815053 Added 'description' class attribute to every command class (to help the
'--help-commands' option).
Shuffled imports around in a few command modules to avoid expensive
  up-front import of sysconfig (and resulting delays in generating list
  of all commands).
2000-01-30 18:34:15 +00:00
Greg Ward 4c67936e4e Added 'dist' command. 2000-01-30 18:31:34 +00:00
Greg Ward f0fd6175b3 Improvements to the help system:
* "--help" can now come either before or after particular commands
    to get help on and can give help on multiple commands, eg.
    "--help install dist" gives help on those two commands
  * added "--help-commands" option, implemented by the 'print_commands()'
    and 'print_command_list()' methods
2000-01-30 18:30:32 +00:00
Greg Ward 7478a4832a Added missing run of corresponding 'build' command. 2000-01-30 15:07:56 +00:00
Greg Ward 9f200cbaa6 Fix indentation bug. 2000-01-17 21:58:07 +00:00
Greg Ward 3b49c9babd Catch OSError from 'spawnv()' in '_spawn_nt()'.
Tweaked error messages in '_spawn_posix()'.
2000-01-17 21:57:55 +00:00
Greg Ward 01f5215828 Removed /GD switch -- currently ignored by MSVC. 2000-01-17 21:57:17 +00:00
Greg Ward 8dbf681a97 Added compiler flags suggested by Thomas Heller: optimize, use multi-threaded
RT library.
2000-01-17 20:40:48 +00:00
Greg Ward 1b3a9af5cf Added missing import.
Fixed 'make_release_tree()' to copy files if 'os.link()' doesn't exist.
2000-01-17 20:23:34 +00:00
Greg Ward cbeca7b408 Added code to use Jim Ahlstrom's zipfile.py module if the external zip
command wasn't found or failed.  (Code supplied by Thomas Heller
<thomas.heller@ion-tof.com>.)
2000-01-17 18:04:04 +00:00
Greg Ward c8a95c8d5e Fix library filename methods -- there is no 'lib' prefix under DOS/Windows. 2000-01-17 18:00:04 +00:00
Greg Ward c27d800251 Always run sys.prefix and sys.exec_prefix through 'os.path.normpath()'
before storing or using.
2000-01-17 16:25:59 +00:00
Greg Ward 7c463ef362 Ditch unneeded imports. 2000-01-17 16:25:17 +00:00
Greg Ward 7b7679eb79 'newer_group()' can now deal with missing files, in a way specified by
the 'missing' parameter.
2000-01-09 22:48:59 +00:00
Greg Ward c9f3187be2 Abstracted '_fix_link_args()' out of 'link_shared_object()'.
Added 'link_static_lib()' method, and 'archiver' and 'archiver_options'
  class attributes to support it.
Added 'link_executable()' method, and 'ld_exec' instance attribute
  to support it.
'newer_group()' is now able to handle missing files, so we don't have
  to kludge it by catching OSError when calling it.
'object_filenames()' and 'shared_object_filename()' now take 'keep_dir'
  flag parameters.
'library_filename()' and 'shared_library_filename()' now respect
  a directory component in the library name.
Various comment updates/deletions.
2000-01-09 22:47:53 +00:00
Greg Ward 5baf1c2111 Removed a bunch of irrelevant parameters from 'link_static_lib()' signature.
Added 'link_executable()' signature.
2000-01-09 22:41:02 +00:00
Greg Ward e9436da686 Typo fix: 'file.warn' should have been 'manifest.warn' in a couple of places. 2000-01-09 22:39:32 +00:00
Greg Ward 9d46b9ce97 When emitting a command-line error message, *say* it's an error. 1999-12-16 01:19:05 +00:00
Greg Ward ad83f04086 Catch errors from 'rmtree' and emit a warning. 1999-12-16 01:14:15 +00:00
Greg Ward 97798b1d47 Use 'search', not 'match', on filename pattern regexes. 1999-12-13 21:38:57 +00:00
Greg Ward 0bdd90a7e7 Catch up with terminology change in UnixCCompiler: 'includes' -> 'include_dirs'. 1999-12-12 17:19:58 +00:00
Greg Ward 1d0495e05c Catch missing MANIFEST file and warn rather than blowing up.
Added 'nuke_release_tree()' method to blow away the directory from
  which the archive file(s) are created, and call it (conditionally)
  from 'make_distribution()'.
Added 'keep_tree' option (false by default) to disable the call to
  'nuke_release_tree()'.
1999-12-12 17:07:22 +00:00
Greg Ward 9b45443c1b Fixed 'find_package_modules()' to ensure that we never build (and thus
install) the setup script itself.
Fixed 'build_module()' so we do *not* preserve file mode (which means
  we can install read-only files, which makes the next installation
  of this distribution fail -- at least under Unix); added a comment
  explaining this.
1999-12-12 17:03:59 +00:00
Greg Ward 48697d931b Changed 'build_extensions()' so 'sources' can be a list or tuple; and
call CCompiler method 'compile()' with 'include_dirs' not 'includes'.
Fixed stupid typo in 'get_source_files()'.
1999-12-12 17:01:01 +00:00
Greg Ward 04d78328f3 In 'compile()' method, renamed 'includes' parameter to 'include_dirs' for
consistency with 'build_ext' command option.
Changed 'compile()' and 'link_shared_object()' so 'include_dirs',
  'libraries', and 'library_dirs' can be lists or tuples.
1999-12-12 16:57:47 +00:00
Greg Ward 44f8e4ea08 Added support for printing out help text from option table: 'print_help()',
'generate_help()', 'wrap_text()' functions, and a little tiny test
  of 'wrap_text()'.
Changed how caller states that one option is the boolean opposite of
  another: added 'negative_opt' parameter to 'fancy_getopt()', and changed
  to use it instead of parsing long option name.
1999-12-12 16:54:55 +00:00
Greg Ward c9c37b1c6e Made "verbose" mode the default; now you have to supply --quiet if you
want no output.  Still no option for a happy medium though.
Added "--help" global option.
Changed 'parse_command_line()' to recognize help options (both for the
  whole distribution and per-command), and to distinguish "regular run"
  and "user asked for help" by returning false in the latter case.
Also in 'parse_command_line()', detect invalid command name on command
  line by catching DistutilsModuleError.
  a 'negative_opt' class attribute right after 'global_options'; changed
  how we call 'fancy_getopt()' accordingly.
Initialize 'maintainer' and 'maintainer_email' attributes to Distribution
  to avoid AttributeError when 'author' and 'author_email' not defined.
Initialize 'help' attribute in Command constructor (to avoid
  AttributeError when user *doesn't* ask for help).
In 'setup()':
  * show usage message before dying when we catch DistutilsArgError
  * only run commands if 'parse_command_line()' returned true (that
    way, we exit immediately when a help option is found)
  * catch KeyboardInterrupt and IOError from running commands
Bulked up usage message to show --help options.
Comment, docstring, and error message tweaks.
1999-12-12 16:51:44 +00:00
Greg Ward 631e6a0c07 [from 1999-11-04]
Bunch of little bug fixes that appeared in building non-packagized
distributions.  Mainly:
  - brain-slip typo in 'get_package_dir()'
  - don't try to os.path.join() an empty path tuple -- it doesn't like it
  - more type-safety in 'build_module()'
1999-12-03 16:18:56 +00:00
Greg Ward e1ada50559 Don't assume GNU tar -- generate tar file and compress in separate steps.
Now supports the full range of intended formats (tar, ztar, gztar, zip).
"-f" no longer a short option for "--formats" -- conflicts with new
  global option "--force"!
1999-10-23 19:25:05 +00:00
Greg Ward d6c30f66c7 Removed massive comment speculating about needlessly complex variations
on the manifest file syntax.
1999-10-23 19:10:59 +00:00
Greg Ward 346e320c6e Qualified use of 'newer_group' function. 1999-10-23 19:06:56 +00:00
Greg Ward 6bad86462b Fix how we run 'zip' -- give explicit .zip extension. 1999-10-23 19:06:20 +00:00
Greg Ward ef93095adb Filter 'glob()' results so we only look at regular files. 1999-10-03 21:09:14 +00:00
Greg Ward 3c6204a87f Pass 'force' flag to 'new_compiler()'. 1999-10-03 21:08:42 +00:00
Greg Ward 455eb61648 Don't import what we don't use. 1999-10-03 21:07:21 +00:00
Greg Ward ef9ad6df01 Tweaked verbosity messages for byte-compilation. 1999-10-03 21:03:26 +00:00
Greg Ward 0c35ac62d8 Added 'force' and 'quiet' (negative alias for 'verbose') to the
global options table.
Every Command instance now has its own copies of the global options,
  which automatically fallback to the Distribution instance.  Changes:
  - initialize them in constructor
  - added '__getattr__()' to handle the fallback logic
  - changed every 'self.distribution.{verbose,dry_run}' in Command to
    'self.{verbose,dry_run}'.
  - filesystem utility methods ('copy_file()' et al) don't take 'update'
    parameter anymore -- instead we pass 'not force' to the underlying
    function as 'update'
Changed parsing of command line so that global options apply to all
  commands as well -- that's how (eg.) Command.verbose will be initialized.
Simplified 'make_file()' to use 'newer_group()' (from util module).
Deleted some cruft.
Some docstring tweaks.
1999-10-03 21:02:48 +00:00
Greg Ward f3b997a7f0 Fixed 'mkpath()' to normalize the path right off the bat -- cleans up
the code a bit and should make it work under Windows even with trailing
  backslash.
Fixed a couple of docstrings.
Added comment about 'make_file()' possibly being redundant and unnecessary.
1999-10-03 20:50:41 +00:00
Greg Ward a564cc315b Hacked to support the notion of "negative alias" options, to handle
-q/--quiet reasonably elegantly.
1999-10-03 20:48:53 +00:00
Greg Ward c74138d941 Catch up with changes in 'gen_lib_options()':
- change how we call it
  - added methods 'library_dir_option()', 'library_option()', and
    'find_library_file()' that it calls
Added 'force' flag; it's automatically "respected", because this class
  always rebuilds everything!  (Which it to say, "force=0" is not respected.)
1999-10-03 20:47:52 +00:00
Greg Ward 4fecfce4d0 Fixed order of link options: object files now precede library stuff.
Catch up with changes in 'gen_lib_options()':
  - change how we call it
  - added methods 'library_dir_option()', 'library_option()', and
    'find_library_file()' that it calls
Added 'force' flag and changed compile/link methods to respect it.
1999-10-03 20:45:33 +00:00
Greg Ward 3febd60682 Slight change to the meaning of the 'libraries' list: if a library name
has a directory component, then we only search for the library in
  that one directory, ie. ignore the 'library_dirs' lists for that
  one library.
Changed calling convention to 'gen_lib_options()' again: now, it takes
  a CCompiler instance and calls methods on it instead of taking
  format strings.  Also implemented the new "library name" semantics
  using the 'find_library_file()' method in the CCompiler instance.
Added 'force' flag to CCompiler; added to constructor and 'new_compiler()'.
Added 'warn()' method.
1999-10-03 20:41:02 +00:00
Greg Ward b24afe19db Added 'list_only' option (and modified 'run()' to respect it). 1999-09-29 13:14:27 +00:00
Greg Ward 274ad9dc81 Added all documentation.
Slightly improved the code for dealing with newline on a comment line,
  and for stripping whitespace.
1999-09-29 13:03:32 +00:00
Greg Ward ef4490f501 New command to generate source distribution based on a manifest file. 1999-09-29 12:50:13 +00:00
Greg Ward a6cb8ae7bc Added 'package' option.
Catch up with renamed 'platdir' -> 'build_platlib' option in 'build'.
Don't call 'set_final_options()' in 'run()' anymore -- that's now
  guaranteed to be taken care of for us by the Distribution instance.
If 'include_dirs' is a string, split it on os.pathsep (this is half-
  hearted -- support for setting compile/link options on the command
  line is totally lame and probably won't work at all).
Added 'get_source_files()' for use by 'dist' command.
Added code to 'build_extensions()' to figure out the "def file" to use
  with MSVC++ and add it to the linker command line as an "extra_postarg".
1999-09-29 12:49:35 +00:00
Greg Ward 2a612067e6 Renamed 'dir' option to be consistent with other commands.
Don't call 'set_final_options()' in 'run()' anymore -- that's now
  guaranteed to be taken care of for us by the Distribution instance.
Rearranged to bit to allow outsiders (specifically, the 'dist' command)
  to find out what modules we would build:
  - 'find_modules()' renamed to 'find_package_modules()'
  - most of 'build_modules()' abstracted out to 'find_modules()'
  - added 'get_source_files()' (for the 'dist' command to use)
  - drastically simplified 'build_modules()' -- now just a wrapper around
    'find_modules()' and 'build_module()'
1999-09-29 12:44:57 +00:00
Greg Ward e6ac2fcc12 Renamed many options to be consistent across commands.
Tweaked some help strings to be consistent with documentation.
Don't call 'set_final_options()' in 'run()' anymore -- that's now
  guaranteed to be taken care of for us by the Distribution instance.
1999-09-29 12:38:18 +00:00
Greg Ward df178f97de Catch up with latest changes in CCompiler:
- add 'extra_preargs' and 'extra_postargs' parameters (and use them!)
  - got rid of 'build_info' kludge parameter
  - added 'compiler_type' class attribute
  - respect reordered arguments to 'gen_lib_options()'
Also added 'output_dir' parameter (catching up with older change in
  CCompiler) -- BUT this is presently ignored by all methods!
Deleted some more docstrings redundant with CCompiler.
Dropped generated of "/DEF:" argument --- that's now done by
  the 'build_ext' command.
1999-09-29 12:29:10 +00:00
Greg Ward 0e3530ba28 Catch up with latest changes in CCompiler:
- add 'extra_preargs' and 'extra_postargs' parameters (and use them!)
  - added 'compiler_type' class attribute
  - respect reordered arguments to 'gen_lib_options()'
1999-09-29 12:22:50 +00:00
Greg Ward 802d6b7b4c Added 'extra_preargs' and 'extra_postargs' parameters to most methods,
which allowed us to get rid of the 'build_info' used in some places
  (a temporary kludge to support MSVC++ "def" files).
Deleted big comment whining about that kludge.
Added 'compiler_type' class attribute.
Overhauled 'new_compiler()': now takes 'compiler' argument along with
  'plat' (both optional with sensible defaults), and looks them both up
  in the new 'default_compiler' and 'compiler_class' dictionaries to
  figure out where to get the concrete compiler class from.
Reordered arguments to 'gen_lib_options()' to match the order in
  which the arguments are generated (ie. -L before -l).
1999-09-29 12:20:55 +00:00
Greg Ward cd1486fff1 More tweaks to 'mkpath()':
- deal with empty tail from os.path.split() (eg. from trailing slash,
    or backslash, or whatever)
  - check PATH_CREATED hash inside loop as well
1999-09-29 12:14:16 +00:00
Greg Ward 3868eb97c8 Added 'ready' flag and 'ensure_ready()' method to Command: together
they make sure that 'set_final_options()' has been called, but isn't
  called redundantly.
Changed Distribution to call 'ensure_ready()' where it used to call
  'set_final_options()', and in a few extra places as well.
Lots of comment/docstring revisions and additions in both classes.
New one-liner utility methods in Command: 'find_peer()', 'spawn()'.
1999-09-29 12:12:19 +00:00
Greg Ward da2d352bdb Added docstring and RCS id (apparently some Windows tar extractors
ignore zero-byte files: grr...).
1999-09-22 15:24:04 +00:00
Greg Ward df0d33586d Ditched the whole notion of "alias options": this meant dropping the
'alias_options' table and getting rid of some hairy code in the
  Distribution constructor.
Resurrected the distribution options that describe the modules present
  in the module distribution ('py_modules', 'ext_modules'), and added
  a bunch more: 'packages', 'package_dir', 'ext_package', 'include_dirs',
  'install_path'.
Updated some comments.
Added 'warn()' method to Command.
'Command.get_command_name()' now stores generated command name in
  self.command_name.
1999-09-21 18:41:36 +00:00
Greg Ward ac1424a9ce Added 'write_file()' function.
Added global cache PATH_CREATED used by 'mkpath()' to ensure it doesn't
  try to create the same path more than once in a session (and, more
  importantly, to ensure that it doesn't print "creating X" more than
  once for each X per session!).
1999-09-21 18:37:51 +00:00
Greg Ward b116e45a29 In 'link_shared_object()', try to be less sensitive to missing input files
in dry-run mode.
1999-09-21 18:36:15 +00:00
Greg Ward fbf8affca1 Typecheck elements of 'macros' parameter in 'gen_preprocess_options(). 1999-09-21 18:35:09 +00:00
Greg Ward d4b8429fc5 Added docstring, brought __all__ up-to-date. 1999-09-21 18:33:09 +00:00
Greg Ward 865de83668 Added 'install_path' option for giving non-packagized module
distributions their own directory (and .pth file).
Overhauled how we determine installation directories in
  'set_final_options()' to separate platform-dependence and take
  'install_path' option into account.
Added 'create_path_file()' to create path config file when 'install_path'
  given.
Only run 'install_py' and 'install_ext' when, respectively, there are
  some pure Python modules and some extension modules in the distribution.
1999-09-21 18:31:14 +00:00
Greg Ward 02e1c56212 Only run build_py if we have pure Python modules, and build_ext if we
have extension modules.
1999-09-21 18:27:55 +00:00
Greg Ward dbb96253ea Some option changes:
- rename 'dir' to 'build_dir'
  - take 'package' from distribution option 'ext_package'
  - take 'extensions' from distribution option 'ext_modules'
  - take 'include_dirs' from distribution
Name keyword args explictly when calling CCompiler methods.
Overhauled how we generate extension filenames (in 'extension_filename()
  and 'build_extension()') to take 'package' option into account.
1999-09-21 18:27:12 +00:00
Greg Ward 17dc6e7ed8 Basically a complete rewrite to support dealing with modules in whole
packages and searching for source files by 'package_dir'.
1999-09-21 18:22:34 +00:00
Greg Ward fa4eb188f4 Changed selection of installation directories (in 'set_final_options()')
so that pure Python modules are installed to the platform-specific
directory if there are any extension modules in this distribution.
1999-09-13 13:58:34 +00:00
Greg Ward c9c011cd96 Straightened up the selection of installation directories for platform-
specific files; it was somewhat broken, and the comments were dead
  wrong.
Now runs 'install_ext' command after 'install_py'.
1999-09-13 13:57:26 +00:00
Greg Ward 609a5c818d Added support for 'package' option, including where to link the
actual extension module to.
1999-09-13 13:55:34 +00:00
Greg Ward 68bdf3eeb7 Comment addition. 1999-09-13 13:54:06 +00:00
Greg Ward 36e68e21b4 Now run 'build_ext'.
Default platform-specific build directory changed to 'build/platlib'.
1999-09-13 13:52:12 +00:00
Greg Ward 8037cb11f5 Added 'output_dir' parameter to 'compile()' and 'link_shared_object().
Changed those two methods to only compile/link if necessary (according
  to simplistic timestamp checks).
Added 'output_dir' to 'object_filenames()' and 'shared_object_filename()'.
1999-09-13 03:12:53 +00:00
Greg Ward 3b120ab374 New command -- install_ext to install extension modules. 1999-09-13 03:10:25 +00:00
Greg Ward 138ce653cc Added 'newer_pairwise()' and 'newer_group()'.
Terminology change in 'newer()'.
Made 'copy_tree' respect dry_run flag a little better.
Added 'move_file()'.
1999-09-13 03:09:38 +00:00
Greg Ward 9b17cb5819 Added 'output_dir' attribute, and 'output_dir' parameter to several method
signatures, and updated some docstrings to reflect it.
Some comments added.
Added 'announce()' and 'move_file()' methods.
1999-09-13 03:07:24 +00:00
Greg Ward 1ae3246679 Fixed some goofs in 'alias_options'.
Error message tweak in Command.set_option().
Added Command.get_peer_option().
Added Command.move_file() wrapper.
1999-09-13 03:03:01 +00:00
Greg Ward 71eb8644d7 Changed to reflect the new "command options" regime -- in particular,
we no longer explicitly pull distribution options out of our Distribution
object, but rather let the Distribution put them into the command object.
1999-09-08 02:42:30 +00:00
Greg Ward 42926ddc7e Careful rethink of command options, distribution options, distribution
attributes, etc.  Biggest change was to the Distribution constructor
  -- it now looks for an 'options' attribute, which contains values
  (options) that are explicitly farmed out to the commands.  Also,
  certain options supplied to Distribution (ie. in the 'setup()' call in
  setup.py) are now "command option aliases", meaning they are dropped
  right into a certain command rather than being distribution options.
  This is handled by a new Distribution class attribute,
  'alias_options'.
Various comment changes to reflect the new way-of-thinking.
Added 'get_command_name()' method to Command -- was assuming its
  existence all along as 'command_name()', so changed the code that
  needs it to call 'get_command_name()'.
1999-09-08 02:41:09 +00:00
Greg Ward 3d50b908ba Ditched redundant docstrings and comments (overlap with ccompiler.py).
Ditched redundant '_gen_preprocess_options()' and '_gen_lib_options()'
  -- now provided by ccompiler.py.
Fixed some filename extension variables -- added missing period.
Cosmetic tweaks.
1999-09-08 02:36:01 +00:00
Greg Ward c294113f18 Ditched '_gen_preprocess_options()' and '_gen_lib_options()' -- they're
now provided (minus the leading underscore) by the ccompiler module.
Fix 'compile()' to return the list of object files generated.
Cosmetic tweaks/delete cruft.
1999-09-08 02:32:19 +00:00
Greg Ward f7a39ecac1 os.name is "posix" or "nt" or we don't care.
Added big comment about the kludginess of passing 'build_options'
  to the link methods and how to fix it.
Added 'gen_preprocess_options()' and 'gen_lib_options()' convenience
  functions -- the two cases are very similar for Unix C Compilers and
  VC++, so I figured I might as well unify the implementations.
1999-09-08 02:29:08 +00:00
Greg Ward a4d132a868 [from 1999/08/28]
Apparently os.name is "nt" or "posix" or we don't care.
Cosmetic tweaks.
1999-09-08 02:23:28 +00:00
Greg Ward 65f4a3b173 Patch from Perry Stoll: caught up with changes in CCompiler necessary (?)
for MSVCCompiler.
1999-08-29 18:23:32 +00:00
Greg Ward 32162e832e Patch from Perry Stoll: tweaks to Windows support. 1999-08-29 18:22:13 +00:00
Greg Ward 69628b0ad1 Patch from Perry Stoll: support for Windows. 1999-08-29 18:20:56 +00:00
Greg Ward 1ea8af2fe0 Patch from Perry Stoll: import types module. 1999-08-29 18:20:32 +00:00
Greg Ward 440e2f51ea Patch from Perry Stoll: typo fix, make sure we only compile .py files. 1999-08-29 18:19:37 +00:00
Greg Ward 5d60fcf02a Patch from Perry Stoll: OK for list of modules to be empty. 1999-08-29 18:19:01 +00:00
Greg Ward 2f1b5bb905 Patch from Perry Stoll: pass 'build_info' to link method. 1999-08-29 18:18:26 +00:00
Greg Ward 26e48ea7df Patch from Perry Stoll:
- fix some broken abstract methods
  - kludge: add 'build_info' parameter to link methods
  - add 'object_name()' and 'shared_library_name()'
  - support for MSVCCompiler class on NT/Win95
1999-08-29 18:17:36 +00:00
Greg Ward dbd1276dcb Added msvccompiler module exactly as supplied by Perry Stoll. 1999-08-29 18:15:07 +00:00
Greg Ward 1016af9fa6 Oops, call 'os.path.join()'! 1999-08-19 20:02:10 +00:00
Greg Ward e393ddb2e0 Implements the 'build_ext' command for building C/C++ extension modules. 1999-08-14 23:57:49 +00:00
Greg Ward b4dbfb318c Module to spawn sub-commands in a platform-independent way.
Initial revision only includes support for POSIX-style fork-and-exec.
1999-08-14 23:57:17 +00:00
Greg Ward 5e71744000 Changed to use 'spawn()', now that it exists.
Added 'verbose' and 'dry_run' parameters to constructor.
Changed 'compile()', 'link_*()' to default lists arguments to None
  rather than empty list.
Added implementations of the filename-mangling methods mandated by
  the CCompiler interface.
1999-08-14 23:53:53 +00:00
Greg Ward e1aaaa653c Added 'verbose' and 'dry_run' flags to CCompiler constructor and
'new_compiler()' factory function.
Added 'runtime_library_dirs' list (for -R linker option) and methods
  to manipulate it.
Deleted some obsolete comments.
Added all the filename manglign methods: 'object_filenames()',
  'shared_object_filename()', 'library_filename()',
  'shared_library_filename()'.
Added 'spawn()' method (front end to the "real" spawn).
1999-08-14 23:50:50 +00:00
Greg Ward 7f65c65208 Comment tweak. 1999-08-14 23:47:21 +00:00
Greg Ward 0081cc529c Better detection of bad entries in option table.
Better error messages for bad entries in option table.
1999-08-14 23:44:37 +00:00
Greg Ward 8c66b697c1 Added DistutilsExecError, DistutilsValueError. 1999-08-14 23:43:45 +00:00
Greg Ward abc2f960d4 Allow comment characters (#) to be escaped:
- did away with 'comment_re' option -- it's just not that simple anymore
  - heavily revised the main logic in 'readline()' to accomodate this
Beefed up 'warn()': 'line' can be list or tuple, and 'msg' is
  automatically converted to a string.
1999-08-10 20:09:38 +00:00
Greg Ward 170bdc08e1 The first concrete subclass of CCompiler: defines a barebones Unix C compiler. 1999-07-10 02:04:22 +00:00
Greg Ward 3f81cf7936 The abstract base class that defines the C/C++ compiler abstraction model. 1999-07-10 02:03:53 +00:00
Greg Ward ba3f108ec0 Added a self-berating command relating to installation directories for
module distributions that contain platform-specific files.
1999-07-10 02:02:31 +00:00
Greg Ward ccbb3f0ed4 Don't pollute importer's namespace with type objects from types modules.
Added DistutilsPlatformError.
1999-07-10 02:01:44 +00:00
Greg Ward 5116f90ece On David Ascher's recommendation: reversed order of 'utime()' and
'chmod()' in 'copy_file()'.
1999-06-08 17:05:21 +00:00
Greg Ward 9a33707be7 Hacked 'set_final_options()' to set (hopefully) appropriate values for
'install_site_lib' and install_site_platlib' on non-POSIX platforms.
Should at least work for NT, as this is adopted from Amos Latteier's NT
patches.  Also added extensive comments bitching about the inadequacy of
the current model, both under POSIX and NT (and probably other) systems.
1999-06-08 02:04:36 +00:00
Greg Ward c997334977 Added the 'have_run' dictionary to Distribution, and changed
'run_command()' to refer to it before attempting to run a command --
  that way, command classes can freely invoke other commands without fear
  of duplicate execution.
Beefed up some comments and docstrings.
1999-06-08 02:02:00 +00:00
Greg Ward 4d74d73b07 Now handles NT, through '_init_nt()' function (courtesy of
Amos Latteier <amos@aracnet.com>).
1999-06-08 01:58:36 +00:00
Greg Ward 884df454b2 The 'copy_file()' and 'copy_tree()' functions in util.py now have
meaningful return values: respectively, whether the copy was done, and
the list of files that were copied.  This meant some trivial changes in
core.py as well: the Command methods that mirror 'copy_file()' and
'copy_tree()' have to pass on their return values.
1999-05-02 21:42:05 +00:00
Greg Ward 0f72695da3 Rearranged things so that compilation of .py files is the responsibility
of the 'install_py' command rather than 'build_py'.  Obviously, this
meant that the 'build_py' and 'install_py' modules had to change; less
obviously, so did 'install' and 'build', since these higher-level
commands must make options available to control the lower-level
commands, and some compilation-related options had to migrate with the
code.
1999-05-02 21:39:13 +00:00
Greg Ward 4e5a7c7056 'warn()' method now takes an optional line number. 1999-04-15 17:50:19 +00:00
Greg Ward 06ca948029 Added all the "external action" methods (to make handling the verbose
and dry-run flags consistently painless): 'execute()', 'mkpath()',
'copy_file()', 'copy_tree()', 'make_file()', and stub for 'make_files()'
(not sure yet if it's useful).
1999-04-04 02:58:07 +00:00
Greg Ward e765a3bb61 Added 'dry_run' flag to most functions (to support the "shadow methods"
that wrap them in the Command class).
Fixed 'copy_file()' to use '_copy_file_contents()', not 'copyfile()'
  from shutil module -- no reference to shutil anymore.
Added "not copying" announcement in 'copy_file()'.
Wee comment fix.
1999-04-04 02:54:20 +00:00
Greg Ward 4070f50537 Changed to use the method versions of 'copy_file()', 'copy_tree()',
and 'make_file()'-- that way, the verbose and dry-run flags are
handled for free.
1999-04-04 02:46:29 +00:00
Greg Ward 91c488c1fc Replaced the last attempt at an "unreadline" with one that actually
works on non-seekable file-like objects, such as URLs.  (Oops.)
1999-03-29 18:01:49 +00:00
Greg Ward 787451b65f Added 'linestart' array and 'unreadline()' method (makes parsing a lot easier). 1999-03-26 21:48:59 +00:00
Greg Ward 782cdfe9f3 Changes to allow passing an open file to the constructor (to support
ProcessHierarchy's changes to support reading from a remote URL in
ProcessDatabase).
1999-03-23 14:00:06 +00:00