Commit Graph

684 Commits

Author SHA1 Message Date
Greg Ward c3c8c6edbb Docstring addition binge. 2000-06-08 00:46:45 +00:00
Greg Ward 373dbfa723 Fixed so we print more than just the first line of help for options with
a short form and text that wraps onto multiple lines.
2000-06-08 00:35:33 +00:00
Greg Ward e0c8c2fd16 Docstring reformatting binge. 2000-06-08 00:24:01 +00:00
Greg Ward f1fe10376e Cosmetic tweaks to imports, the 'show_formats()' function, and the
'help_options' list; also added an editorial comment.
2000-06-08 00:14:18 +00:00
Greg Ward f8b9e20d94 Made all debug output go through the 'debug_print()' method instead of
directly printing to stdout.  This was a bit more work than it sounds like
it should have been:
  * turned 'select_pattern()' and 'exclude_pattern()' from functions into
    methods, so they can refer to 'self' to access the method
  * commented out the *other* 'exclude_pattern()' method, which appears
    to be vestigial code that was never cleaned up when the
    'exclude_pattern()' function was created
  * changed the one use of the old 'exclude_pattern()' method to use the
    new 'exclude_pattern()' (same behaviour, slightly different args)
  * some code and docstring reformatting
  * and, of course, changed all the debugging prints to 'debug_print()' calls
Added/tweaked some regular ('self.announce()') output for better runtime
  feedback.
2000-06-08 00:08:14 +00:00
Greg Ward ebec02a92c Added 'debug_print()' method (driven by DEBUG global from distutils.core). 2000-06-08 00:02:36 +00:00
Greg Ward 9d17a7ad6d Patch from Rene Liebscher: this adds "--help-foo" options to list the
values that "--foo" can take for various commands: eg. what formats for
"sdist" and "bdist", what compilers for "build_ext" and "build_clib".

I have *not* reviewed this patch; I'm checking it in as-is because it also
fixes a paper-bag-over-head bug in bdist.py, and because I won't have
time to review it properly for several days: so someone else can
test it for me, instead!
2000-06-07 03:00:06 +00:00
Greg Ward 1169687692 Always look for the system config file in the Distutils module directory,
and call it "distutils.cfg" instead of "pydistutils.cfg" (personal
config files are still ".pydistutils.cfg" or "pydistutils.cfg", though).
2000-06-07 02:29:03 +00:00
Greg Ward acf3f6a700 Patch from Rene Liebscher:
Look for personal config file in /home/greg on Windows, too: users will have
to set /home/greg to use this, so it's not something that many people will
use.  But if python-dev comes up with the "right way" to divine a
home directory on Windows, we can use that to set /home/greg and poof! --
personal Distutils config files on Windows.
2000-06-07 02:26:19 +00:00
Greg Ward 28a5f44cca First crack at the Distutils "config" command. Unlike other commands, this
one doesn't *do* anything by default; it's just there as a conduit for data
(eg. include dirs, libraries) from the user to the "build" commands.
However, it provides a couple of Autoconf-ish methods ('try_compile()',
'try_link()', 'try_run()') that derived, per-distribution "config" commands
can use to poke around the target system and see what's available.

Initial experimenst with mxDateTime indicate that higher-level methods are
necessary: analogs of Autoconf's AC_CHECK_HEADER, AC_CHECK_LIB will be
needed too (and that's just to probe the C/C++ system: how to probe the
Python system is wide open, and someday we'll have to worry about probing a
Java system too).
2000-06-06 02:57:07 +00:00
Greg Ward 43955c9a02 Fix 'reinitialize_command()' so it resets the 'have_run' flag for the
command being reinitialized to false.
2000-06-06 02:52:36 +00:00
Greg Ward e18dd8dd8f Support for multiple distribution formats in one run. 2000-06-06 02:51:38 +00:00
Greg Ward ec21cc60db 'get_outputs()' now returns an empty list instead of None. 2000-06-06 02:18:13 +00:00
Greg Ward 7ce6d074aa Fixed syntax error.
Half-fixed RPM 2 compatibility:added 'rpm_base' option, which must be set
  (to eg. /usr/src/redhat on a stock Red Hat system) if rpm2_mode is on.
  Still not quite working, though.
2000-06-04 15:30:35 +00:00
Greg Ward 62d5a57b05 Use 'ensure_string_list()' for 'formats' option, so that it can be
spelled sensibly in a config file.
2000-06-04 15:12:51 +00:00
Greg Ward a68c93ac89 Patch from Harry Henry Gebel:
Fills in question marks in help

Reads scripts in from files rather than strings

