Commit Graph

727 Commits

Author SHA1 Message Date
Thomas Heller b943840a78 The windows installer must also look under the HKEY_CURRENT_USER key
for python installations, not only under HKEY_LOCAL_MACHINE.
2000-09-09 19:52:49 +00:00
Thomas Heller 904ca11a87 Changes:
distutils/command/bdist_wininst.py:
- the windows installer is again able to compile after installing
  the files. Note: The default has changed, the packager has to
  give --no-target-compile/--no-target-optimize to NOT compile
  on the target system. (Another note: install_lib's --compile
  --optimize options have the same semantics to switch off
  the compilation. Shouldn't the names change?)
- All references to specific python versions are gone.
- A small bug:
    raise DistutilsPlatformError ("...")
  instead of
    raise DistutilsPlatformError, ("...")
- When bdist_wininst creates an installer for one specific python
  version, this is reflected in the name:
    Distutils-0.9.2.win32-py15.exe instead of
    Distutils-0.9.2.win32.exe
- bdist_wininst, when run as script, reads the wininst.exe file
  and rewrites itself. Previously this was done by hand.

misc/install.c
- All the changes needed for compilation
- Deleted a lot of debug/dead code
2000-09-07 15:59:22 +00:00
Greg Ward 8d5b5ec513 Typo fix. 2000-09-07 02:38:42 +00:00
Greg Ward 5fad268ffc Bullet-proofing of 'make_release_tree()':
- 'mkpath()' the distribution dir in case of empty manifest
  - warn if empty manifest
  - detect, warn about, and skip non-regular files in manifest
2000-09-06 02:18:59 +00:00
Greg Ward d3b76a8fbf Reorganized logic in 'get_file_list()' so it's easier to read, and fixed a
bug to boot: now works even if both MANIFEST and MANIFEST.in don't exist.
Don't hardcode setup.py, use 'self.distribution.script_name'.
2000-09-06 02:08:24 +00:00
Greg Ward 6a2035d76b Typo fix. 2000-09-06 02:06:27 +00:00
Greg Ward 1ac9802748 Rene Liebscher/Thomas Heller:
* ensure the "dist" directory exists
* raise exception if using for modules containing compiled extensions
  on a non-win32 platform.
* don't create an .ini file anymore (it was just for debugging)
2000-09-01 01:44:45 +00:00
Greg Ward cec1568625 Rene Liebscher:
* reverse library names from bcpp_library to library_bcpp
* move some code to the right places, to put the def-files
  in the right directories again
2000-09-01 01:28:33 +00:00
Greg Ward 7483d6803b Rene Liebscher: comment fixes. 2000-09-01 01:24:31 +00:00
Greg Ward 66e966f7bd Rene Liebscher: hack '_init_posix()' to handle the BeOS linker script.
(With a worry-wart comment added by me about where we *should* add the
Python library to the link.)
2000-09-01 01:23:26 +00:00
Greg Ward b3b6d395e4 Bump version to 0.9.2. 2000-09-01 01:00:40 +00:00
Greg Ward e3644e245e Added 'run_setup()' to allow outsiders to run a setup script under
fairly tight control, and the '_setup_stop_after' and '_setup_distribution'
globals to provide the tight control.

This isn't entirely reliable yet: it dies horribly with a NameError on the
example PIL setup script in examples/pil_setup.py (at least with Python
1.5.2; untested with current Python).  There's some strangeness going
on with execfile(), but I don't understand it and don't have time
to track it down right now.
2000-09-01 00:52:45 +00:00
Greg Ward 8a98cd9e25 Add /GX to 'compile_options'. This is definitely needed for C++ source;
according to the MS docs it enables exception-handling, and (according
to Alex Martelli <aleaxit@yahoo.com>) is needed to compile without
getting warnings from standard C++ library headers.  Apparently
it doesn't cause any problems with C code, so I haven't bothered
conditionalizing the use of /GX.
2000-08-31 00:31:07 +00:00
Greg Ward 408e9ae299 Add ".cxx" to the list of known C++ extensions. 2000-08-30 17:32:24 +00:00
Greg Ward 46a69b9c7f Added docstring for 'wrap()' function. 2000-08-30 17:16:27 +00:00
Greg Ward 9821bf4e62 Added 'script_name' and 'script_args' instance attributes to Distribution.
Changed 'core.setup()' so it sets them to reasonable defaults.
Tweaked how the "usage" string is generated: 'core' now provides
  'gen_usage()', which is used instead of 'USAGE'.
Modified "build_py" and "sdist" commands to refer to
  'self.distribution.script_name' rather than 'sys.argv[0]'.
2000-08-29 01:15:18 +00:00
Greg Ward 6f9320b9d1 Fix line-endings.
Fix bad operator precedence: should be "(metadata or '') + '\n'".
2000-08-27 20:44:13 +00:00
Greg Ward 018cbb15c0 New release of the Windows installer from Thomas Heller.
The known bug (bogus error message when an empty file is
extracted) is fixed.

Other changes:

- The target-compile and target-optimize flags of bdist_wininst
  are gone. It is no longer possible to compile the python
  files during installation.
- The zlib module is no longer required or used by bdist_wininst.

- I moved the decompression/extraction code into a separate
  file (extract.c).

- The installer stub is now compressed by UPX (see
  http://upx.tsx.org/). This reduces the size of the exe
  (and thus the overhead of the final installer program)
  from 40 kB to 16 kB.

- The installer displays a more uptodate user wizard-like
  user interface, also containing a graphic: Just's Python Powered logo.
  (I could not convince myself to use one of the BeOpen logos).
- The installation progress bar now moves correctly.
2000-08-26 02:40:10 +00:00
Greg Ward 889de85d8b Bumped version to 0.9.2pre. 2000-08-26 02:37:07 +00:00
Greg Ward d8014e6608 In 'check_extensions_list()': when converting old-style 'buildinfo' dict,
don't assign None to any attributes of the Extension object.
2000-08-26 02:21:55 +00:00
Greg Ward 986659fffe Don't bother to 'mkpath()' the 'dist_dir' -- that's now taken care of
in archive_util.py.
2000-08-22 01:49:41 +00:00
Greg Ward 04e25a1bdf Ensure destination directory exists before trying to create a tarball
or ZIP file.
2000-08-22 01:48:54 +00:00
Greg Ward f40ff1b8b2 Bump version to 0.9.1. 2000-08-15 13:14:27 +00:00
Greg Ward 44a980dff9 Fixed the move-RPM-files hack so it knows about the '--binary-only' and
'--source-only' options.
2000-08-15 13:05:35 +00:00
Greg Ward a12c195064 Added support for the '--dist-dir' option, including a mildly nasty
hack to find the two created RPM files (source and binary) and
move them to the "dist dir" (default "dist").
2000-08-15 13:03:16 +00:00
Greg Ward c0fe82ca26 Fix long-hidden inconsistency in internal interface: 'find_modules()' now
represents packages as strings, not tuples.  This allowed a simplification
in 'get_package_dir()', too -- can now assume that 'package' is a string.
2000-08-15 13:01:25 +00:00
Greg Ward e8e9d11453 Overhauld 'check_config_h()': now returns a (status, details) tuple,
and is much better documented to boot.
2000-08-13 01:18:55 +00:00
Greg Ward 1398045136 Added a whinging comment about the ugliness of constructing the BCPP
argument list.
2000-08-13 00:54:39 +00:00
Greg Ward b1dceae3df Rene Liebscher:
* use self.debug_print() for debug messages
  * uses now copy.copy() to copy lists
  * added 'shared_lib_extension=".dll"', ... , this is necessary if you
    want use the compiler class outside of the standard distutils build
    process.
  * changed result type of check_config_h() from int to string
2000-08-13 00:43:56 +00:00
Greg Ward a4662bc1bc Rene Liebscher:
* changed some list.extend([...]) to list.append(...)
  * added '/g0' to compiler_options, so compiler doesn't
    stop after 100 warnings
2000-08-13 00:43:16 +00:00
Greg Ward a35c931eb2 get_export_symbols() changed, adds now module init function if not given
by the user.
2000-08-13 00:42:35 +00:00
Greg Ward 1f6a0d4568 Rene Liebscher: ext.export_symbols is now always a list (added 'or []'). 2000-08-13 00:41:40 +00:00
Greg Ward 45b87bc96d Typo fix in docstring. 2000-08-13 00:38:58 +00:00
Greg Ward 29124ff4f2 Fix references to functions formerly imported from 'util'. 2000-08-13 00:36:47 +00:00
Greg Ward 2b042ded19 Fix so 'split_quoted()' handles any whitespace delimiter (not just space). 2000-08-08 14:38:13 +00:00
Greg Ward 1b024d37a7 Fix so the 'install_libbase' directory -- where .pth files are installed --
participates in the "--root" hack, ie. it also has a new root directory
hacked on at the very last minute (essential if the .pth file is to be
included in an RPM or other smart installer!).
2000-08-07 00:48:04 +00:00
Greg Ward 0fd2dd6db0 Fix so we clear or reinitialize various data structures before populating
(allows the same FancyGetopt object to be used multiple times with different
option tables).
2000-08-07 00:45:51 +00:00
Greg Ward ab3a0f36ed Fixed imports from '*util' modules to not just import everything from util. 2000-08-05 01:31:54 +00:00
Greg Ward 5a8aa1ba2e Drop the 'extend()' function -- old 1.5.1 compatibility hack that
wasn't actually used anywhere.
Drop the "from xxx_util import*" backwards compability hacks.
2000-08-05 01:25:24 +00:00
Greg Ward f813e59d49 Added 'debug_print()'. 2000-08-04 01:31:13 +00:00
Greg Ward 5db2c3ae24 Rewrote 'find_library_file()' much more cleanly (and consistently with
MSVCCompiler's version, to aid in factoring common code out of the two
classes when the time comes).
2000-08-04 01:30:03 +00:00
Greg Ward d142564821 Added 'debug' flag to 'find_library_file()', and changed code to handle it. 2000-08-04 01:29:27 +00:00
Greg Ward e5e6015e5a Added 'debug' flag to 'find_library_file()'. 2000-08-04 01:28:39 +00:00
Greg Ward dc9fe8a7ba Typo fix. 2000-08-02 01:49:40 +00:00
Greg Ward 6f628bb877 Added 'wininst' to the 'format_commands' list, so it's included in
the --help-formats output.  Also moved that list up so it's more obvious
when adding formats.
2000-08-02 01:44:44 +00:00
Greg Ward 9dddbb4009 Added 'execute()' method, a thin wrapper around 'util.execute() (just like
the one in cmd.py).
2000-08-02 01:38:20 +00:00
Greg Ward d7faa81616 Replaced 'execute()' method with a thin wrapper around 'util.execute()'. 2000-08-02 01:37:53 +00:00
Greg Ward 1c16ac360a Added the 'execute()' function (moved here from cmd.py with minor tweakage). 2000-08-02 01:37:30 +00:00
Greg Ward 90c74cc4da Rene Liebscher: fix 'skipping byte-compilation' message for grammatical
consistency.
2000-08-02 01:34:18 +00:00
Greg Ward bf5c70973f Latest version from Rene Liebscher; major changes:
- added big comment describing possible problems
  - look for and react to versions of gcc, ld, and dlltool; mainly
    this is done by the 'get_versions()' function and the CygwinCCompiler
    and Mingw32CCompiler constructors
  - move 'check_config_h()' to end of file and defer calling it until
    we need to (ie. in the CygwinCCompiler constructor)
  - lots of changes in 'link_shared_object()' -- mostly seems to be
    library and DLL stuff, but I don't follow it entirely
2000-08-02 01:31:56 +00:00
Greg Ward 1d526dd3b3 Rene Liebscher: deleted unneeded hard-coded assignments of CC, RANLIB, etc.
in '_init_nt()' (they were kludges for CygwinCCompiler and no longer needed).
2000-08-02 01:09:11 +00:00
Greg Ward 88608caff2 Rene Liebscher: factor 'find_executable()' out of '_spawn_nt()'. 2000-08-02 01:08:02 +00:00
Greg Ward c58c517741 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
it so BCPPCompiler actually works, so I'm provisionally accepting it
-- ugly and working is better than not working!  Major changes:
  - normalize paths (apparently BC++ doesn't like slashes)
  - overhauled how we search for and specify libraries on the linker
    command-line
  - hacked up 'find_library_file()' so it knows about "debug" library
    naming convention as well as "bcpp_xxx.lib" -- the question is,
    is this a well-established and sensible convention?
Also:
  - change to use 'util.write_file()' to write the .def file
2000-08-02 01:03:23 +00:00
Greg Ward bb56190422 Ditched 'abspath()' -- don't need 1.5.1 compatability hacks anymore. 2000-08-02 00:37:32 +00:00
Greg Ward c6a18a5d65 Removed 'export_symbol_file'.
'export_symbols' can be None (not sure this is a good idea: it's inconsistent
  with every other instance attribute of Extension).
2000-08-02 00:04:13 +00:00
Greg Ward 04c90fc475 Ditched some debugging prints. 2000-08-02 00:01:56 +00:00
Greg Ward 159eb92239 Patch from Rene Liebscher: generate an /IMPLIB: option to ensure that
the linker leaves the (temporary) .lib file in the temporary dir.  (Moved
from 'msvc_prelink_hack()' method in build_ext.py.)
2000-08-02 00:00:30 +00:00
Greg Ward 0419a4ffba Patch from Rene Liebscher, tweaked by me:
- 'export_symbol_file' (and corresponding 'def_file' in the old
    "build info" dict) are gone; warn if we see 'def_file' in the
    dict
  - the MSVC "pre-link hack" is gone -- all that stuff is now handled
    elsewhere (eg. by using 'export_symbols', etc.)
  - add 'get_export_symbols()' and 'get_libraries()' methods -- needed
    because on Windows, both of those things are a tad more complicated
    than fetching them from the Extension instance
2000-08-01 23:54:29 +00:00
Greg Ward 6b24dffd13 Catch syntax errors from processing template lines and turn them into
mere warnings.
Call 'findall()' on our FileList object before we start using it seriously.
2000-07-30 01:47:16 +00:00
Greg Ward 979db976a3 Added list-like methods: 'append()', 'extend()', 'sort()'.
Added 'remove_duplicates()'.
Simplified constructor: no longer take 'files' or 'allfiles' as args,
  and no longer have 'dir' attribute at all.
Added 'set_allfiles()' and 'findall()' so the client does have a
  way to set the list of all files.
Changed 'include_pattern()' to use the 'findall()' method instead of
  the external function.  (Of course, the method is just a trivial
  wrapper around the function.)
2000-07-30 01:45:42 +00:00
Greg Ward 23266fe5cf Replaced 'self.files' with 'self.filelist': now we carry around a FileList
instance instead of a list of filenames.  Simplifies the "sdist" command
only a bit, but should allow greater simplification of FileList.
2000-07-30 01:30:31 +00:00
Greg Ward 4571ac15f7 The other half of Rene Liebscher's patch to add the Template class,
which I renamed to FileList: remove all the file-list-generation code from
the sdist command and adapt it to use the new FileList class instead.
2000-07-30 01:05:02 +00:00
Greg Ward d5dcc174b0 Typo fix. 2000-07-30 01:04:22 +00:00
Greg Ward 58bff53320 Added DistutilsTemplateError. 2000-07-30 01:03:31 +00:00
Greg Ward c019e2c7a8 Ditched the unused 'recursive_exclude_pattern()' method. 2000-07-30 00:37:04 +00:00
Greg Ward 0f341855ac Renamed 'select_pattern()' to 'include_pattern()'.
Other cosmetic/doc/comment tweaks.
2000-07-30 00:36:25 +00:00
Greg Ward 7b3d56c85c Renamed 'process_line()' to 'process_template_line()', and factored out
'_parse_template_line()'.
2000-07-30 00:21:36 +00:00
Greg Ward c98927a059 Added class docstring and ditched inappropriate class attrs.
Indentation/whitspace fixes.
2000-07-30 00:08:13 +00:00
Greg Ward adc1172064 Provides the FileList class for building a list of filenames by exploring
the filesystem, and filtering the list by applying various patterns.

Initial revision (almost) as supplied in a patch by Rene Liebscher; I
just renamed the class from Template to FileList, and the module
accordingly.
2000-07-30 00:04:17 +00:00
Greg Ward ae0965eb23 Bump version to 0.9.1pre. 2000-07-27 02:17:40 +00:00
Greg Ward 612eb9f58f Fixed a grab-bag of typos spotted by Rob Hooft. 2000-07-27 02:13:20 +00:00
Greg Ward aa5372caa7 Remove unused 'search_dir()' method.
Comment tweak.
2000-07-27 01:58:45 +00:00
Greg Ward 7499847c53 Fix to call 'library_filename()' instead of the non-existent
'shared_library_filename()'.
2000-07-27 01:23:19 +00:00
Greg Ward 53c1bc3f9b Typo fix from David Ascher. 2000-07-27 01:21:54 +00:00
Andrew M. Kuchling 23adc9f37b Typo fix from Bastian Kleineidam 2000-07-14 13:35:07 +00:00
Jeremy Hylton 65d6edb478 fix inconsistent use of tabs and spaces 2000-07-07 20:45:21 +00:00
Greg Ward fd9f168bcf Fixed so the ZIP file (which is bundled into an executable) goes in the
temporary directory ('bdist_base').
Added --dist-dir option to control where the executable is put.
2000-07-05 03:08:55 +00:00
Greg Ward c4eb84accb Added --dist-dir option to control where output archive(s) go. 2000-07-05 03:07:37 +00:00
Greg Ward 040dc0b691 Added the --dist-dir option that the "bdist_*" will use to control where
they place their output files.
2000-07-05 03:07:18 +00:00
Greg Ward c0614105aa Added the --dist-dir option to control where the archive(s) are put;
defaults to 'dist' (ie. no longer in the distribution root).
2000-07-05 03:06:46 +00:00
Greg Ward 1b5ec76190 Simplify the registry-module-finding code: _winreg or win32api/win32con.
This'll work fine with 2.0 or 1.5.2, but is less than ideal for
1.6a1/a2.  But the code to accomodate 1.6a1/a2 was released with
Distutils 0.9, so it can go away now.
2000-06-30 19:37:59 +00:00
Greg Ward 0e8c518a62 Bump version to 0.9. 2000-06-30 02:54:36 +00:00
Greg Ward 5d6ae76c09 Allow 2.0 on the list of target versions. NB. this isn't enough: the GUI part,
misc/install.c, still needs to be updated, and it looks like a non-trivial
change.
2000-06-29 23:50:19 +00:00
Greg Ward 22e1bf7da5 Don't try to guess the name of a .def file -- if one is supplied, use it,
otherwise just generate an '/export:' option.
2000-06-29 23:09:20 +00:00
Greg Ward 83c3870e2b On second thought, first try for _winreg, and then winreg. Only if both
fail do we try for win32api/win32con.  If *those* both fail, then we don't
have registry access.  Phew!
2000-06-29 23:04:59 +00:00
Greg Ward cd079c4c28 Changed to use _winreg module instead of winreg. 2000-06-29 22:59:10 +00:00
Greg Ward f34506a3d4 Cleaned up and reformatted by Rene Liebscher.
More reformatting by me.
Also added some editorial comments.
2000-06-29 22:57:55 +00:00
Greg Ward df112a76a9 Fixed so 'get_source_files()' calls 'check_extension_list()' -- that way,
we can run "sdist" on a distribution with old-style extension structures
even if we haven't built it yet.  Bug spotted by Harry Gebel.
2000-06-29 02:16:24 +00:00
Greg Ward 499822d959 Fixed 'findall()' so it only returns regular files -- no directories.
Changed 'prune_file_list()' so it also prunes out RCS and CVS directories.
Added 'is_regex' parameter to 'select_pattern()', 'exclude_pattern()',
  and 'translate_pattern()', so that you don't have to be constrained
  by the simple shell-glob-like pattern language, and can escape into
  full-blown regexes when needed.  Currently this is only available
  in code -- it's not exposed in the manifest template mini-language.
Added 'prune' option (controlled by --prune and --no-prune) to determine
  whether we call 'prune_file_list()' or not -- it's true by default.
Fixed 'negative_opt' -- it was misnamed and not being seen by dist.py.
Added --no-defaults to the option table, so it's seen by FancyGetopt.
2000-06-29 02:06:29 +00:00
Jeremy Hylton a05e293a21 typos fixed by Rob Hooft 2000-06-28 14:48:01 +00:00
Greg Ward cc623a2574 Lyle Johnson: pass in temp directory as 'build_temp' argument when calling
'link_shared_object()'.
2000-06-28 01:29:37 +00:00
Greg Ward bfc79d644a Lyle Johnson: added 'build_temp' parameter to 'link_shared_{lib,object}()'
methods (but not 'link_executable()', hmmm).  Currently only used by
BCPPCompiler; it's a dummy parameter for UnixCCompiler and MSVCCompiler.

Also added 'bcpp' to compiler table used by 'new_compiler()'.
2000-06-28 01:29:09 +00:00
Greg Ward 7d9c705b23 Typo fix. 2000-06-28 01:25:27 +00:00
Greg Ward fe9b818b7d Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Two major points:
  * lots of overlap with MSVCCompiler; the common code really should be
    factored out into a base class, say WindowsCCompiler
  * it doesn't work: weird problem spawning the linker (see comment for
    details)
2000-06-28 01:20:35 +00:00
Greg Ward b0b98a5ee5 Fixed to use 'reinitialize_command()' to fetch "install" and "install_lib"
command objects.
Various formatting tweaks, typo fixes in comments.
2000-06-28 00:56:20 +00:00
Greg Ward edc6a519dc Fixed to use 'reinitialize_command()' to fetch the "install" command object. 2000-06-28 00:36:40 +00:00
Greg Ward b231e1ae18 Oops, only do that AIX hack on AIX. 2000-06-27 01:59:43 +00:00
Greg Ward 4f880280c2 Fixed LDSHARED for AIX, based on a patch by Rene Liebscher.
Ditched my old code that fixed relative paths in the Makefile -- didn't work,
  doomed to failure, etc.
2000-06-27 01:59:06 +00:00
Greg Ward b593793fce A-ha! Read Thomas' patch a little more carefully and figured it out:
the 'implib_dir' attribute is back (only on NT, of course).
2000-06-27 01:43:24 +00:00
Greg Ward f3bd747c4e Thomas Heller: added --swig-cpp option and fixed silly typos in SWIG support.
Also supposedly made some change to where .lib files wind up under MSVC++,
  but I don't understand how to code is doing what Thomas says it's
  doing.
2000-06-27 01:37:10 +00:00
Greg Ward 27199e8029 Thomas Heller's "bdist_wininst" command (unreviewed, untested). 2000-06-27 01:24:38 +00:00
Greg Ward 1f9b73b575 Infrastructure support for the "bdist_wininst" command. 2000-06-27 01:24:07 +00:00
Greg Ward 855dab9987 Added 'include_dirs' parameters all over the place.
Added 'check_lib()', which provides a subset of the functionality of
  'check_func()' with a simpler interface and implementation.
2000-06-27 01:21:22 +00:00
Greg Ward 992c8f9dab Define the 'executables' class attribute so the CCompiler constructor
doesn't blow up.  We don't currently use the 'set_executables()' bureaucracy,
although it would be nice to do so for consistency with UnixCCompiler.
2000-06-25 02:31:16 +00:00
Greg Ward e401e15d18 Removed some debugging code that slipped into the last checkin.
Ensure that 'extra_args' (whether compile or link args) is never None.
2000-06-25 02:30:15 +00:00
Greg Ward f46a688e84 Fixed the "pre-link hook" so it actually works, mainly by renaming it
to 'msvc_prelink_hack()', adding the parameters that it actually needs,
and only calling it for MSVC compiler objects.  Generally gave up on the
idea of a general "hook" mechanism: deleted the empty 'precompile_hook()'.
2000-06-25 02:23:11 +00:00
Greg Ward 68ff615c79 Added PreprocessError and UnknownFileError (both used by CCompiler). 2000-06-25 02:12:14 +00:00
Greg Ward eab969d700 Call 'customize_compiler()' after getting CCompiler object. 2000-06-25 02:10:58 +00:00
Greg Ward 5ca84b83c7 Fixed a few silly bugs in my SWIG support code. (Hey, I said it was
experimental and untested.)
Call 'customize_compiler()' after getting CCompiler object.
2000-06-25 02:10:46 +00:00
Greg Ward bb7baa793d Added the 'customize_compiler()' function, which plugs in the essential
information about building Python extensions that we discovered in
Python's makefile.  Currently only needed on Unix, so does nothing on
other systems.
2000-06-25 02:09:14 +00:00
Greg Ward e5c62bf6e8 Introduced some bureaucracy for setting and tracking the executables
that a particular compiler system depends on.  This consists of the
'set_executables()' and 'set_executable()' methods, and a few lines in
the constructor that expect implementation classes to provide an
'executables' attribute, which we use to initialize several instance
attributes.  The default implementation is somewhat biased in favour of
a Unix/DOS "command-line" view of the world, but it shouldn't be too
hard to override this for operating systems with a more sophisticated
way of representing programs-to-execute.
2000-06-25 02:08:18 +00:00
Greg Ward 73076ff754 Got rid of direct dependence on the sysconfig module. Mainly, this
meant playing along with the new "dictionary of executables" scheme
added to CCompiler by adding the 'executables' class attribute, and
changing all the compile/link/etc. methods to use the new attributes
(which encapsulate both the program to run and its standard arguments,
so it was a *little* bit more than just changing some names).
2000-06-25 02:05:29 +00:00
Greg Ward 6a2a3dbec5 Added 'split_quoted()' function to deal with strings that are quoted in
Unix shell-like syntax (eg. in Python's Makefile, for one thing -- now that
I have this function, I'll probably allow quoted strings in config files too.
2000-06-24 20:40:02 +00:00
Greg Ward c3a43b4f9b Docstring reformatting/tweaking binge.
Fixed a few comments.
2000-06-24 18:10:48 +00:00
Greg Ward c3f364462f Print a warning if we install a data file right in install_dir.
Tweaked help text.
2000-06-24 17:36:24 +00:00
Greg Ward fa2f4b6d8e Changed the default installation directory for data files (used by
the "install_data" command to the installation base, which is usually just
sys.prefix.  (Any setup scripts out there that specify data files will have
to set the installation directory, relative to the base, explicitly.)
2000-06-24 17:22:39 +00:00
Greg Ward 9aa668b03a Changed 'object_filenames()' to raise exception instead of silently carrying
on if it sees a filename with unknown extension.
2000-06-24 02:22:49 +00:00
Greg Ward 3459381e2a Changed so all the help-generating functions are defined, at module-level,
in the module of the command classes that have command-specific
help options.  This lets us keep the principle of lazily importing
the ccompiler module, and also gets away from defining non-methods
at class level.
2000-06-24 01:23:37 +00:00
Greg Ward 55fced3df9 More stylistic tweaks to the generic '--help-xxx' code. 2000-06-24 01:22:41 +00:00
Greg Ward 2ff7887270 Stylistic/formatting changes to Rene Liebscher's '--help-xxx' patch. 2000-06-24 00:23:20 +00:00
Greg Ward ffcaf2dd72 Experimental, completely untested SWIG support. 2000-06-24 00:19:35 +00:00
Greg Ward cb18557de2 Revised docstring so 'sources' isn't necessarily all C/C++ files (to
accomodate SWIG interface files, resource files, etc.).
2000-06-24 00:18:24 +00:00
Greg Ward a392dcb211 Bastian Kleineidam: 'copy_file()' now returns the output filename, rather
than a boolean indicating whether it did the copy.
2000-06-23 01:42:40 +00:00
Greg Ward 7c6395a6a3 Implementation of the CCompiler class for Cygwin and Mingw32, ie. the two
major ports of GCC to Windows.  Contributed by Rene Liebscher, and quite
untested by me.  Apparently requires tweaking Python's installed config.h
and adding a libpython.a to build extensions.
2000-06-21 03:33:03 +00:00
Greg Ward b2db0eb695 Fix inspired by Rene Liebscher: if setup script is newer than the
manifest, regenerate the manifest.
2000-06-21 03:29:57 +00:00
Greg Ward f6451c46d7 Delete spurious comment. 2000-06-21 03:14:27 +00:00
Greg Ward afc224beec Build the 'outfiles' list so 'get_outputs()' has something to return.
(Bug spotted and originally fixed by Rene Liebscher; fix redone by me.)
2000-06-21 03:13:51 +00:00
Greg Ward e2383a6c77 Rene Liebscher: when fixing up directories with an alternate root, include
'install_headers'.
2000-06-21 03:09:02 +00:00
Greg Ward 59ac7091a7 Fleshed out and added a bunch of useful stuff, notably 'check_func()',
'try_cpp()', 'search_cpp()', and 'check_header()'.  This is enough that
the base config is actually useful for implementing a real config
command, specifically one for mxDateTime.
2000-06-21 03:00:50 +00:00
Greg Ward 71257c73f8 Oops, import 'grok_environment_error()'. 2000-06-21 02:59:14 +00:00
Greg Ward 3ff3b039ac Added 'preprocess()' method to CCompiler interface, and implemented
it in UnixCCompiler.  Still needs to be implemented in MSVCCompiler (and
whatever other compiler classes are lurking out there, waiting to be
checked in).
2000-06-21 02:58:46 +00:00
Greg Ward b75c485f0b 'get_platform()' now just returns 'sys.platform' on all platforms. 2000-06-18 15:45:55 +00:00
Greg Ward b081e180ac Pulled the MSVC++-specific hackery out to a new method, 'prelink_hook()',
and added (empty) 'precompile_hook()' for symmetry.  One can envision
a much more elaborate hook mechanism, but this looks like it'll do for
now.
2000-06-17 23:04:31 +00:00
Greg Ward b248b7f848 Renamed PATH_CREATED to _path_created, on the grounds that it's private and
mutable, rather than public and constant.
2000-06-17 02:19:30 +00:00
Greg Ward fcd4f87397 Changed 'remove_tree()' to use the new 'grok_environment_error()' function
instead of muddling through IOError and OSError exception objects itself.
2000-06-17 02:18:19 +00:00
Greg Ward cf0e2dde6d Changed to use the new 'grok_environment_error()' function instead of
muddling through IOError and OSError exception objects right here.
2000-06-17 02:17:45 +00:00
Greg Ward e905513be0 Added 'grok_environment_error()' function to deal with the various
forms that IOError and OSError can take (taken from core.py).
2000-06-17 02:16:46 +00:00
Greg Ward 039accfb2c Bastian Kleineidam: added 'remove_tree()' function. Needed so that
'remove_tree()' can cooperate with 'mkpath()' in the maintenance of
the PATH_CREATED cache: specifically, if a directory is created
with 'mkpath()', later removed with 'remove_tree()', and 'mkpath()'
is again requested to create it, then it would erroneously think
the directory already existed, because it was in the PATH_CREATED
cache.  The patch (slightly tweaked by me) fixes that.
2000-06-17 01:58:14 +00:00
Greg Ward c566232c4d Fixed install directory for header files on Unix. 2000-06-17 01:34:45 +00:00
Greg Ward d2412a35b1 Harry Henry Gebel: fix '_format_changelog()' so it doesn't bomb if
passed None.
2000-06-08 14:21:23 +00:00
Greg Ward 14c8d05a7a Include setup.cfg in the list of default files to distribute. 2000-06-08 01:22:48 +00:00
Greg Ward ce15c6ce8d Moved the code that prunes the file list after reading the manifest
template into a new method 'prune_file_list()', called from
  'get_file_list()' rather than 'read_manifest()' -- this keeps
  'read_manifest()' more general.
Deleted the redundant call to 'exclude_pattern()' in 'make_distribution()'
  -- this had the same intention as 'prune_file_list()', but was incomplete
  (only pruned the release tree, not the build tree) and in the wrong
  place (the prune wouldn't be reflected in the manifest file).
2000-06-08 01:06:02 +00:00
Greg Ward 4a7319ca28 Renamed 'find_defaults()' to 'add_defaults()'.
Deleted old, commented-out 'exclude_pattern()' method.
2000-06-08 00:52:52 +00:00
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