the command's sub-commands as well (off by default). This is essential if
we want to be be able to run (eg.) "install" twice in one run, as happens
when generating multiple built distributions in one run.
families" -- eg. install and its brood, build and its brood, and so forth.
Specifically: added the 'sub_commands' class attribute (empty list, sub-
classes must override it) and a comment describing it, and the
'get_sub_commands()' method.
of globals from sysconfig.
Added 'prefix' and 'exec_prefix' to the list of variables that can be
expanded in installation directories (preserving the stupid old names
of 'sys_prefix' and 'sys_exec_prefix, though).
all that work when someone asks for a "configuration variable" from the
Makefile. Details:
- added 'get_config_vars()': responsible for calling one of the
'_init_*()' functions to figure things out for this platform,
and to provide an interface to the resulting dictionary
- added 'get_config_var()' as a simple interface to the dictionary
loaded by 'get_config_vars()'
- changed the '_init_*()' functions so they load the global dictionary
'_config_vars', rather than spewing their findings all over
the module namespace
- don't delete the '_init_*()' functions when done importing
- adjusted 'customize_compiler()' to the new regime
used to create the distribution and the creation date.
Takes care of the extra_path argument to the setup function,
installs the modules into <prefix>/extra_path and creates
a -pth file (like install_lib does).
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
* 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)
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.
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.
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]'.
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.
* 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
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!).
- 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
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
- '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
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.)
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.
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.
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.
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()'.
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)
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()'.
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.
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).
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.
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.)
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.
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.