Adds RPM 2 compatibility mode (untested). Use of this mode requires that
--bdist-base be specified because bdist_rpm has no way of detecting where
RPM wants to find spec files and source files. An unmodified RedHat 5.0
system would require '--bdist-base=/usr/src/RedHat'. (You would also have
to be root.) If the rpmrc file has been modified to allow RPMs to be built
by normal users then --build-base would need to be changed accordingly.

Formats the changelog.

GPW: tweaked formatting, added some editorial comments.
2000-06-04 15:00:34 +00:00
Greg Ward 31413a7ba2 Added the 'ensure_*' methods from bdist_rpm; refactored 'ensure_filename()'
and added 'ensure_dirname()'.
2000-06-04 14:21:28 +00:00
Greg Ward 4227dc1b15 Removed the 'ensure_*' methods -- they're just too handy too keep in one
command class, so they're now in the Command base class.
2000-06-04 14:20:57 +00:00
Greg Ward 6f980b5936 Renamed 'modules' option to 'py_modules', for consistency with Distribution
(and in order to generate a more sensible error message cleanly).
2000-06-04 13:42:52 +00:00
Greg Ward c4c06af575 Patch from Harry Henry Gebel: fixes a bit of code that slipped by my
overhaul last night.
2000-06-03 01:03:55 +00:00
Greg Ward 3985151642 Catch DistutilSetupError from the Distribution constructor. 2000-06-03 01:02:06 +00:00
Greg Ward 82d71cacb0 Added a bunch of new globals in '_init_mac()' -- these will be needed to
support the forthcoming Cygwin/Mingw32 GCC-on-Windows patch.
Standardized CVS id line.
2000-06-03 00:44:30 +00:00
Greg Ward 0f216fdda9 Bumped version number to 0.9pre (there will be a couple of code snapshots
before the real release, but I want to make it clear that a major new
release is on the way).
2000-06-02 02:23:42 +00:00
Greg Ward efbd071016 Only print debugging output if DEBUG true. 2000-06-02 02:01:51 +00:00
Greg Ward 2bd3f4250d Only print debugging output if DEBUG true (and deleted some of the more
extraneous debug prints).
2000-06-02 01:59:33 +00:00
Greg Ward f7a5507485 Use Distribution method 'dump_option_dicts()' for debugging output, and only
do so if DEBUG is true.
2000-06-02 01:55:36 +00:00
Greg Ward 673925842e Ditched the obsolete '_get_package_data()' method and its
'_check_*()' helpers.
2000-06-02 01:52:04 +00:00
Greg Ward 1259392b38 Fairly massive overhaul to support getting RPM inputs (extra meta-data,
prep/build/etc. scripts, doc files, dependency info) from a config file
rather than the dedicated "package_info" file.  (The idea is that
developers will provide RPM-specific info in the "[bdist_rpm]" section of
setup.cfg, but of course it could also be supplied in the other config
files, on the command line, or in the setup script -- or any mix of the
above.)

Major changes:
  * added a boatload of options to 'user_options' and
    'initialize_options()': 'distribution_name', 'group', 'release', ...
  * added 'finalize_package_data()', which takes the place of
    '_get_package_data()' -- except it's called from 'finalize_options()',
    not 'run()', so we have everything figured out before we actually run
    the command
  * added 'ensure_string()', 'ensure_string_list()', 'ensure_filename()';
    these take the place of '_check_string()' and friends.  (These actually
    look like really useful type-checking methods that could come in handy
    all over the Distutils; should consider moving them up to Command and
    using them in other command classes' 'finalize_options()' method for
    error-checking).
  * various cleanup, commentary, and adaptation to the new way of
    storing RPM info in '_make_spec_file()'
2000-06-02 01:49:58 +00:00
Greg Ward 8ff5a3fd92 Reformatted and updated many docstrings. 2000-06-02 00:44:53 +00:00
Greg Ward d87eb73f32 Remember the list of archive files created in 'make_distribution()'.
Added 'get_archive_files()' so outsiders can get their hands on that list.
2000-06-01 01:10:56 +00:00
Greg Ward 282c7a0230 Oops, 'reinitialize_command()' forgot to return the command object if didn't
need to be reinitialized -- fixed.
2000-06-01 01:09:47 +00:00
Greg Ward 308acf0bfa Added 'reinitialize_command()' method -- delegated to Distribution instance.
Ensure 'make_archive()' method returns archive filename.
2000-06-01 01:08:52 +00:00
Greg Ward 879096137d Ensure that 'make_archive()' returns the name of the new archive file. 2000-06-01 01:07:55 +00:00
Greg Ward 01a4694dce More tweaking to make this command act like other Distutils commands:
* added "--bdist-base" option to parameterize where we build
    the RPM (comes from "bdist" by default: "build/bdist.<plat>")
  * simplified/cleaned up some code in 'run()' in the process of
    removing (most) hard-coded directory names
  * if "--spec-only", drop spec file in "dist" rather than "redhat"
    (directory name still hard-coded, though)
  * use 'reinitialize_command()' to fetch the "sdist" object to
    tweak before running "sdist" command
  * use 'self.copy_file()' method rather than 'copy_file()' function
  * cosmetic tweaks to comments, error messages
2000-06-01 00:40:25 +00:00
Greg Ward 69413da749 Regularize options a bit:
* help strings start with lowercase
  * added affirmative version of '--no-clean' and '--no-rpm-opt-flags',
    which are the default (thus the attributes that correspond to
    the options are now 'clean' and 'use_rpm_opt_flags')
2000-05-31 23:56:45 +00:00
Greg Ward d8dfb4c4b8 Renamed 'native_path()' to 'convert_path()'.
Also changed it so it doesn't barf if the path is already in native format
  (ie. contains os.sep).
2000-05-31 02:32:10 +00:00
Greg Ward 65bc20c23e Normalize paths before writing them to a zipfile. 2000-05-31 02:17:19 +00:00
Greg Ward 4b46ef9a4f Fixed 'change_root() to work at all on Windows, and to work correctly on Unix. 2000-05-31 02:14:32 +00:00
Greg Ward a76bbd4566 Import the new Extension class, so setup scripts can
"from distutils.core import" it.
2000-05-31 01:11:20 +00:00
Greg Ward 5322f008c5 Overhauled to expect 'self.extensions' (taken from 'ext_modules' in the
setup script) to be a list of Extension instances, rather than a list of of
(ext_name, build_info) tuples.  This is mostly a simplification, but
'check_extension_list()' got a lot more complicated because of the need to
convert the old-style tuples to Extension instances.

Temporarily dropped support for defining/undefining macros in the
'extensions' list -- I want to change the interface, but haven't yet made
the required changes in CCompiler and friends to support this nicely.

Also neatened up the code that merges 'extra_compile_flags' and the CFLAGS
environment variable.
2000-05-31 01:09:52 +00:00
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
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 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
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
Greg Ward fe55e86a0a Take the basename of the script before concatenating it with the build dir. 2000-05-25 20:05:52 +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
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
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
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
Greg Ward 1500374667 Added comment about the MSVC-specific kludge. 2000-05-09 01:50:41 +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
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
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
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
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
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
Greg Ward b1e4a6e101 Added kludge to deal with the "./ld_so_aix" problem: force all strings
in the Makefile that start with "./" to be absolute paths (with the
implied root being the directory where the Makefile itself was found).
2000-04-19 02:22:07 +00:00
Greg Ward 434ef8fe94 Don't load the config.h file, even under Unix, because we never use the
information from config.h.  Code is still there in case someone in the
future needs to parse an autoconf-generated config.h file.
2000-04-19 02:18:09 +00:00
Greg Ward f70c603149 Added 'link_executable()' method (Berthold Hoellmann).
Two small fixes to 'link_shared_object()'.
2000-04-19 02:16:49 +00:00
Greg Ward eacdea8572 Reformatted all exception documentation as docstrings. 2000-04-15 22:23:47 +00:00
Greg Ward 02a1a2b077 Cleaned up/simplified error-handling:
- DistutilsOptionError is now documented as it's actually used, ie.
    to indicate bogus option values (usually user options, eg. from
    the command-line)
  - added DistutilsSetupError to indicate errors that definitely arise
    in the setup script
  - got rid of DistutilsValueError, and changed all usage of it to
    either DistutilsSetupError or ValueError as appropriate
  - simplified a bunch of option get/set methods in Command and
    Distribution classes -- just pass on AttributeError most of
    the time, rather than turning it into something else
2000-04-15 22:15:07 +00:00
Greg Ward 8eef583025 Don't run "ranlib" if sysconfig's RANLIB (from Python's Makefile) starts
with ":".
2000-04-14 13:53:34 +00:00
Greg Ward 1561ae13b6 Use 'get_python_inc()' to figure out the Python include directories
rather than cobbling them togethere here.
2000-04-14 00:50:49 +00:00
Greg Ward 2b9e43f8d0 Coerce all paths in the manifest template to the local path syntax with
'native_path()'.
2000-04-14 00:49:30 +00:00
Greg Ward 1c79330e64 Cleaned up use of sysconfig module a bit: don't import more names
than we actually use, and do actually use AR and SO.
Run ranlib on static libraries.  (Should probably have a platform-check
  so we don't run ranlib when it's not necessary, ie. on most modern
  Unices.)
2000-04-14 00:48:15 +00:00
Greg Ward b6f5adaa12 Don't bother reading config.h on NT or Mac OS. (It's not really needed
on Unix either, so should probably disappear entirely.)
2000-04-14 00:39:31 +00:00
Greg Ward d197a3a12c Define 'self.force' in the constructor and remove the hack in '__getattr__()'
to account for it not being defined in the constructor.
2000-04-10 13:11:51 +00:00
Greg Ward 7aff6f34fe Delete some debugging print statements. 2000-04-10 01:31:58 +00:00
Greg Ward e9613ae05f Added a check for the 'force' attribute in '__getattr__()' -- better than
crashing when self.force not defined.
Revise 'copy_file()' and 'copy_tree()' docstrings accordingly.
Remove 'hasattr()' check for 'self.force' from 'make_file()'.
2000-04-10 01:30:44 +00:00
Greg Ward d38e6f7637 Added optional 'prefix' arguments to 'get_python_inc()' and
'get_python_lib()'.
2000-04-10 01:17:49 +00:00
Greg Ward cf6bea3dc7 Better variable names here and there. 2000-04-10 01:15:06 +00:00
Greg Ward c41d6b35a9 Added '--force' option -- very clear what it means for building (ignore
timestamps), so every build_* command has 'self.force', which follows the
'build' command if not set by the user.
2000-04-10 00:19:42 +00:00
Greg Ward 68a0757e23 Removed global '--force' option -- just too vague a concept to be applicable
to all commands in the same way.  Several Command methods now either expect
'self.force' to be defined, or check if it is defined and assume it's
false if not.
2000-04-10 00:18:16 +00:00
Greg Ward 582a8701cb Added __version__ to store the Distutils version number. 2000-04-10 00:02:16 +00:00
Greg Ward 60908f1408 Ditched the unused 'list_only' option.
Added code to include source files from 'build_clib' command to default file
  list -- currently this won't work, since 'build_clib' doesn't have a
  'get_source_files()' method!
2000-04-09 03:51:40 +00:00
Greg Ward b2e2c29295 Catch DistutilsFileError in addition to DistutilsExecError in 'setup()'. 2000-04-09 03:49:20 +00:00
Greg Ward b361233c76 Added (currently) pointless and trivial main body (for future tests). 2000-04-09 03:48:37 +00:00
Greg Ward d759f5f145 This little note is to clarify things for people who go poking around the
Python library hoping to find out more about the Distutils.
2000-04-09 02:31:45 +00:00
Greg Ward 7d508fe568 Add missing import of 'usage' string. 2000-04-06 02:07:41 +00:00
Greg Ward aebf706b4e Reorganization: ripped util.py to shreds, creating in the process:
- file_util.py: operations on single files
  - dir_util.py: operations on whole directories or directory trees
  - dep_util.py: simple timestamp-based dependency analysis
  - archive_util.py: creation of archive (tar, zip, ...) files
The functions left in util.py are miscellany that don't fit in any of the
new files.
2000-04-04 02:05:59 +00:00
Greg Ward fe6462c1f3 Reorganization: moved the Distribution class from core.py to dist.py, and
the Command class from core.py to cmd.py.  No other code needs changing
though; distutils.core still provides the Command and Distribution classes,
although indirectly now.
2000-04-04 01:40:52 +00:00
Greg Ward 19ce16665d Fixed my simplification to Thomas' patch: winreg and win32api export the same
functions, but with different names.
2000-03-31 19:04:25 +00:00
Greg Ward 1027e3fde9 Simplified Thomas Heller's registry patch: just assign all those
HKEY_* and Reg* names once, rather than having near-duplicate code
in the two import attempts.

Also dropped the leading underscore on all the imported symbols,
as it's not appropriate (they're not local to this module).
2000-03-31 16:53:42 +00:00
Greg Ward 7642f5cf38 Patch from Thomas Heller: use the new winreg module if available. 2000-03-31 16:47:40 +00:00
Greg Ward b4c850c928 Added code to blow away the pseudo-installation tree and a 'keep_tree'
option to disable this (by default, it's false and we clean up).
2000-03-31 05:22:47 +00:00
Greg Ward e5796fecc6 Oops, got a little too enthusiastic deleting code in that last revision:
we still have to *run* the sub-command that creates a built distribution.
2000-03-31 05:21:27 +00:00
Greg Ward 1889de8889 Fixed 'make_archive()' to explicitly turn of compression when format is "tar". 2000-03-31 05:20:27 +00:00
Greg Ward 02296cea39 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.
2000-03-31 05:08:50 +00:00
Greg Ward 6b213766d8 Import from 'types' module.
Added 'ztar', 'tar' to 'format_command' dictionary.
2000-03-31 04:53:41 +00:00
Greg Ward 6ce00b4440 Tweaked 'get_platform()' to include the first character of the OS release:
eg. sunos5, linux2, irix5.
2000-03-31 04:40:25 +00:00
Greg Ward 7d51034eef Removed some old test code: don't set 'plat' when calling 'new_compiler()'. 2000-03-31 04:37:40 +00:00
Greg Ward 95c0b269de Don't perpetrate the "_d" hack for naming debugging extensions -- that's
now done in the 'build_ext' command.
2000-03-31 03:52:16 +00:00
Greg Ward 842296480e 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()'.
2000-03-31 03:50:23 +00:00
Greg Ward 6e8ee5d8e9 Don't put Python's library directory into the library search path -- that's
specific to building Python extensions.
2000-03-31 03:34:09 +00:00
Greg Ward 6148c2cfa6 Added 'bdist' and 'bdist_dumb'. 2000-03-31 03:14:51 +00:00
Greg Ward 1b64a7e4a5 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()'.
2000-03-31 03:05:18 +00:00
Greg Ward 32ce329ce4 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".
2000-03-31 03:02:22 +00:00
Greg Ward 318a9d7aa2 Added DistutilsInternalError. 2000-03-31 02:57:31 +00:00
Greg Ward e1664bdc59 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.
2000-03-31 02:56:34 +00:00
Greg Ward 0f77f9569c 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.
2000-03-31 02:55:12 +00:00
Greg Ward 1aab6e9645 Added 'get_inputs()'. 2000-03-31 02:53:07 +00:00
Greg Ward ba38d12063 Fixed 'get_outputs()' so it actually works.
Added 'get_inputs()' (which is strikingly similar to 'get_outputs()' - sigh).
Cosmetic tweaks.
2000-03-31 02:52:02 +00:00
Greg Ward 578c10d9a5 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
2000-03-31 02:50:04 +00:00
Greg Ward 71d55835b3 Oops: 'build_extensions()' no longer takes an 'extensions' list. 2000-03-30 19:47:22 +00:00
Greg Ward 1d16a9f040 Put the Python "system" include dir last, rather than first. 2000-03-29 04:13:49 +00:00
Greg Ward 41b4dd66c8 Call 'find_exe()', not '_find_exe()'. 2000-03-29 04:13:00 +00:00
Greg Ward ed8a0e0f21 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.
2000-03-29 03:29:34 +00:00
Greg Ward 044b7c15c9 Changed 'copy_tree()' so it returns the list of all files that were copied or
might have been copied, regardless of the 'update' flag.
2000-03-29 03:27:45 +00:00
Greg Ward 739d06689d Documented Bastian's patch.
Made handling OSError in 'mkpath()' more standard.
2000-03-29 02:56:34 +00:00
Greg Ward da4d1aef4e Patch from Bastian Kleineidam <calvin@cs.uni-sb.de>:
make 'mkdir()' return list of directories created.
2000-03-29 02:53:02 +00:00
Greg Ward 7c1a6d4777 Added 'make_tarball()' and 'make_zipfile()' functions in preparation
for the 'bdist_dumb' command.  Adapted, with tweakage, from the 'sdist'
command.
2000-03-29 02:48:40 +00:00
Greg Ward 03d1ae1f01 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.
2000-03-29 02:47:29 +00:00
Greg Ward f00c34da1d Added the "distribution query" methods: 'has_pure_modules()',
'has_ext_modules()', 'has_c_libraries()', 'has_modules()', and 'is_pure()'.
2000-03-29 02:20:45 +00:00
Greg Ward ab9d08ce65 Added 'build_clib'; replaced 'install_py' and 'install_ext' with 'install_lib'. 2000-03-29 02:18:39 +00:00
Greg Ward e5dfba5e0f 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()'.
2000-03-29 02:17:42 +00:00
Greg Ward ee94c57fe9 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.
2000-03-29 02:15:57 +00:00
Greg Ward ae45b16157 Use the new 'has_pure_modules()', 'has_ext_modules()', 'has_c_libraries()'
methods of Distribution instead of grovelling directly in self.distribution.
2000-03-29 02:14:21 +00:00
Greg Ward 4d16e0ac20 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()'.
2000-03-29 02:13:09 +00:00
Greg Ward 8b2e95edd6 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
2000-03-29 02:10:51 +00:00
Greg Ward 89489fa15d Beefed up error-handling in 'setup()' a smidge:
handle OSError and DistutilsExecError now.
2000-03-26 21:48:43 +00:00
Greg Ward a3c8bf382e Duh, it helps if '_nt_quote_args()' actually returns the mutated list,
rather than None.
2000-03-26 21:47:00 +00:00
Greg Ward cdb20ba56d Fixed a bunch of screwed-up logic and inconsistent terminology.
Fixed 'build_extensions()' to pay attention to the 'rpath' element of the
  'build_info' dictionary.
2000-03-26 21:45:14 +00:00
Greg Ward 2f557a2ec4 Added 'runtime_library_dirs' parameter to 'link_*()' methods, and warn that
we don't know what to do with it when we see it.
Call '_fix_object_args()' and/or '_fix_lib_args()' as appropriate, rather
  than just '_fix_link_args()'.
2000-03-26 21:42:28 +00:00
Greg Ward e21dabe2e0 Added 'runtime_library_dirs' parameter to 'link_*()' methods, and changed to
use it when linking.
Call '_fix_object_args()' and/or '_fix_lib_args()' as appropriate, rather
  than just '_fix_link_args()'.
2000-03-26 21:40:19 +00:00
Greg Ward f10f95d6bb Added 'runtime_library_dirs' parameter to 'link_*()' methods.
Split '_fix_link_args()' up into '_fix_object_args()' (for use of
  'create_static_lib() and link methods) and '_fix_lib_args()' (for the
  link methods only).
2000-03-26 21:37:09 +00:00
Greg Ward a7540bd043 Import fix. 2000-03-23 04:39:16 +00:00
Greg Ward e2a33079e9 Fixed '_nt_quote_args()': backwards logic reversed, and now it actually
returns a value.
2000-03-23 04:38:36 +00:00
Greg Ward 297dd9fed5 Fixed the class name. 2000-03-23 04:37:11 +00:00
Greg Ward 790c110c48 Revised tons of comments to reflect the current state of affairs better.
Deleted some crufty code.
2000-03-22 00:51:18 +00:00
Greg Ward 048ca7dcaf Run 'install_lib' instead of 'install_py', and ditch 'install_ext'
completely (was already commented-out).
2000-03-22 00:40:16 +00:00
Greg Ward 55753d4a75 Renamed install_py.py to install_lib.py, since it now handles installing all
Python modules, pure and extensions.
2000-03-22 00:37:16 +00:00
Greg Ward 5b001f1569 Obsolete command -- no longer relevant since we now build all modules, pure
Python and extensions, into the same directory.
2000-03-22 00:35:16 +00:00
Greg Ward 1497b61cb0 Dropped the evil and misguided 'set_peer_option()' method -- it's no
longer needed, and can't possibly work anyways.
2000-03-22 00:31:37 +00:00
Greg Ward 066af1074d Dropped any notion of allowing the user to specify the build directories:
these must come from the 'build' command.  This means we no longer need
the misconceived 'set_peer_option()' method in Command and, more importantly,
sweeps away a bunch of potential future complexity to handle this tricky
case.
2000-03-22 00:30:54 +00:00
Greg Ward 1b4ede5f24 Improved an error message in 'mkpath()'.
Tightened up some logic in 'native_path()'.
Added 'subst_vars()' and '_check_environ()'.
2000-03-22 00:22:44 +00:00
Greg Ward 7f6ef6ca26 Renamed 'install_path' to 'extra_path'.
Fix 'Command.set_undefined_option()' to call 'ensure_ready()' rather
  than 'finalize_options()' (which is only supposed to be called once,
  which is the whole point of 'ensure_ready()').
Added comment to 'set_peer_option()' to remind myself that this method
  cannot work and is fundamentally wrong-headed.
2000-03-22 00:20:46 +00:00
Greg Ward a233d86638 Yet another complete rewrite. Hopefully the *last* complete rewrite of
this command for a while; this implements roughly the plan cooked up by
Guido, Fred, and me.  Seems to strike a nice balance between usability in
the common cases (just set one option), expandability for more types of
files to install in future, and customizability of installation
directories.

This revision isn't completely working: standard and alternate
installations work fine, but there are still some kinks to work out of
customized installations.
2000-03-22 00:15:45 +00:00
Greg Ward 531349f28e Fix how we set 'build_dir' and 'install_dir' options from 'install' options --
irrelevant because this file is about to go away, but oh well.
2000-03-22 00:12:51 +00:00
Greg Ward 4620f306a4 Took out what looks like old debugging code that probably should never
have been checked in: was passing the PLAT environment variable as the
'plat' argument to 'new_compiler()'.
2000-03-22 00:11:21 +00:00
Greg Ward fb4ece7fea Simplified doc string.
Added 'clean' to list of commands.
2000-03-18 17:36:09 +00:00
Greg Ward 89ccb984f0 Oops! Don't call 'ensure_ready()' in 'Distribution.find_command_obj()' --
that broke parsing command-line options.  Instead call it in
'Command.find_peer()', which is why I added it to 'find_command_obj()'
in the first place.
2000-03-18 17:35:12 +00:00
Greg Ward 11fc7e447c Tweaked all over:
* improve help strings
  * warn if user supplies non-existing directories
  * don't try to 'remove_tree()' non-existing directories
  * try to remove the build_base after cleanup (but don't do or say
    anything if it fails -- this is just in case we made it empty)
2000-03-18 17:33:18 +00:00
Greg Ward 2dc139cc91 Patch from Bastian Kleineidam <calvin@cs.uni-sb.de>:
use 'util.remove_tree()' instead of 'nuke_release_tree()'.
2000-03-18 15:43:42 +00:00
Greg Ward b98fe36c46 Patch from Bastian Kleineidam <calvin@cs.uni-sb.de>: added 'remove_tree()'. 2000-03-18 15:42:22 +00:00
Greg Ward 06537a5e89 Contribution from Bastian Kleineidam <calvin@cs.uni-sb.de>:
the Distutils 'clean' command.
2000-03-18 15:37:26 +00:00
Greg Ward dedd5b5ed2 In 'finalize_options()': if 'self.libs' is a string, make it a singleton list. 2000-03-18 15:21:03 +00:00
Greg Ward d03f88a38f Changed to pay attention to the 'runtime_library_dirs' list (= 'rpath'
option in the 'build_ext' command):
  * in ccompiler.py: 'gen_lib_options()' now takes 'runtime_library_dirs'
    parameter
  * in unixccompiler.py and msvccompiler.py: now pass
    'self.runtime_library_dirs' to 'gen_lib_options()', and define
    'runtime_library_dir_option()' (although in msvccompiler.py it
    blows up with a DistutilsPlatformError right now!)
2000-03-18 15:19:51 +00:00
Greg Ward 92f3377078 Catch up with change to CCompiler API: call 'create_static_lib()', not
'link_static_lib()'.
2000-03-10 02:02:44 +00:00
Greg Ward 09fc542b27 Renamed 'link_static_lib() to 'create_static_lib()', and rewrote it create
a static library (using lib.exe as found by '__init__()', hopefully through
registry entries pointing to DevStudio).
2000-03-10 01:49:26 +00:00
Greg Ward 036c805958 Renamed 'link_static_lib() to 'create_static_lib()'. 2000-03-10 01:48:32 +00:00
Fred Drake c1ee39a99e There are a few places which can raise DistutilsPlatformError; make
sure it's imported!  ;)

Re-wrap the docstrings on get_python_inc() and get_python_lib() to be
closer to the "normal" Python style.  See GvR's "style guide" on the
essays page (http://www.python.org/doc/essays/).

There should never be a space between a function name and the '(' that
opens the argument list (see the style guide again).
2000-03-09 15:54:52 +00:00
Greg Ward 7d73b9eb18 Added Joe Van Andel's 'get_python_inc()', adapted by me to supply
the platform-neutral include dir by default and with Mac support.
Added 'get_python_lib()', inspired by 'get_python_inc()'.
Rewrote 'get_config_h_filename()' and 'get_makefile_filename()'
  in terms of 'get_python_inc()' and 'get_python_lib()'.
Changed '_init_nt()' and '_init_mac()' to use 'get_python_inc()' and
  'get_python_lib()' for directory names.
2000-03-09 03:16:05 +00:00
Greg Ward 911d86693b Patch from Corran Webster <cwebster@nevada.edu> (tweaked for style by me):
changed 'copy_file()' to use the native Mac file copy routine.
2000-03-07 03:34:16 +00:00
Greg Ward 0eff87a570 Patch from Corran Webster <cwebster@nevada.edu>: add '_init_mac()'. 2000-03-07 03:30:09 +00:00
Greg Ward 5091929c2c Added 'native_path()' for use on pathnames from the setup script: split on
slashes, and put back together again using the local directory separator.
2000-03-07 03:27:08 +00:00
Greg Ward e2b4452d0c Added '_nt_quote_args()' to deal with whitespace in command-line arguments
in a rather half-assed, but probably effective, way.
2000-03-07 03:25:20 +00:00
Greg Ward 9552665436 Rewrote 'newer_pairwise(): more natural (and incompatible) interface,
simpler implementation.
2000-03-06 03:44:32 +00:00
Greg Ward 32c4a8a0ee Serious overhaul of the C compiler interface and the two classes that
implement it (so far):
  * moved filename generation methods into CCompiler base class,
    driven by data supplied by implementation classes
  * moved a bunch of common code from UnixCCompiler to convenience
    methods in CCompiler
  * overhauled MSVCCompiler's compile/link methods to look and act
    as much as possible like UnixCCompiler's, in order to regularize
    both interface and behaviour (especially by using those new
    convenience methods)
2000-03-06 03:40:29 +00:00
Greg Ward eb3f75e636 Don't pass 'keep_dir' to 'compile()' method of CCompiler -- no longer used. 2000-03-06 03:37:45 +00:00
Greg Ward 4ba5da418c Don't pass 'keep_dir' to 'compile()' method of CCompiler -- no longer used.
Don't assume that the 'libraries' and 'library_dirs' elements of the
  build info dict are always lists.
2000-03-06 03:36:50 +00:00
Greg Ward 56359f591b Typo fix. 2000-03-03 03:00:27 +00:00
Greg Ward 96182d7b68 Fixed 'mkpath()' to accept empty string silently (it's just the current dir).
Fixed all DistutilsFileError messages to wrap file/dir names in quotes.
2000-03-03 03:00:02 +00:00
Greg Ward 76ec0d6d76 Renamed 'build_lib' command to 'build_clib':
* replaced build_lib.py with build_clib.py
  * renamed the class in build_clib.py
  * changed all references to 'build_lib' command in other command classes
2000-03-02 01:57:12 +00:00
Greg Ward 3ce77fd05e Changed '__rcsid__' to '__revision__'. 2000-03-02 01:49:45 +00:00
Greg Ward 60f64330d1 If the "build_lib" command built any C libraries, link with them all
when building extensions (uses build_lib's 'get_library_names()' method).
Ensure that the relative structure of source filenames is preserved in
  the temporary build tree, eg. foo/bar.c compiles to
  build/temp.<plat>/foo/bar.o.
2000-03-02 01:32:21 +00:00
Greg Ward 833dfd52e5 Added command description.
Added 'build_clib' and 'build_temp' options (where to put C libraries
  and where to put temporary compiler by-products, ie. object files).
Moved the call to 'check_library_list()' from 'run()' to 'finalize_options()'
  -- that way, if we're going to crash we do so earlier, and we guarantee
  that the library list is valid before we do anything (not just run).
Disallow directory separators in library names -- the compiled library
  always goes right in 'build_clib'.
Added 'get_library_names()', so the "build_ext" command knows what
  libraries to link every extension with.
2000-03-02 01:27:36 +00:00
Greg Ward 49ffce173e In the 'compile()' method: preserve the directory portion of source
filenames when constructing object filenames, even if output_dir given --
eg. "foo/bar.c" will compile to "foo/bar.o" without an output_dir, and to
"temp/foo/bar.o" if output_dir is "temp".
2000-03-02 01:21:54 +00:00
Greg Ward f1146572dd In compile/link methods: ensure that the directory we expect to be writing to
exists before calling the compiler/linker.
2000-03-01 14:43:49 +00:00
Greg Ward 013f0c8636 Added 'mkpath()' method: convenience wrapper around 'util.mkpath()' that adds
the compiler objects 'verbose' and 'dry_run' flags.
2000-03-01 14:43:12 +00:00
Greg Ward 611850bbb3 Added call to 'ensure_ready()' on the command object in
'Distribution.find_command_obj()'.
2000-03-01 14:42:07 +00:00
Greg Ward 585df89f60 Added 'get_platform()' to construct a string that identifies the current
platform, using 'os.uname()' or 'sys.platform'.
2000-03-01 14:40:15 +00:00
Greg Ward e51d69efb0 Build reorg:
* 'build_dir' -> 'build_lib', which by default takes its value
    straight from 'build_lib' in the 'build' command
  * added 'build_temp' and 'inplace' options
  * change 'build_extensions()' to put object files (compiler turds) in
    'build_temp' dir
  * complicated the name-of-extension-file shenanigans in
    'build_extensions()' to support "in-place" extension building, i.e.
    put the extension right into the source tree (handy for developers)
  * added 'get_ext_fullname()', renamed 'extension_filename()' to
    'get_ext_filename()', and tweaked the latter a bit -- all to support
    the new filename shenanigans
2000-03-01 01:43:28 +00:00
Greg Ward 42a3bf564a Build reorg:
* 'build_lib' -> 'build_purelib'
  * new 'build_lib' and 'build_temp' options
  * use 'get_platform()' to initialize 'build_platlib' and 'build_temp'
2000-03-01 01:26:45 +00:00
Greg Ward e691651682 Build reorg: change 'build_dir' option to 'build_lib'. 2000-03-01 01:19:37 +00:00
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