/home/lnzliplg/public_html/share.tar
man/man1/python2.7.1 0000644 00000034366 15173017717 0010032 0 ustar 00 .TH PYTHON "1"
.\" To view this file while editing, run it through groff:
.\" groff -Tascii -man python.man | less
.SH NAME
python \- an interpreted, interactive, object-oriented programming language
.SH SYNOPSIS
.B python
[
.B \-B
]
[
.B \-d
]
[
.B \-E
]
[
.B \-h
]
[
.B \-i
]
[
.B \-m
.I module-name
]
.br
[
.B \-O
]
[
.B \-OO
]
[
.B \-R
]
[
.B -Q
.I argument
]
[
.B \-s
]
[
.B \-S
]
[
.B \-t
]
[
.B \-u
]
.br
[
.B \-v
]
[
.B \-V
]
[
.B \-W
.I argument
]
[
.B \-x
]
[
.B \-3
]
[
.B \-?
]
.br
[
.B \-c
.I command
|
.I script
|
\-
]
[
.I arguments
]
.SH DESCRIPTION
Python is an interpreted, interactive, object-oriented programming
language that combines remarkable power with very clear syntax.
For an introduction to programming in Python, see the Python Tutorial.
The Python Library Reference documents built-in and standard types,
constants, functions and modules.
Finally, the Python Reference Manual describes the syntax and
semantics of the core language in (perhaps too) much detail.
(These documents may be located via the
.B "INTERNET RESOURCES"
below; they may be installed on your system as well.)
.PP
Python's basic power can be extended with your own modules written in
C or C++.
On most systems such modules may be dynamically loaded.
Python is also adaptable as an extension language for existing
applications.
See the internal documentation for hints.
.PP
Documentation for installed Python modules and packages can be
viewed by running the
.B pydoc
program.
.SH COMMAND LINE OPTIONS
.TP
.B \-B
Don't write
.I .py[co]
files on import. See also PYTHONDONTWRITEBYTECODE.
.TP
.BI "\-c " command
Specify the command to execute (see next section).
This terminates the option list (following options are passed as
arguments to the command).
.TP
.B \-d
Turn on parser debugging output (for wizards only, depending on
compilation options).
.TP
.B \-E
Ignore environment variables like PYTHONPATH and PYTHONHOME that modify
the behavior of the interpreter.
.TP
.B \-h ", " \-? ", "\-\-help
Prints the usage for the interpreter executable and exits.
.TP
.B \-i
When a script is passed as first argument or the \fB\-c\fP option is
used, enter interactive mode after executing the script or the
command. It does not read the $PYTHONSTARTUP file. This can be
useful to inspect global variables or a stack trace when a script
raises an exception.
.TP
.BI "\-m " module-name
Searches
.I sys.path
for the named module and runs the corresponding
.I .py
file as a script.
.TP
.B \-O
Turn on basic optimizations. This changes the filename extension for
compiled (bytecode) files from
.I .pyc
to \fI.pyo\fP. Given twice, causes docstrings to be discarded.
.TP
.B \-OO
Discard docstrings in addition to the \fB-O\fP optimizations.
.TP
.B \-R
Turn on "hash randomization", so that the hash() values of str, bytes and
datetime objects are "salted" with an unpredictable pseudo-random value.
Although they remain constant within an individual Python process, they are
not predictable between repeated invocations of Python.
.IP
This is intended to provide protection against a denial of service
caused by carefully-chosen inputs that exploit the worst case performance
of a dict construction, O(n^2) complexity. See
http://www.ocert.org/advisories/ocert-2011-003.html
for details.
.TP
.BI "\-Q " argument
Division control; see PEP 238. The argument must be one of "old" (the
default, int/int and long/long return an int or long), "new" (new
division semantics, i.e. int/int and long/long returns a float),
"warn" (old division semantics with a warning for int/int and
long/long), or "warnall" (old division semantics with a warning for
all use of the division operator). For a use of "warnall", see the
Tools/scripts/fixdiv.py script.
.TP
.B \-s
Don't add user site directory to sys.path.
.TP
.B \-S
Disable the import of the module
.I site
and the site-dependent manipulations of
.I sys.path
that it entails.
.TP
.B \-t
Issue a warning when a source file mixes tabs and spaces for
indentation in a way that makes it depend on the worth of a tab
expressed in spaces. Issue an error when the option is given twice.
.TP
.B \-u
Force stdin, stdout and stderr to be totally unbuffered. On systems
where it matters, also put stdin, stdout and stderr in binary mode.
Note that there is internal buffering in xreadlines(), readlines() and
file-object iterators ("for line in sys.stdin") which is not
influenced by this option. To work around this, you will want to use
"sys.stdin.readline()" inside a "while 1:" loop.
.TP
.B \-v
Print a message each time a module is initialized, showing the place
(filename or built-in module) from which it is loaded. When given
twice, print a message for each file that is checked for when
searching for a module. Also provides information on module cleanup
at exit.
.TP
.B \-V ", " \-\-version
Prints the Python version number of the executable and exits.
.TP
.BI "\-W " argument
Warning control. Python sometimes prints warning message to
.IR sys.stderr .
A typical warning message has the following form:
.IB file ":" line ": " category ": " message.
By default, each warning is printed once for each source line where it
occurs. This option controls how often warnings are printed.
Multiple
.B \-W
options may be given; when a warning matches more than one
option, the action for the last matching option is performed.
Invalid
.B \-W
options are ignored (a warning message is printed about invalid
options when the first warning is issued). Warnings can also be
controlled from within a Python program using the
.I warnings
module.
The simplest form of
.I argument
is one of the following
.I action
strings (or a unique abbreviation):
.B ignore
to ignore all warnings;
.B default
to explicitly request the default behavior (printing each warning once
per source line);
.B all
to print a warning each time it occurs (this may generate many
messages if a warning is triggered repeatedly for the same source
line, such as inside a loop);
.B module
to print each warning only the first time it occurs in each
module;
.B once
to print each warning only the first time it occurs in the program; or
.B error
to raise an exception instead of printing a warning message.
The full form of
.I argument
is
.IB action : message : category : module : line.
Here,
.I action
is as explained above but only applies to messages that match the
remaining fields. Empty fields match all values; trailing empty
fields may be omitted. The
.I message
field matches the start of the warning message printed; this match is
case-insensitive. The
.I category
field matches the warning category. This must be a class name; the
match test whether the actual warning category of the message is a
subclass of the specified warning category. The full class name must
be given. The
.I module
field matches the (fully-qualified) module name; this match is
case-sensitive. The
.I line
field matches the line number, where zero matches all line numbers and
is thus equivalent to an omitted line number.
.TP
.B \-x
Skip the first line of the source. This is intended for a DOS
specific hack only. Warning: the line numbers in error messages will
be off by one!
.TP
.B \-3
Warn about Python 3.x incompatibilities that 2to3 cannot trivially fix.
.SH INTERPRETER INTERFACE
The interpreter interface resembles that of the UNIX shell: when
called with standard input connected to a tty device, it prompts for
commands and executes them until an EOF is read; when called with a
file name argument or with a file as standard input, it reads and
executes a
.I script
from that file;
when called with
.B \-c
.IR command ,
it executes the Python statement(s) given as
.IR command .
Here
.I command
may contain multiple statements separated by newlines.
Leading whitespace is significant in Python statements!
In non-interactive mode, the entire input is parsed before it is
executed.
.PP
If available, the script name and additional arguments thereafter are
passed to the script in the Python variable
.IR sys.argv ,
which is a list of strings (you must first
.I import sys
to be able to access it).
If no script name is given,
.I sys.argv[0]
is an empty string; if
.B \-c
is used,
.I sys.argv[0]
contains the string
.I '-c'.
Note that options interpreted by the Python interpreter itself
are not placed in
.IR sys.argv .
.PP
In interactive mode, the primary prompt is `>>>'; the second prompt
(which appears when a command is not complete) is `...'.
The prompts can be changed by assignment to
.I sys.ps1
or
.IR sys.ps2 .
The interpreter quits when it reads an EOF at a prompt.
When an unhandled exception occurs, a stack trace is printed and
control returns to the primary prompt; in non-interactive mode, the
interpreter exits after printing the stack trace.
The interrupt signal raises the
.I Keyboard\%Interrupt
exception; other UNIX signals are not caught (except that SIGPIPE is
sometimes ignored, in favor of the
.I IOError
exception). Error messages are written to stderr.
.SH FILES AND DIRECTORIES
These are subject to difference depending on local installation
conventions; ${prefix} and ${exec_prefix} are installation-dependent
and should be interpreted as for GNU software; they may be the same.
The default for both is \fI/usr/local\fP.
.IP \fI${exec_prefix}/bin/python\fP
Recommended location of the interpreter.
.PP
.I ${prefix}/lib/python<version>
.br
.I ${exec_prefix}/lib/python<version>
.RS
Recommended locations of the directories containing the standard
modules.
.RE
.PP
.I ${prefix}/include/python<version>
.br
.I ${exec_prefix}/include/python<version>
.RS
Recommended locations of the directories containing the include files
needed for developing Python extensions and embedding the
interpreter.
.RE
.IP \fI~/.pythonrc.py\fP
User-specific initialization file loaded by the \fIuser\fP module;
not used by default or by most applications.
.SH ENVIRONMENT VARIABLES
.IP PYTHONHOME
Change the location of the standard Python libraries. By default, the
libraries are searched in ${prefix}/lib/python<version> and
${exec_prefix}/lib/python<version>, where ${prefix} and ${exec_prefix}
are installation-dependent directories, both defaulting to
\fI/usr/local\fP. When $PYTHONHOME is set to a single directory, its value
replaces both ${prefix} and ${exec_prefix}. To specify different values
for these, set $PYTHONHOME to ${prefix}:${exec_prefix}.
.IP PYTHONPATH
Augments the default search path for module files.
The format is the same as the shell's $PATH: one or more directory
pathnames separated by colons.
Non-existent directories are silently ignored.
The default search path is installation dependent, but generally
begins with ${prefix}/lib/python<version> (see PYTHONHOME above).
The default search path is always appended to $PYTHONPATH.
If a script argument is given, the directory containing the script is
inserted in the path in front of $PYTHONPATH.
The search path can be manipulated from within a Python program as the
variable
.IR sys.path .
.IP PYTHONSTARTUP
If this is the name of a readable file, the Python commands in that
file are executed before the first prompt is displayed in interactive
mode.
The file is executed in the same name space where interactive commands
are executed so that objects defined or imported in it can be used
without qualification in the interactive session.
You can also change the prompts
.I sys.ps1
and
.I sys.ps2
in this file.
.IP PYTHONY2K
Set this to a non-empty string to cause the \fItime\fP module to
require dates specified as strings to include 4-digit years, otherwise
2-digit years are converted based on rules described in the \fItime\fP
module documentation.
.IP PYTHONOPTIMIZE
If this is set to a non-empty string it is equivalent to specifying
the \fB\-O\fP option. If set to an integer, it is equivalent to
specifying \fB\-O\fP multiple times.
.IP PYTHONDEBUG
If this is set to a non-empty string it is equivalent to specifying
the \fB\-d\fP option. If set to an integer, it is equivalent to
specifying \fB\-d\fP multiple times.
.IP PYTHONDONTWRITEBYTECODE
If this is set to a non-empty string it is equivalent to specifying
the \fB\-B\fP option (don't try to write
.I .py[co]
files).
.IP PYTHONINSPECT
If this is set to a non-empty string it is equivalent to specifying
the \fB\-i\fP option.
.IP PYTHONIOENCODING
If this is set before running the interpreter, it overrides the encoding used
for stdin/stdout/stderr, in the syntax
.IB encodingname ":" errorhandler
The
.IB errorhandler
part is optional and has the same meaning as in str.encode. For stderr, the
.IB errorhandler
part is ignored; the handler will always be \'backslashreplace\'.
.IP PYTHONNOUSERSITE
If this is set to a non-empty string it is equivalent to specifying the
\fB\-s\fP option (Don't add the user site directory to sys.path).
.IP PYTHONUNBUFFERED
If this is set to a non-empty string it is equivalent to specifying
the \fB\-u\fP option.
.IP PYTHONVERBOSE
If this is set to a non-empty string it is equivalent to specifying
the \fB\-v\fP option. If set to an integer, it is equivalent to
specifying \fB\-v\fP multiple times.
.IP PYTHONWARNINGS
If this is set to a comma-separated string it is equivalent to
specifying the \fB\-W\fP option for each separate value.
.IP PYTHONHASHSEED
If this variable is set to "random", the effect is the same as specifying
the \fB-R\fP option: a random value is used to seed the hashes of str,
bytes and datetime objects.
If PYTHONHASHSEED is set to an integer value, it is used as a fixed seed for
generating the hash() of the types covered by the hash randomization. Its
purpose is to allow repeatable hashing, such as for selftests for the
interpreter itself, or to allow a cluster of python processes to share hash
values.
The integer must be a decimal number in the range [0,4294967295]. Specifying
the value 0 will lead to the same hash values as when hash randomization is
disabled.
.SH AUTHOR
The Python Software Foundation: https://www.python.org/psf/
.SH INTERNET RESOURCES
Main website: https://www.python.org/
.br
Documentation: https://docs.python.org/2/
.br
Developer resources: https://docs.python.org/devguide/
.br
Downloads: https://www.python.org/downloads/
.br
Module repository: https://pypi.python.org/
.br
Newsgroups: comp.lang.python, comp.lang.python.announce
.SH LICENSING
Python is distributed under an Open Source license. See the file
"LICENSE" in the Python source distribution for information on terms &
conditions for accessing and otherwise using Python and for a
DISCLAIMER OF ALL WARRANTIES.
doc/alt-python27-contextlib2/LICENSE.txt 0000644 00000013646 15173017717 0013662 0 ustar 00
A. HISTORY OF THE SOFTWARE
==========================
contextlib2 is a derivative of the contextlib module distributed by the PSF
as part of the Python standard library. According, it is itself redistributed
under the PSF license (reproduced in full below). As the contextlib module
was added only in Python 2.5, the licenses for earlier Python versions are
not applicable and have not been included.
Python was created in the early 1990s by Guido van Rossum at Stichting
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
as a successor of a language called ABC. Guido remains Python's
principal author, although it includes many contributions from others.
In 1995, Guido continued his work on Python at the Corporation for
National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
in Reston, Virginia where he released several versions of the
software.
In May 2000, Guido and the Python core development team moved to
BeOpen.com to form the BeOpen PythonLabs team. In October of the same
year, the PythonLabs team moved to Digital Creations (now Zope
Corporation, see http://www.zope.com). In 2001, the Python Software
Foundation (PSF, see http://www.python.org/psf/) was formed, a
non-profit organization created specifically to own Python-related
Intellectual Property. Zope Corporation is a sponsoring member of
the PSF.
All Python releases are Open Source (see http://www.opensource.org for
the Open Source Definition). Historically, most, but not all, Python
releases have also been GPL-compatible; the table below summarizes
the various releases that included the contextlib module.
Release Derived Year Owner GPL-
from compatible? (1)
2.5 2.4 2006 PSF yes
2.5.1 2.5 2007 PSF yes
2.5.2 2.5.1 2008 PSF yes
2.5.3 2.5.2 2008 PSF yes
2.6 2.5 2008 PSF yes
2.6.1 2.6 2008 PSF yes
2.6.2 2.6.1 2009 PSF yes
2.6.3 2.6.2 2009 PSF yes
2.6.4 2.6.3 2009 PSF yes
2.6.5 2.6.4 2010 PSF yes
3.0 2.6 2008 PSF yes
3.0.1 3.0 2009 PSF yes
3.1 3.0.1 2009 PSF yes
3.1.1 3.1 2009 PSF yes
3.1.2 3.1.1 2010 PSF yes
3.1.3 3.1.2 2010 PSF yes
3.1.4 3.1.3 2011 PSF yes
3.2 3.1 2011 PSF yes
3.2.1 3.2 2011 PSF yes
3.2.2 3.2.1 2011 PSF yes
3.3 3.2 2012 PSF yes
Footnotes:
(1) GPL-compatible doesn't mean that we're distributing Python under
the GPL. All Python licenses, unlike the GPL, let you distribute
a modified version without making your changes open source. The
GPL-compatible licenses make it possible to combine Python with
other software that is released under the GPL; the others don't.
Thanks to the many outside volunteers who have worked under Guido's
direction to make these releases possible.
B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
===============================================================
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.
2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011 Python Software Foundation; All Rights Reserved" are retained in Python
alone or in any derivative version prepared by Licensee.
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.
4. PSF is making Python available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.
8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
doc/alt-python27-contextlib2/NEWS.rst 0000644 00000007425 15173017720 0013335 0 ustar 00 Release History
---------------
0.5.4 (2016-07-31)
^^^^^^^^^^^^^^^^^^
* Thanks to the welcome efforts of Jannis Leidel, contextlib2 is now a
[Jazzband](https://jazzband.co/) project! This means that I (Nick Coghlan)
am no longer a single point of failure for backports of future contextlib
updates to earlier Python versions.
* Issue `#7 <https://github.com/jazzband/contextlib2/issues/7>`__: Backported
fix for CPython issue `#27122 <http://bugs.python.org/issue27122>`__,
preventing a potential infinite loop on Python 3.5 when handling
``RuntimeError`` (CPython updates by Gregory P. Smith & Serhiy Storchaka)
0.5.3 (2016-05-02)
^^^^^^^^^^^^^^^^^^
* ``ExitStack`` now correctly handles context managers implemented as old-style
classes in Python 2.x (such as ``codecs.StreamReader`` and
``codecs.StreamWriter``)
* ``setup.py`` has been migrated to setuptools and configured to emit a
universal wheel file by default
0.5.2 (2016-05-02)
^^^^^^^^^^^^^^^^^^
* development migrated from BitBucket to GitHub
* ``redirect_stream``, ``redirect_stdout``, ``redirect_stderr`` and ``suppress``
now explicitly inherit from ``object``, ensuring compatibility with
``ExitStack`` when run under Python 2.x (patch contributed by Devin
Jeanpierre).
* ``MANIFEST.in`` is now included in the published sdist, ensuring the archive
can be precisely recreated even without access to the original source repo
(patch contributed by Guy Rozendorn)
0.5.1 (2016-01-13)
^^^^^^^^^^^^^^^^^^
* Python 2.6 compatilibity restored (patch contributed by Armin Ronacher)
* README converted back to reStructured Text formatting
0.5.0 (2016-01-12)
^^^^^^^^^^^^^^^^^^
* Updated to include all features from the Python 3.4 and 3.5 releases of
contextlib (also includes some ``ExitStack`` enhancements made following
the integration into the standard library for Python 3.3)
* The legacy ``ContextStack`` and ``ContextDecorator.refresh_cm`` APIs are
no longer documented and emit ``DeprecationWarning`` when used
* Python 2.6, 3.2 and 3.3 have been dropped from compatibility testing
* tox is now supported for local version compatibility testing (patch by
Marc Abramowitz)
0.4.0 (2012-05-05)
^^^^^^^^^^^^^^^^^^
* (BitBucket) Issue #8: Replace ContextStack with ExitStack (old ContextStack
API retained for backwards compatibility)
* Fall back to unittest2 if unittest is missing required functionality
0.3.1 (2012-01-17)
^^^^^^^^^^^^^^^^^^
* (BitBucket) Issue #7: Add MANIFEST.in so PyPI package contains all relevant
files (patch contributed by Doug Latornell)
0.3 (2012-01-04)
^^^^^^^^^^^^^^^^
* (BitBucket) Issue #5: ContextStack.register no longer pointlessly returns the
wrapped function
* (BitBucket) Issue #2: Add examples and recipes section to docs
* (BitBucket) Issue #3: ContextStack.register_exit() now accepts objects with
__exit__ attributes in addition to accepting exit callbacks directly
* (BitBucket) Issue #1: Add ContextStack.preserve() to move all registered
callbacks to a new ContextStack object
* Wrapped callbacks now expose __wrapped__ (for direct callbacks) or __self__
(for context manager methods) attributes to aid in introspection
* Moved version number to a VERSION.txt file (read by both docs and setup.py)
* Added NEWS.rst (and incorporated into documentation)
0.2 (2011-12-15)
^^^^^^^^^^^^^^^^
* Renamed CleanupManager to ContextStack (hopefully before anyone started
using the module for anything, since I didn't alias the old name at all)
0.1 (2011-12-13)
^^^^^^^^^^^^^^^^
* Initial release as a backport module
* Added CleanupManager (based on a `Python feature request`_)
* Added ContextDecorator.refresh_cm() (based on a `Python tracker issue`_)
.. _Python feature request: http://bugs.python.org/issue13585
.. _Python tracker issue: http://bugs.python.org/issue11647
doc/alt-python27-contextlib2/README.rst 0000644 00000003372 15173017721 0013514 0 ustar 00 .. image:: https://jazzband.co/static/img/badge.svg
:target: https://jazzband.co/
:alt: Jazzband
.. image:: https://readthedocs.org/projects/contextlib2/badge/?version=latest
:target: https://contextlib2.readthedocs.org/
:alt: Latest Docs
.. image:: https://img.shields.io/travis/jazzband/contextlib2/master.svg
:target: http://travis-ci.org/jazzband/contextlib2
.. image:: https://coveralls.io/repos/github/jazzband/contextlib2/badge.svg?branch=master
:target: https://coveralls.io/github/jazzband/contextlib2?branch=master
.. image:: https://landscape.io/github/jazzband/contextlib2/master/landscape.svg
:target: https://landscape.io/github/jazzband/contextlib2/
contextlib2 is a backport of the `standard library's contextlib
module <https://docs.python.org/3.5/library/contextlib.html>`_ to
earlier Python versions.
It also serves as a real world proving ground for possible future
enhancements to the standard library version.
Development
-----------
contextlib2 has no runtime dependencies, but requires ``unittest2`` for testing
on Python 2.x.
Local testing is just a matter of running ``python test_contextlib2.py``.
You can test against multiple versions of Python with
`tox <https://tox.testrun.org/>`_::
pip install tox
tox
Versions currently tested in both tox and Travis CI are:
* CPython 2.6
* CPython 2.7
* CPython 3.4
* CPython 3.5
* CPython 3.6 (CPython development branch)
* PyPy
tox also has a PyPy3 configuration, but it is not configured in Travis
due to a
`known incompatibility <https://bitbucket.org/pypy/pypy/issues/1903>`_.
To install several of the relevant runtimes on Fedora 23::
sudo dnf install python python3 pypy pypy3
sudo dnf copr enable -y mstuchli/Python3.5
sudo dnf install python35-python3
doc/alt-python27-contextlib2/VERSION.txt 0000644 00000000006 15173017721 0013702 0 ustar 00 0.5.4
doc/alt-python27-setuptools/asl.txt 0000644 00000026136 15173017722 0013335 0 ustar 00
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
doc/alt-python27-setuptools/requirements.txt 0000644 00000000075 15173017723 0015274 0 ustar 00 sphinx
rst.linker>=1.9
jaraco.packaging>=3.2
setuptools>=34
doc/alt-python27-setuptools/developer-guide.txt 0000644 00000010026 15173017724 0015627 0 ustar 00 ================================
Developer's Guide for Setuptools
================================
If you want to know more about contributing on Setuptools, this is the place.
.. contents:: **Table of Contents**
-------------------
Recommended Reading
-------------------
Please read `How to write the perfect pull request
<https://blog.jaraco.com/how-to-write-perfect-pull-request/>`_ for some tips
on contributing to open source projects. Although the article is not
authoritative, it was authored by the maintainer of Setuptools, so reflects
his opinions and will improve the likelihood of acceptance and quality of
contribution.
------------------
Project Management
------------------
Setuptools is maintained primarily in Github at `this home
<https://github.com/pypa/setuptools>`_. Setuptools is maintained under the
Python Packaging Authority (PyPA) with several core contributors. All bugs
for Setuptools are filed and the canonical source is maintained in Github.
User support and discussions are done through the issue tracker (for specific)
issues, through the distutils-sig mailing list, or on IRC (Freenode) at
#pypa.
Discussions about development happen on the pypa-dev mailing list or on
`Gitter <https://gitter.im/pypa/setuptools>`_.
-----------------
Authoring Tickets
-----------------
Before authoring any source code, it's often prudent to file a ticket
describing the motivation behind making changes. First search to see if a
ticket already exists for your issue. If not, create one. Try to think from
the perspective of the reader. Explain what behavior you expected, what you
got instead, and what factors might have contributed to the unexpected
behavior. In Github, surround a block of code or traceback with the triple
backtick "\`\`\`" so that it is formatted nicely.
Filing a ticket provides a forum for justification, discussion, and
clarification. The ticket provides a record of the purpose for the change and
any hard decisions that were made. It provides a single place for others to
reference when trying to understand why the software operates the way it does
or why certain changes were made.
Setuptools makes extensive use of hyperlinks to tickets in the changelog so
that system integrators and other users can get a quick summary, but then
jump to the in-depth discussion about any subject referenced.
-----------
Source Code
-----------
Grab the code at Github::
$ git checkout https://github.com/pypa/setuptools
If you want to contribute changes, we recommend you fork the repository on
Github, commit the changes to your repository, and then make a pull request
on Github. If you make some changes, don't forget to:
- add a note in CHANGES.rst
Please commit all changes in the 'master' branch against the latest available
commit or for bug-fixes, against an earlier commit or release in which the
bug occurred.
If you find yourself working on more than one issue at a time, Setuptools
generally prefers Git-style branches, so use Mercurial bookmarks or Git
branches or multiple forks to maintain separate efforts.
The Continuous Integration tests that validate every release are run
from this repository.
For posterity, the old `Bitbucket mirror
<https://bitbucket.org/pypa/setuptools>`_ is available.
-------
Testing
-------
The primary tests are run using tox. To run the tests, first make
sure you have tox installed, then invoke it::
$ tox
Under continuous integration, additional tests may be run. See the
``.travis.yml`` file for full details on the tests run under Travis-CI.
-------------------
Semantic Versioning
-------------------
Setuptools follows ``semver``.
.. explain value of reflecting meaning in versions.
----------------------
Building Documentation
----------------------
Setuptools relies on the Sphinx system for building documentation.
To accommodate RTD, docs must be built from the docs/ directory.
To build them, you need to have installed the requirements specified
in docs/requirements.txt. One way to do this is to use rwt:
setuptools/docs$ python -m rwt -r requirements.txt -- -m sphinx . html
doc/alt-python27-setuptools/zpl.txt 0000644 00000004026 15173017724 0013357 0 ustar 00 Zope Public License (ZPL) Version 2.1
A copyright notice accompanies this license document that identifies the
copyright holders.
This license has been certified as open source. It has also been designated as
GPL compatible by the Free Software Foundation (FSF).
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions in source code must retain the accompanying copyright
notice, this list of conditions, and the following disclaimer.
2. Redistributions in binary form must reproduce the accompanying copyright
notice, this list of conditions, and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Names of the copyright holders must not be used to endorse or promote
products derived from this software without prior written permission from the
copyright holders.
4. The right to distribute this software or to use it for any purpose does not
give you the right to use Servicemarks (sm) or Trademarks (tm) of the
copyright
holders. Use of them is covered by separate agreement with the copyright
holders.
5. If any files are modified, you must cause the modified files to carry
prominent notices stating that you changed the files and the date of any
change.
Disclaimer
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
doc/alt-python27-setuptools/pkg_resources.txt 0000644 00000270267 15173017725 0015442 0 ustar 00 =============================================================
Package Discovery and Resource Access using ``pkg_resources``
=============================================================
The ``pkg_resources`` module distributed with ``setuptools`` provides an API
for Python libraries to access their resource files, and for extensible
applications and frameworks to automatically discover plugins. It also
provides runtime support for using C extensions that are inside zipfile-format
eggs, support for merging packages that have separately-distributed modules or
subpackages, and APIs for managing Python's current "working set" of active
packages.
.. contents:: **Table of Contents**
--------
Overview
--------
The ``pkg_resources`` module provides runtime facilities for finding,
introspecting, activating and using installed Python distributions. Some
of the more advanced features (notably the support for parallel installation
of multiple versions) rely specifically on the "egg" format (either as a
zip archive or subdirectory), while others (such as plugin discovery) will
work correctly so long as "egg-info" metadata directories are available for
relevant distributions.
Eggs are a distribution format for Python modules, similar in concept to
Java's "jars" or Ruby's "gems", or the "wheel" format defined in PEP 427.
However, unlike a pure distribution format, eggs can also be installed and
added directly to ``sys.path`` as an import location. When installed in
this way, eggs are *discoverable*, meaning that they carry metadata that
unambiguously identifies their contents and dependencies. This means that
an installed egg can be *automatically* found and added to ``sys.path`` in
response to simple requests of the form, "get me everything I need to use
docutils' PDF support". This feature allows mutually conflicting versions of
a distribution to co-exist in the same Python installation, with individual
applications activating the desired version at runtime by manipulating the
contents of ``sys.path`` (this differs from the virtual environment
approach, which involves creating isolated environments for each
application).
The following terms are needed in order to explain the capabilities offered
by this module:
project
A library, framework, script, plugin, application, or collection of data
or other resources, or some combination thereof. Projects are assumed to
have "relatively unique" names, e.g. names registered with PyPI.
release
A snapshot of a project at a particular point in time, denoted by a version
identifier.
distribution
A file or files that represent a particular release.
importable distribution
A file or directory that, if placed on ``sys.path``, allows Python to
import any modules contained within it.
pluggable distribution
An importable distribution whose filename unambiguously identifies its
release (i.e. project and version), and whose contents unambiguously
specify what releases of other projects will satisfy its runtime
requirements.
extra
An "extra" is an optional feature of a release, that may impose additional
runtime requirements. For example, if docutils PDF support required a
PDF support library to be present, docutils could define its PDF support as
an "extra", and list what other project releases need to be available in
order to provide it.
environment
A collection of distributions potentially available for importing, but not
necessarily active. More than one distribution (i.e. release version) for
a given project may be present in an environment.
working set
A collection of distributions actually available for importing, as on
``sys.path``. At most one distribution (release version) of a given
project may be present in a working set, as otherwise there would be
ambiguity as to what to import.
eggs
Eggs are pluggable distributions in one of the three formats currently
supported by ``pkg_resources``. There are built eggs, development eggs,
and egg links. Built eggs are directories or zipfiles whose name ends
with ``.egg`` and follows the egg naming conventions, and contain an
``EGG-INFO`` subdirectory (zipped or otherwise). Development eggs are
normal directories of Python code with one or more ``ProjectName.egg-info``
subdirectories. The development egg format is also used to provide a
default version of a distribution that is available to software that
doesn't use ``pkg_resources`` to request specific versions. Egg links
are ``*.egg-link`` files that contain the name of a built or
development egg, to support symbolic linking on platforms that do not
have native symbolic links (or where the symbolic link support is
limited).
(For more information about these terms and concepts, see also this
`architectural overview`_ of ``pkg_resources`` and Python Eggs in general.)
.. _architectural overview: http://mail.python.org/pipermail/distutils-sig/2005-June/004652.html
.. -----------------
.. Developer's Guide
.. -----------------
.. This section isn't written yet. Currently planned topics include
Accessing Resources
Finding and Activating Package Distributions
get_provider()
require()
WorkingSet
iter_distributions
Running Scripts
Configuration
Namespace Packages
Extensible Applications and Frameworks
Locating entry points
Activation listeners
Metadata access
Extended Discovery and Installation
Supporting Custom PEP 302 Implementations
.. For now, please check out the extensive `API Reference`_ below.
-------------
API Reference
-------------
Namespace Package Support
=========================
A namespace package is a package that only contains other packages and modules,
with no direct contents of its own. Such packages can be split across
multiple, separately-packaged distributions. They are normally used to split
up large packages produced by a single organization, such as in the ``zope``
namespace package for Zope Corporation packages, and the ``peak`` namespace
package for the Python Enterprise Application Kit.
To create a namespace package, you list it in the ``namespace_packages``
argument to ``setup()``, in your project's ``setup.py``. (See the
:ref:`setuptools documentation on namespace packages <Namespace Packages>` for
more information on this.) Also, you must add a ``declare_namespace()`` call
in the package's ``__init__.py`` file(s):
``declare_namespace(name)``
Declare that the dotted package name `name` is a "namespace package" whose
contained packages and modules may be spread across multiple distributions.
The named package's ``__path__`` will be extended to include the
corresponding package in all distributions on ``sys.path`` that contain a
package of that name. (More precisely, if an importer's
``find_module(name)`` returns a loader, then it will also be searched for
the package's contents.) Whenever a Distribution's ``activate()`` method
is invoked, it checks for the presence of namespace packages and updates
their ``__path__`` contents accordingly.
Applications that manipulate namespace packages or directly alter ``sys.path``
at runtime may also need to use this API function:
``fixup_namespace_packages(path_item)``
Declare that `path_item` is a newly added item on ``sys.path`` that may
need to be used to update existing namespace packages. Ordinarily, this is
called for you when an egg is automatically added to ``sys.path``, but if
your application modifies ``sys.path`` to include locations that may
contain portions of a namespace package, you will need to call this
function to ensure they are added to the existing namespace packages.
Although by default ``pkg_resources`` only supports namespace packages for
filesystem and zip importers, you can extend its support to other "importers"
compatible with PEP 302 using the ``register_namespace_handler()`` function.
See the section below on `Supporting Custom Importers`_ for details.
``WorkingSet`` Objects
======================
The ``WorkingSet`` class provides access to a collection of "active"
distributions. In general, there is only one meaningful ``WorkingSet``
instance: the one that represents the distributions that are currently active
on ``sys.path``. This global instance is available under the name
``working_set`` in the ``pkg_resources`` module. However, specialized
tools may wish to manipulate working sets that don't correspond to
``sys.path``, and therefore may wish to create other ``WorkingSet`` instances.
It's important to note that the global ``working_set`` object is initialized
from ``sys.path`` when ``pkg_resources`` is first imported, but is only updated
if you do all future ``sys.path`` manipulation via ``pkg_resources`` APIs. If
you manually modify ``sys.path``, you must invoke the appropriate methods on
the ``working_set`` instance to keep it in sync. Unfortunately, Python does
not provide any way to detect arbitrary changes to a list object like
``sys.path``, so ``pkg_resources`` cannot automatically update the
``working_set`` based on changes to ``sys.path``.
``WorkingSet(entries=None)``
Create a ``WorkingSet`` from an iterable of path entries. If `entries`
is not supplied, it defaults to the value of ``sys.path`` at the time
the constructor is called.
Note that you will not normally construct ``WorkingSet`` instances
yourself, but instead you will implicitly or explicitly use the global
``working_set`` instance. For the most part, the ``pkg_resources`` API
is designed so that the ``working_set`` is used by default, such that you
don't have to explicitly refer to it most of the time.
All distributions available directly on ``sys.path`` will be activated
automatically when ``pkg_resources`` is imported. This behaviour can cause
version conflicts for applications which require non-default versions of
those distributions. To handle this situation, ``pkg_resources`` checks for a
``__requires__`` attribute in the ``__main__`` module when initializing the
default working set, and uses this to ensure a suitable version of each
affected distribution is activated. For example::
__requires__ = ["CherryPy < 3"] # Must be set before pkg_resources import
import pkg_resources
Basic ``WorkingSet`` Methods
----------------------------
The following methods of ``WorkingSet`` objects are also available as module-
level functions in ``pkg_resources`` that apply to the default ``working_set``
instance. Thus, you can use e.g. ``pkg_resources.require()`` as an
abbreviation for ``pkg_resources.working_set.require()``:
``require(*requirements)``
Ensure that distributions matching `requirements` are activated
`requirements` must be a string or a (possibly-nested) sequence
thereof, specifying the distributions and versions required. The
return value is a sequence of the distributions that needed to be
activated to fulfill the requirements; all relevant distributions are
included, even if they were already activated in this working set.
For the syntax of requirement specifiers, see the section below on
`Requirements Parsing`_.
In general, it should not be necessary for you to call this method
directly. It's intended more for use in quick-and-dirty scripting and
interactive interpreter hacking than for production use. If you're creating
an actual library or application, it's strongly recommended that you create
a "setup.py" script using ``setuptools``, and declare all your requirements
there. That way, tools like EasyInstall can automatically detect what
requirements your package has, and deal with them accordingly.
Note that calling ``require('SomePackage')`` will not install
``SomePackage`` if it isn't already present. If you need to do this, you
should use the ``resolve()`` method instead, which allows you to pass an
``installer`` callback that will be invoked when a needed distribution
can't be found on the local machine. You can then have this callback
display a dialog, automatically download the needed distribution, or
whatever else is appropriate for your application. See the documentation
below on the ``resolve()`` method for more information, and also on the
``obtain()`` method of ``Environment`` objects.
``run_script(requires, script_name)``
Locate distribution specified by `requires` and run its `script_name`
script. `requires` must be a string containing a requirement specifier.
(See `Requirements Parsing`_ below for the syntax.)
The script, if found, will be executed in *the caller's globals*. That's
because this method is intended to be called from wrapper scripts that
act as a proxy for the "real" scripts in a distribution. A wrapper script
usually doesn't need to do anything but invoke this function with the
correct arguments.
If you need more control over the script execution environment, you
probably want to use the ``run_script()`` method of a ``Distribution``
object's `Metadata API`_ instead.
``iter_entry_points(group, name=None)``
Yield entry point objects from `group` matching `name`
If `name` is None, yields all entry points in `group` from all
distributions in the working set, otherwise only ones matching both
`group` and `name` are yielded. Entry points are yielded from the active
distributions in the order that the distributions appear in the working
set. (For the global ``working_set``, this should be the same as the order
that they are listed in ``sys.path``.) Note that within the entry points
advertised by an individual distribution, there is no particular ordering.
Please see the section below on `Entry Points`_ for more information.
``WorkingSet`` Methods and Attributes
-------------------------------------
These methods are used to query or manipulate the contents of a specific
working set, so they must be explicitly invoked on a particular ``WorkingSet``
instance:
``add_entry(entry)``
Add a path item to the ``entries``, finding any distributions on it. You
should use this when you add additional items to ``sys.path`` and you want
the global ``working_set`` to reflect the change. This method is also
called by the ``WorkingSet()`` constructor during initialization.
This method uses ``find_distributions(entry,True)`` to find distributions
corresponding to the path entry, and then ``add()`` them. `entry` is
always appended to the ``entries`` attribute, even if it is already
present, however. (This is because ``sys.path`` can contain the same value
more than once, and the ``entries`` attribute should be able to reflect
this.)
``__contains__(dist)``
True if `dist` is active in this ``WorkingSet``. Note that only one
distribution for a given project can be active in a given ``WorkingSet``.
``__iter__()``
Yield distributions for non-duplicate projects in the working set.
The yield order is the order in which the items' path entries were
added to the working set.
``find(req)``
Find a distribution matching `req` (a ``Requirement`` instance).
If there is an active distribution for the requested project, this
returns it, as long as it meets the version requirement specified by
`req`. But, if there is an active distribution for the project and it
does *not* meet the `req` requirement, ``VersionConflict`` is raised.
If there is no active distribution for the requested project, ``None``
is returned.
``resolve(requirements, env=None, installer=None)``
List all distributions needed to (recursively) meet `requirements`
`requirements` must be a sequence of ``Requirement`` objects. `env`,
if supplied, should be an ``Environment`` instance. If
not supplied, an ``Environment`` is created from the working set's
``entries``. `installer`, if supplied, will be invoked with each
requirement that cannot be met by an already-installed distribution; it
should return a ``Distribution`` or ``None``. (See the ``obtain()`` method
of `Environment Objects`_, below, for more information on the `installer`
argument.)
``add(dist, entry=None)``
Add `dist` to working set, associated with `entry`
If `entry` is unspecified, it defaults to ``dist.location``. On exit from
this routine, `entry` is added to the end of the working set's ``.entries``
(if it wasn't already present).
`dist` is only added to the working set if it's for a project that
doesn't already have a distribution active in the set. If it's
successfully added, any callbacks registered with the ``subscribe()``
method will be called. (See `Receiving Change Notifications`_, below.)
Note: ``add()`` is automatically called for you by the ``require()``
method, so you don't normally need to use this method directly.
``entries``
This attribute represents a "shadow" ``sys.path``, primarily useful for
debugging. If you are experiencing import problems, you should check
the global ``working_set`` object's ``entries`` against ``sys.path``, to
ensure that they match. If they do not, then some part of your program
is manipulating ``sys.path`` without updating the ``working_set``
accordingly. IMPORTANT NOTE: do not directly manipulate this attribute!
Setting it equal to ``sys.path`` will not fix your problem, any more than
putting black tape over an "engine warning" light will fix your car! If
this attribute is out of sync with ``sys.path``, it's merely an *indicator*
of the problem, not the cause of it.
Receiving Change Notifications
------------------------------
Extensible applications and frameworks may need to receive notification when
a new distribution (such as a plug-in component) has been added to a working
set. This is what the ``subscribe()`` method and ``add_activation_listener()``
function are for.
``subscribe(callback)``
Invoke ``callback(distribution)`` once for each active distribution that is
in the set now, or gets added later. Because the callback is invoked for
already-active distributions, you do not need to loop over the working set
yourself to deal with the existing items; just register the callback and
be prepared for the fact that it will be called immediately by this method.
Note that callbacks *must not* allow exceptions to propagate, or they will
interfere with the operation of other callbacks and possibly result in an
inconsistent working set state. Callbacks should use a try/except block
to ignore, log, or otherwise process any errors, especially since the code
that caused the callback to be invoked is unlikely to be able to handle
the errors any better than the callback itself.
``pkg_resources.add_activation_listener()`` is an alternate spelling of
``pkg_resources.working_set.subscribe()``.
Locating Plugins
----------------
Extensible applications will sometimes have a "plugin directory" or a set of
plugin directories, from which they want to load entry points or other
metadata. The ``find_plugins()`` method allows you to do this, by scanning an
environment for the newest version of each project that can be safely loaded
without conflicts or missing requirements.
``find_plugins(plugin_env, full_env=None, fallback=True)``
Scan `plugin_env` and identify which distributions could be added to this
working set without version conflicts or missing requirements.
Example usage::
distributions, errors = working_set.find_plugins(
Environment(plugin_dirlist)
)
map(working_set.add, distributions) # add plugins+libs to sys.path
print "Couldn't load", errors # display errors
The `plugin_env` should be an ``Environment`` instance that contains only
distributions that are in the project's "plugin directory" or directories.
The `full_env`, if supplied, should be an ``Environment`` instance that
contains all currently-available distributions.
If `full_env` is not supplied, one is created automatically from the
``WorkingSet`` this method is called on, which will typically mean that
every directory on ``sys.path`` will be scanned for distributions.
This method returns a 2-tuple: (`distributions`, `error_info`), where
`distributions` is a list of the distributions found in `plugin_env` that
were loadable, along with any other distributions that are needed to resolve
their dependencies. `error_info` is a dictionary mapping unloadable plugin
distributions to an exception instance describing the error that occurred.
Usually this will be a ``DistributionNotFound`` or ``VersionConflict``
instance.
Most applications will use this method mainly on the master ``working_set``
instance in ``pkg_resources``, and then immediately add the returned
distributions to the working set so that they are available on sys.path.
This will make it possible to find any entry points, and allow any other
metadata tracking and hooks to be activated.
The resolution algorithm used by ``find_plugins()`` is as follows. First,
the project names of the distributions present in `plugin_env` are sorted.
Then, each project's eggs are tried in descending version order (i.e.,
newest version first).
An attempt is made to resolve each egg's dependencies. If the attempt is
successful, the egg and its dependencies are added to the output list and to
a temporary copy of the working set. The resolution process continues with
the next project name, and no older eggs for that project are tried.
If the resolution attempt fails, however, the error is added to the error
dictionary. If the `fallback` flag is true, the next older version of the
plugin is tried, until a working version is found. If false, the resolution
process continues with the next plugin project name.
Some applications may have stricter fallback requirements than others. For
example, an application that has a database schema or persistent objects
may not be able to safely downgrade a version of a package. Others may want
to ensure that a new plugin configuration is either 100% good or else
revert to a known-good configuration. (That is, they may wish to revert to
a known configuration if the `error_info` return value is non-empty.)
Note that this algorithm gives precedence to satisfying the dependencies of
alphabetically prior project names in case of version conflicts. If two
projects named "AaronsPlugin" and "ZekesPlugin" both need different versions
of "TomsLibrary", then "AaronsPlugin" will win and "ZekesPlugin" will be
disabled due to version conflict.
``Environment`` Objects
=======================
An "environment" is a collection of ``Distribution`` objects, usually ones
that are present and potentially importable on the current platform.
``Environment`` objects are used by ``pkg_resources`` to index available
distributions during dependency resolution.
``Environment(search_path=None, platform=get_supported_platform(), python=PY_MAJOR)``
Create an environment snapshot by scanning `search_path` for distributions
compatible with `platform` and `python`. `search_path` should be a
sequence of strings such as might be used on ``sys.path``. If a
`search_path` isn't supplied, ``sys.path`` is used.
`platform` is an optional string specifying the name of the platform
that platform-specific distributions must be compatible with. If
unspecified, it defaults to the current platform. `python` is an
optional string naming the desired version of Python (e.g. ``'2.4'``);
it defaults to the currently-running version.
You may explicitly set `platform` (and/or `python`) to ``None`` if you
wish to include *all* distributions, not just those compatible with the
running platform or Python version.
Note that `search_path` is scanned immediately for distributions, and the
resulting ``Environment`` is a snapshot of the found distributions. It
is not automatically updated if the system's state changes due to e.g.
installation or removal of distributions.
``__getitem__(project_name)``
Returns a list of distributions for the given project name, ordered
from newest to oldest version. (And highest to lowest format precedence
for distributions that contain the same version of the project.) If there
are no distributions for the project, returns an empty list.
``__iter__()``
Yield the unique project names of the distributions in this environment.
The yielded names are always in lower case.
``add(dist)``
Add `dist` to the environment if it matches the platform and python version
specified at creation time, and only if the distribution hasn't already
been added. (i.e., adding the same distribution more than once is a no-op.)
``remove(dist)``
Remove `dist` from the environment.
``can_add(dist)``
Is distribution `dist` acceptable for this environment? If it's not
compatible with the ``platform`` and ``python`` version values specified
when the environment was created, a false value is returned.
``__add__(dist_or_env)`` (``+`` operator)
Add a distribution or environment to an ``Environment`` instance, returning
a *new* environment object that contains all the distributions previously
contained by both. The new environment will have a ``platform`` and
``python`` of ``None``, meaning that it will not reject any distributions
from being added to it; it will simply accept whatever is added. If you
want the added items to be filtered for platform and Python version, or
you want to add them to the *same* environment instance, you should use
in-place addition (``+=``) instead.
``__iadd__(dist_or_env)`` (``+=`` operator)
Add a distribution or environment to an ``Environment`` instance
*in-place*, updating the existing instance and returning it. The
``platform`` and ``python`` filter attributes take effect, so distributions
in the source that do not have a suitable platform string or Python version
are silently ignored.
``best_match(req, working_set, installer=None)``
Find distribution best matching `req` and usable on `working_set`
This calls the ``find(req)`` method of the `working_set` to see if a
suitable distribution is already active. (This may raise
``VersionConflict`` if an unsuitable version of the project is already
active in the specified `working_set`.) If a suitable distribution isn't
active, this method returns the newest distribution in the environment
that meets the ``Requirement`` in `req`. If no suitable distribution is
found, and `installer` is supplied, then the result of calling
the environment's ``obtain(req, installer)`` method will be returned.
``obtain(requirement, installer=None)``
Obtain a distro that matches requirement (e.g. via download). In the
base ``Environment`` class, this routine just returns
``installer(requirement)``, unless `installer` is None, in which case
None is returned instead. This method is a hook that allows subclasses
to attempt other ways of obtaining a distribution before falling back
to the `installer` argument.
``scan(search_path=None)``
Scan `search_path` for distributions usable on `platform`
Any distributions found are added to the environment. `search_path` should
be a sequence of strings such as might be used on ``sys.path``. If not
supplied, ``sys.path`` is used. Only distributions conforming to
the platform/python version defined at initialization are added. This
method is a shortcut for using the ``find_distributions()`` function to
find the distributions from each item in `search_path`, and then calling
``add()`` to add each one to the environment.
``Requirement`` Objects
=======================
``Requirement`` objects express what versions of a project are suitable for
some purpose. These objects (or their string form) are used by various
``pkg_resources`` APIs in order to find distributions that a script or
distribution needs.
Requirements Parsing
--------------------
``parse_requirements(s)``
Yield ``Requirement`` objects for a string or iterable of lines. Each
requirement must start on a new line. See below for syntax.
``Requirement.parse(s)``
Create a ``Requirement`` object from a string or iterable of lines. A
``ValueError`` is raised if the string or lines do not contain a valid
requirement specifier, or if they contain more than one specifier. (To
parse multiple specifiers from a string or iterable of strings, use
``parse_requirements()`` instead.)
The syntax of a requirement specifier is defined in full in PEP 508.
Some examples of valid requirement specifiers::
FooProject >= 1.2
Fizzy [foo, bar]
PickyThing<1.6,>1.9,!=1.9.6,<2.0a0,==2.4c1
SomethingWhoseVersionIDontCareAbout
SomethingWithMarker[foo]>1.0;python_version<"2.7"
The project name is the only required portion of a requirement string, and
if it's the only thing supplied, the requirement will accept any version
of that project.
The "extras" in a requirement are used to request optional features of a
project, that may require additional project distributions in order to
function. For example, if the hypothetical "Report-O-Rama" project offered
optional PDF support, it might require an additional library in order to
provide that support. Thus, a project needing Report-O-Rama's PDF features
could use a requirement of ``Report-O-Rama[PDF]`` to request installation
or activation of both Report-O-Rama and any libraries it needs in order to
provide PDF support. For example, you could use::
easy_install.py Report-O-Rama[PDF]
To install the necessary packages using the EasyInstall program, or call
``pkg_resources.require('Report-O-Rama[PDF]')`` to add the necessary
distributions to sys.path at runtime.
The "markers" in a requirement are used to specify when a requirement
should be installed -- the requirement will be installed if the marker
evaluates as true in the current environment. For example, specifying
``argparse;python_version<"2.7"`` will not install in an Python 2.7 or 3.3
environment, but will in a Python 2.6 environment.
``Requirement`` Methods and Attributes
--------------------------------------
``__contains__(dist_or_version)``
Return true if `dist_or_version` fits the criteria for this requirement.
If `dist_or_version` is a ``Distribution`` object, its project name must
match the requirement's project name, and its version must meet the
requirement's version criteria. If `dist_or_version` is a string, it is
parsed using the ``parse_version()`` utility function. Otherwise, it is
assumed to be an already-parsed version.
The ``Requirement`` object's version specifiers (``.specs``) are internally
sorted into ascending version order, and used to establish what ranges of
versions are acceptable. Adjacent redundant conditions are effectively
consolidated (e.g. ``">1, >2"`` produces the same results as ``">2"``, and
``"<2,<3"`` produces the same results as``"<2"``). ``"!="`` versions are
excised from the ranges they fall within. The version being tested for
acceptability is then checked for membership in the resulting ranges.
``__eq__(other_requirement)``
A requirement compares equal to another requirement if they have
case-insensitively equal project names, version specifiers, and "extras".
(The order that extras and version specifiers are in is also ignored.)
Equal requirements also have equal hashes, so that requirements can be
used in sets or as dictionary keys.
``__str__()``
The string form of a ``Requirement`` is a string that, if passed to
``Requirement.parse()``, would return an equal ``Requirement`` object.
``project_name``
The name of the required project
``key``
An all-lowercase version of the ``project_name``, useful for comparison
or indexing.
``extras``
A tuple of names of "extras" that this requirement calls for. (These will
be all-lowercase and normalized using the ``safe_extra()`` parsing utility
function, so they may not exactly equal the extras the requirement was
created with.)
``specs``
A list of ``(op,version)`` tuples, sorted in ascending parsed-version
order. The `op` in each tuple is a comparison operator, represented as
a string. The `version` is the (unparsed) version number.
``marker``
An instance of ``packaging.markers.Marker`` that allows evaluation
against the current environment. May be None if no marker specified.
``url``
The location to download the requirement from if specified.
Entry Points
============
Entry points are a simple way for distributions to "advertise" Python objects
(such as functions or classes) for use by other distributions. Extensible
applications and frameworks can search for entry points with a particular name
or group, either from a specific distribution or from all active distributions
on sys.path, and then inspect or load the advertised objects at will.
Entry points belong to "groups" which are named with a dotted name similar to
a Python package or module name. For example, the ``setuptools`` package uses
an entry point named ``distutils.commands`` in order to find commands defined
by distutils extensions. ``setuptools`` treats the names of entry points
defined in that group as the acceptable commands for a setup script.
In a similar way, other packages can define their own entry point groups,
either using dynamic names within the group (like ``distutils.commands``), or
possibly using predefined names within the group. For example, a blogging
framework that offers various pre- or post-publishing hooks might define an
entry point group and look for entry points named "pre_process" and
"post_process" within that group.
To advertise an entry point, a project needs to use ``setuptools`` and provide
an ``entry_points`` argument to ``setup()`` in its setup script, so that the
entry points will be included in the distribution's metadata. For more
details, see the ``setuptools`` documentation. (XXX link here to setuptools)
Each project distribution can advertise at most one entry point of a given
name within the same entry point group. For example, a distutils extension
could advertise two different ``distutils.commands`` entry points, as long as
they had different names. However, there is nothing that prevents *different*
projects from advertising entry points of the same name in the same group. In
some cases, this is a desirable thing, since the application or framework that
uses the entry points may be calling them as hooks, or in some other way
combining them. It is up to the application or framework to decide what to do
if multiple distributions advertise an entry point; some possibilities include
using both entry points, displaying an error message, using the first one found
in sys.path order, etc.
Convenience API
---------------
In the following functions, the `dist` argument can be a ``Distribution``
instance, a ``Requirement`` instance, or a string specifying a requirement
(i.e. project name, version, etc.). If the argument is a string or
``Requirement``, the specified distribution is located (and added to sys.path
if not already present). An error will be raised if a matching distribution is
not available.
The `group` argument should be a string containing a dotted identifier,
identifying an entry point group. If you are defining an entry point group,
you should include some portion of your package's name in the group name so as
to avoid collision with other packages' entry point groups.
``load_entry_point(dist, group, name)``
Load the named entry point from the specified distribution, or raise
``ImportError``.
``get_entry_info(dist, group, name)``
Return an ``EntryPoint`` object for the given `group` and `name` from
the specified distribution. Returns ``None`` if the distribution has not
advertised a matching entry point.
``get_entry_map(dist, group=None)``
Return the distribution's entry point map for `group`, or the full entry
map for the distribution. This function always returns a dictionary,
even if the distribution advertises no entry points. If `group` is given,
the dictionary maps entry point names to the corresponding ``EntryPoint``
object. If `group` is None, the dictionary maps group names to
dictionaries that then map entry point names to the corresponding
``EntryPoint`` instance in that group.
``iter_entry_points(group, name=None)``
Yield entry point objects from `group` matching `name`.
If `name` is None, yields all entry points in `group` from all
distributions in the working set on sys.path, otherwise only ones matching
both `group` and `name` are yielded. Entry points are yielded from
the active distributions in the order that the distributions appear on
sys.path. (Within entry points for a particular distribution, however,
there is no particular ordering.)
(This API is actually a method of the global ``working_set`` object; see
the section above on `Basic WorkingSet Methods`_ for more information.)
Creating and Parsing
--------------------
``EntryPoint(name, module_name, attrs=(), extras=(), dist=None)``
Create an ``EntryPoint`` instance. `name` is the entry point name. The
`module_name` is the (dotted) name of the module containing the advertised
object. `attrs` is an optional tuple of names to look up from the
module to obtain the advertised object. For example, an `attrs` of
``("foo","bar")`` and a `module_name` of ``"baz"`` would mean that the
advertised object could be obtained by the following code::
import baz
advertised_object = baz.foo.bar
The `extras` are an optional tuple of "extra feature" names that the
distribution needs in order to provide this entry point. When the
entry point is loaded, these extra features are looked up in the `dist`
argument to find out what other distributions may need to be activated
on sys.path; see the ``load()`` method for more details. The `extras`
argument is only meaningful if `dist` is specified. `dist` must be
a ``Distribution`` instance.
``EntryPoint.parse(src, dist=None)`` (classmethod)
Parse a single entry point from string `src`
Entry point syntax follows the form::
name = some.module:some.attr [extra1,extra2]
The entry name and module name are required, but the ``:attrs`` and
``[extras]`` parts are optional, as is the whitespace shown between
some of the items. The `dist` argument is passed through to the
``EntryPoint()`` constructor, along with the other values parsed from
`src`.
``EntryPoint.parse_group(group, lines, dist=None)`` (classmethod)
Parse `lines` (a string or sequence of lines) to create a dictionary
mapping entry point names to ``EntryPoint`` objects. ``ValueError`` is
raised if entry point names are duplicated, if `group` is not a valid
entry point group name, or if there are any syntax errors. (Note: the
`group` parameter is used only for validation and to create more
informative error messages.) If `dist` is provided, it will be used to
set the ``dist`` attribute of the created ``EntryPoint`` objects.
``EntryPoint.parse_map(data, dist=None)`` (classmethod)
Parse `data` into a dictionary mapping group names to dictionaries mapping
entry point names to ``EntryPoint`` objects. If `data` is a dictionary,
then the keys are used as group names and the values are passed to
``parse_group()`` as the `lines` argument. If `data` is a string or
sequence of lines, it is first split into .ini-style sections (using
the ``split_sections()`` utility function) and the section names are used
as group names. In either case, the `dist` argument is passed through to
``parse_group()`` so that the entry points will be linked to the specified
distribution.
``EntryPoint`` Objects
----------------------
For simple introspection, ``EntryPoint`` objects have attributes that
correspond exactly to the constructor argument names: ``name``,
``module_name``, ``attrs``, ``extras``, and ``dist`` are all available. In
addition, the following methods are provided:
``load()``
Load the entry point, returning the advertised Python object. Effectively
calls ``self.require()`` then returns ``self.resolve()``.
``require(env=None, installer=None)``
Ensure that any "extras" needed by the entry point are available on
sys.path. ``UnknownExtra`` is raised if the ``EntryPoint`` has ``extras``,
but no ``dist``, or if the named extras are not defined by the
distribution. If `env` is supplied, it must be an ``Environment``, and it
will be used to search for needed distributions if they are not already
present on sys.path. If `installer` is supplied, it must be a callable
taking a ``Requirement`` instance and returning a matching importable
``Distribution`` instance or None.
``resolve()``
Resolve the entry point from its module and attrs, returning the advertised
Python object. Raises ``ImportError`` if it cannot be obtained.
``__str__()``
The string form of an ``EntryPoint`` is a string that could be passed to
``EntryPoint.parse()`` to produce an equivalent ``EntryPoint``.
``Distribution`` Objects
========================
``Distribution`` objects represent collections of Python code that may or may
not be importable, and may or may not have metadata and resources associated
with them. Their metadata may include information such as what other projects
the distribution depends on, what entry points the distribution advertises, and
so on.
Getting or Creating Distributions
---------------------------------
Most commonly, you'll obtain ``Distribution`` objects from a ``WorkingSet`` or
an ``Environment``. (See the sections above on `WorkingSet Objects`_ and
`Environment Objects`_, which are containers for active distributions and
available distributions, respectively.) You can also obtain ``Distribution``
objects from one of these high-level APIs:
``find_distributions(path_item, only=False)``
Yield distributions accessible via `path_item`. If `only` is true, yield
only distributions whose ``location`` is equal to `path_item`. In other
words, if `only` is true, this yields any distributions that would be
importable if `path_item` were on ``sys.path``. If `only` is false, this
also yields distributions that are "in" or "under" `path_item`, but would
not be importable unless their locations were also added to ``sys.path``.
``get_distribution(dist_spec)``
Return a ``Distribution`` object for a given ``Requirement`` or string.
If `dist_spec` is already a ``Distribution`` instance, it is returned.
If it is a ``Requirement`` object or a string that can be parsed into one,
it is used to locate and activate a matching distribution, which is then
returned.
However, if you're creating specialized tools for working with distributions,
or creating a new distribution format, you may also need to create
``Distribution`` objects directly, using one of the three constructors below.
These constructors all take an optional `metadata` argument, which is used to
access any resources or metadata associated with the distribution. `metadata`
must be an object that implements the ``IResourceProvider`` interface, or None.
If it is None, an ``EmptyProvider`` is used instead. ``Distribution`` objects
implement both the `IResourceProvider`_ and `IMetadataProvider Methods`_ by
delegating them to the `metadata` object.
``Distribution.from_location(location, basename, metadata=None, **kw)`` (classmethod)
Create a distribution for `location`, which must be a string such as a
URL, filename, or other string that might be used on ``sys.path``.
`basename` is a string naming the distribution, like ``Foo-1.2-py2.4.egg``.
If `basename` ends with ``.egg``, then the project's name, version, python
version and platform are extracted from the filename and used to set those
properties of the created distribution. Any additional keyword arguments
are forwarded to the ``Distribution()`` constructor.
``Distribution.from_filename(filename, metadata=None**kw)`` (classmethod)
Create a distribution by parsing a local filename. This is a shorter way
of saying ``Distribution.from_location(normalize_path(filename),
os.path.basename(filename), metadata)``. In other words, it creates a
distribution whose location is the normalize form of the filename, parsing
name and version information from the base portion of the filename. Any
additional keyword arguments are forwarded to the ``Distribution()``
constructor.
``Distribution(location,metadata,project_name,version,py_version,platform,precedence)``
Create a distribution by setting its properties. All arguments are
optional and default to None, except for `py_version` (which defaults to
the current Python version) and `precedence` (which defaults to
``EGG_DIST``; for more details see ``precedence`` under `Distribution
Attributes`_ below). Note that it's usually easier to use the
``from_filename()`` or ``from_location()`` constructors than to specify
all these arguments individually.
``Distribution`` Attributes
---------------------------
location
A string indicating the distribution's location. For an importable
distribution, this is the string that would be added to ``sys.path`` to
make it actively importable. For non-importable distributions, this is
simply a filename, URL, or other way of locating the distribution.
project_name
A string, naming the project that this distribution is for. Project names
are defined by a project's setup script, and they are used to identify
projects on PyPI. When a ``Distribution`` is constructed, the
`project_name` argument is passed through the ``safe_name()`` utility
function to filter out any unacceptable characters.
key
``dist.key`` is short for ``dist.project_name.lower()``. It's used for
case-insensitive comparison and indexing of distributions by project name.
extras
A list of strings, giving the names of extra features defined by the
project's dependency list (the ``extras_require`` argument specified in
the project's setup script).
version
A string denoting what release of the project this distribution contains.
When a ``Distribution`` is constructed, the `version` argument is passed
through the ``safe_version()`` utility function to filter out any
unacceptable characters. If no `version` is specified at construction
time, then attempting to access this attribute later will cause the
``Distribution`` to try to discover its version by reading its ``PKG-INFO``
metadata file. If ``PKG-INFO`` is unavailable or can't be parsed,
``ValueError`` is raised.
parsed_version
The ``parsed_version`` is an object representing a "parsed" form of the
distribution's ``version``. ``dist.parsed_version`` is a shortcut for
calling ``parse_version(dist.version)``. It is used to compare or sort
distributions by version. (See the `Parsing Utilities`_ section below for
more information on the ``parse_version()`` function.) Note that accessing
``parsed_version`` may result in a ``ValueError`` if the ``Distribution``
was constructed without a `version` and without `metadata` capable of
supplying the missing version info.
py_version
The major/minor Python version the distribution supports, as a string.
For example, "2.7" or "3.4". The default is the current version of Python.
platform
A string representing the platform the distribution is intended for, or
``None`` if the distribution is "pure Python" and therefore cross-platform.
See `Platform Utilities`_ below for more information on platform strings.
precedence
A distribution's ``precedence`` is used to determine the relative order of
two distributions that have the same ``project_name`` and
``parsed_version``. The default precedence is ``pkg_resources.EGG_DIST``,
which is the highest (i.e. most preferred) precedence. The full list
of predefined precedences, from most preferred to least preferred, is:
``EGG_DIST``, ``BINARY_DIST``, ``SOURCE_DIST``, ``CHECKOUT_DIST``, and
``DEVELOP_DIST``. Normally, precedences other than ``EGG_DIST`` are used
only by the ``setuptools.package_index`` module, when sorting distributions
found in a package index to determine their suitability for installation.
"System" and "Development" eggs (i.e., ones that use the ``.egg-info``
format), however, are automatically given a precedence of ``DEVELOP_DIST``.
``Distribution`` Methods
------------------------
``activate(path=None)``
Ensure distribution is importable on `path`. If `path` is None,
``sys.path`` is used instead. This ensures that the distribution's
``location`` is in the `path` list, and it also performs any necessary
namespace package fixups or declarations. (That is, if the distribution
contains namespace packages, this method ensures that they are declared,
and that the distribution's contents for those namespace packages are
merged with the contents provided by any other active distributions. See
the section above on `Namespace Package Support`_ for more information.)
``pkg_resources`` adds a notification callback to the global ``working_set``
that ensures this method is called whenever a distribution is added to it.
Therefore, you should not normally need to explicitly call this method.
(Note that this means that namespace packages on ``sys.path`` are always
imported as soon as ``pkg_resources`` is, which is another reason why
namespace packages should not contain any code or import statements.)
``as_requirement()``
Return a ``Requirement`` instance that matches this distribution's project
name and version.
``requires(extras=())``
List the ``Requirement`` objects that specify this distribution's
dependencies. If `extras` is specified, it should be a sequence of names
of "extras" defined by the distribution, and the list returned will then
include any dependencies needed to support the named "extras".
``clone(**kw)``
Create a copy of the distribution. Any supplied keyword arguments override
the corresponding argument to the ``Distribution()`` constructor, allowing
you to change some of the copied distribution's attributes.
``egg_name()``
Return what this distribution's standard filename should be, not including
the ".egg" extension. For example, a distribution for project "Foo"
version 1.2 that runs on Python 2.3 for Windows would have an ``egg_name()``
of ``Foo-1.2-py2.3-win32``. Any dashes in the name or version are
converted to underscores. (``Distribution.from_location()`` will convert
them back when parsing a ".egg" file name.)
``__cmp__(other)``, ``__hash__()``
Distribution objects are hashed and compared on the basis of their parsed
version and precedence, followed by their key (lowercase project name),
location, Python version, and platform.
The following methods are used to access ``EntryPoint`` objects advertised
by the distribution. See the section above on `Entry Points`_ for more
detailed information about these operations:
``get_entry_info(group, name)``
Return the ``EntryPoint`` object for `group` and `name`, or None if no
such point is advertised by this distribution.
``get_entry_map(group=None)``
Return the entry point map for `group`. If `group` is None, return
a dictionary mapping group names to entry point maps for all groups.
(An entry point map is a dictionary of entry point names to ``EntryPoint``
objects.)
``load_entry_point(group, name)``
Short for ``get_entry_info(group, name).load()``. Returns the object
advertised by the named entry point, or raises ``ImportError`` if
the entry point isn't advertised by this distribution, or there is some
other import problem.
In addition to the above methods, ``Distribution`` objects also implement all
of the `IResourceProvider`_ and `IMetadataProvider Methods`_ (which are
documented in later sections):
* ``has_metadata(name)``
* ``metadata_isdir(name)``
* ``metadata_listdir(name)``
* ``get_metadata(name)``
* ``get_metadata_lines(name)``
* ``run_script(script_name, namespace)``
* ``get_resource_filename(manager, resource_name)``
* ``get_resource_stream(manager, resource_name)``
* ``get_resource_string(manager, resource_name)``
* ``has_resource(resource_name)``
* ``resource_isdir(resource_name)``
* ``resource_listdir(resource_name)``
If the distribution was created with a `metadata` argument, these resource and
metadata access methods are all delegated to that `metadata` provider.
Otherwise, they are delegated to an ``EmptyProvider``, so that the distribution
will appear to have no resources or metadata. This delegation approach is used
so that supporting custom importers or new distribution formats can be done
simply by creating an appropriate `IResourceProvider`_ implementation; see the
section below on `Supporting Custom Importers`_ for more details.
``ResourceManager`` API
=======================
The ``ResourceManager`` class provides uniform access to package resources,
whether those resources exist as files and directories or are compressed in
an archive of some kind.
Normally, you do not need to create or explicitly manage ``ResourceManager``
instances, as the ``pkg_resources`` module creates a global instance for you,
and makes most of its methods available as top-level names in the
``pkg_resources`` module namespace. So, for example, this code actually
calls the ``resource_string()`` method of the global ``ResourceManager``::
import pkg_resources
my_data = pkg_resources.resource_string(__name__, "foo.dat")
Thus, you can use the APIs below without needing an explicit
``ResourceManager`` instance; just import and use them as needed.
Basic Resource Access
---------------------
In the following methods, the `package_or_requirement` argument may be either
a Python package/module name (e.g. ``foo.bar``) or a ``Requirement`` instance.
If it is a package or module name, the named module or package must be
importable (i.e., be in a distribution or directory on ``sys.path``), and the
`resource_name` argument is interpreted relative to the named package. (Note
that if a module name is used, then the resource name is relative to the
package immediately containing the named module. Also, you should not use use
a namespace package name, because a namespace package can be spread across
multiple distributions, and is therefore ambiguous as to which distribution
should be searched for the resource.)
If it is a ``Requirement``, then the requirement is automatically resolved
(searching the current ``Environment`` if necessary) and a matching
distribution is added to the ``WorkingSet`` and ``sys.path`` if one was not
already present. (Unless the ``Requirement`` can't be satisfied, in which
case an exception is raised.) The `resource_name` argument is then interpreted
relative to the root of the identified distribution; i.e. its first path
segment will be treated as a peer of the top-level modules or packages in the
distribution.
Note that resource names must be ``/``-separated paths and cannot be absolute
(i.e. no leading ``/``) or contain relative names like ``".."``. Do *not* use
``os.path`` routines to manipulate resource paths, as they are *not* filesystem
paths.
``resource_exists(package_or_requirement, resource_name)``
Does the named resource exist? Return ``True`` or ``False`` accordingly.
``resource_stream(package_or_requirement, resource_name)``
Return a readable file-like object for the specified resource; it may be
an actual file, a ``StringIO``, or some similar object. The stream is
in "binary mode", in the sense that whatever bytes are in the resource
will be read as-is.
``resource_string(package_or_requirement, resource_name)``
Return the specified resource as a string. The resource is read in
binary fashion, such that the returned string contains exactly the bytes
that are stored in the resource.
``resource_isdir(package_or_requirement, resource_name)``
Is the named resource a directory? Return ``True`` or ``False``
accordingly.
``resource_listdir(package_or_requirement, resource_name)``
List the contents of the named resource directory, just like ``os.listdir``
except that it works even if the resource is in a zipfile.
Note that only ``resource_exists()`` and ``resource_isdir()`` are insensitive
as to the resource type. You cannot use ``resource_listdir()`` on a file
resource, and you can't use ``resource_string()`` or ``resource_stream()`` on
directory resources. Using an inappropriate method for the resource type may
result in an exception or undefined behavior, depending on the platform and
distribution format involved.
Resource Extraction
-------------------
``resource_filename(package_or_requirement, resource_name)``
Sometimes, it is not sufficient to access a resource in string or stream
form, and a true filesystem filename is needed. In such cases, you can
use this method (or module-level function) to obtain a filename for a
resource. If the resource is in an archive distribution (such as a zipped
egg), it will be extracted to a cache directory, and the filename within
the cache will be returned. If the named resource is a directory, then
all resources within that directory (including subdirectories) are also
extracted. If the named resource is a C extension or "eager resource"
(see the ``setuptools`` documentation for details), then all C extensions
and eager resources are extracted at the same time.
Archived resources are extracted to a cache location that can be managed by
the following two methods:
``set_extraction_path(path)``
Set the base path where resources will be extracted to, if needed.
If you do not call this routine before any extractions take place, the
path defaults to the return value of ``get_default_cache()``. (Which is
based on the ``PYTHON_EGG_CACHE`` environment variable, with various
platform-specific fallbacks. See that routine's documentation for more
details.)
Resources are extracted to subdirectories of this path based upon
information given by the resource provider. You may set this to a
temporary directory, but then you must call ``cleanup_resources()`` to
delete the extracted files when done. There is no guarantee that
``cleanup_resources()`` will be able to remove all extracted files. (On
Windows, for example, you can't unlink .pyd or .dll files that are still
in use.)
Note that you may not change the extraction path for a given resource
manager once resources have been extracted, unless you first call
``cleanup_resources()``.
``cleanup_resources(force=False)``
Delete all extracted resource files and directories, returning a list
of the file and directory names that could not be successfully removed.
This function does not have any concurrency protection, so it should
generally only be called when the extraction path is a temporary
directory exclusive to a single process. This method is not
automatically called; you must call it explicitly or register it as an
``atexit`` function if you wish to ensure cleanup of a temporary
directory used for extractions.
"Provider" Interface
--------------------
If you are implementing an ``IResourceProvider`` and/or ``IMetadataProvider``
for a new distribution archive format, you may need to use the following
``IResourceManager`` methods to co-ordinate extraction of resources to the
filesystem. If you're not implementing an archive format, however, you have
no need to use these methods. Unlike the other methods listed above, they are
*not* available as top-level functions tied to the global ``ResourceManager``;
you must therefore have an explicit ``ResourceManager`` instance to use them.
``get_cache_path(archive_name, names=())``
Return absolute location in cache for `archive_name` and `names`
The parent directory of the resulting path will be created if it does
not already exist. `archive_name` should be the base filename of the
enclosing egg (which may not be the name of the enclosing zipfile!),
including its ".egg" extension. `names`, if provided, should be a
sequence of path name parts "under" the egg's extraction location.
This method should only be called by resource providers that need to
obtain an extraction location, and only for names they intend to
extract, as it tracks the generated names for possible cleanup later.
``extraction_error()``
Raise an ``ExtractionError`` describing the active exception as interfering
with the extraction process. You should call this if you encounter any
OS errors extracting the file to the cache path; it will format the
operating system exception for you, and add other information to the
``ExtractionError`` instance that may be needed by programs that want to
wrap or handle extraction errors themselves.
``postprocess(tempname, filename)``
Perform any platform-specific postprocessing of `tempname`.
Resource providers should call this method ONLY after successfully
extracting a compressed resource. They must NOT call it on resources
that are already in the filesystem.
`tempname` is the current (temporary) name of the file, and `filename`
is the name it will be renamed to by the caller after this routine
returns.
Metadata API
============
The metadata API is used to access metadata resources bundled in a pluggable
distribution. Metadata resources are virtual files or directories containing
information about the distribution, such as might be used by an extensible
application or framework to connect "plugins". Like other kinds of resources,
metadata resource names are ``/``-separated and should not contain ``..`` or
begin with a ``/``. You should not use ``os.path`` routines to manipulate
resource paths.
The metadata API is provided by objects implementing the ``IMetadataProvider``
or ``IResourceProvider`` interfaces. ``Distribution`` objects implement this
interface, as do objects returned by the ``get_provider()`` function:
``get_provider(package_or_requirement)``
If a package name is supplied, return an ``IResourceProvider`` for the
package. If a ``Requirement`` is supplied, resolve it by returning a
``Distribution`` from the current working set (searching the current
``Environment`` if necessary and adding the newly found ``Distribution``
to the working set). If the named package can't be imported, or the
``Requirement`` can't be satisfied, an exception is raised.
NOTE: if you use a package name rather than a ``Requirement``, the object
you get back may not be a pluggable distribution, depending on the method
by which the package was installed. In particular, "development" packages
and "single-version externally-managed" packages do not have any way to
map from a package name to the corresponding project's metadata. Do not
write code that passes a package name to ``get_provider()`` and then tries
to retrieve project metadata from the returned object. It may appear to
work when the named package is in an ``.egg`` file or directory, but
it will fail in other installation scenarios. If you want project
metadata, you need to ask for a *project*, not a package.
``IMetadataProvider`` Methods
-----------------------------
The methods provided by objects (such as ``Distribution`` instances) that
implement the ``IMetadataProvider`` or ``IResourceProvider`` interfaces are:
``has_metadata(name)``
Does the named metadata resource exist?
``metadata_isdir(name)``
Is the named metadata resource a directory?
``metadata_listdir(name)``
List of metadata names in the directory (like ``os.listdir()``)
``get_metadata(name)``
Return the named metadata resource as a string. The data is read in binary
mode; i.e., the exact bytes of the resource file are returned.
``get_metadata_lines(name)``
Yield named metadata resource as list of non-blank non-comment lines. This
is short for calling ``yield_lines(provider.get_metadata(name))``. See the
section on `yield_lines()`_ below for more information on the syntax it
recognizes.
``run_script(script_name, namespace)``
Execute the named script in the supplied namespace dictionary. Raises
``ResolutionError`` if there is no script by that name in the ``scripts``
metadata directory. `namespace` should be a Python dictionary, usually
a module dictionary if the script is being run as a module.
Exceptions
==========
``pkg_resources`` provides a simple exception hierarchy for problems that may
occur when processing requests to locate and activate packages::
ResolutionError
DistributionNotFound
VersionConflict
UnknownExtra
ExtractionError
``ResolutionError``
This class is used as a base class for the other three exceptions, so that
you can catch all of them with a single "except" clause. It is also raised
directly for miscellaneous requirement-resolution problems like trying to
run a script that doesn't exist in the distribution it was requested from.
``DistributionNotFound``
A distribution needed to fulfill a requirement could not be found.
``VersionConflict``
The requested version of a project conflicts with an already-activated
version of the same project.
``UnknownExtra``
One of the "extras" requested was not recognized by the distribution it
was requested from.
``ExtractionError``
A problem occurred extracting a resource to the Python Egg cache. The
following attributes are available on instances of this exception:
manager
The resource manager that raised this exception
cache_path
The base directory for resource extraction
original_error
The exception instance that caused extraction to fail
Supporting Custom Importers
===========================
By default, ``pkg_resources`` supports normal filesystem imports, and
``zipimport`` importers. If you wish to use the ``pkg_resources`` features
with other (PEP 302-compatible) importers or module loaders, you may need to
register various handlers and support functions using these APIs:
``register_finder(importer_type, distribution_finder)``
Register `distribution_finder` to find distributions in ``sys.path`` items.
`importer_type` is the type or class of a PEP 302 "Importer" (``sys.path``
item handler), and `distribution_finder` is a callable that, when passed a
path item, the importer instance, and an `only` flag, yields
``Distribution`` instances found under that path item. (The `only` flag,
if true, means the finder should yield only ``Distribution`` objects whose
``location`` is equal to the path item provided.)
See the source of the ``pkg_resources.find_on_path`` function for an
example finder function.
``register_loader_type(loader_type, provider_factory)``
Register `provider_factory` to make ``IResourceProvider`` objects for
`loader_type`. `loader_type` is the type or class of a PEP 302
``module.__loader__``, and `provider_factory` is a function that, when
passed a module object, returns an `IResourceProvider`_ for that module,
allowing it to be used with the `ResourceManager API`_.
``register_namespace_handler(importer_type, namespace_handler)``
Register `namespace_handler` to declare namespace packages for the given
`importer_type`. `importer_type` is the type or class of a PEP 302
"importer" (sys.path item handler), and `namespace_handler` is a callable
with a signature like this::
def namespace_handler(importer, path_entry, moduleName, module):
# return a path_entry to use for child packages
Namespace handlers are only called if the relevant importer object has
already agreed that it can handle the relevant path item. The handler
should only return a subpath if the module ``__path__`` does not already
contain an equivalent subpath. Otherwise, it should return None.
For an example namespace handler, see the source of the
``pkg_resources.file_ns_handler`` function, which is used for both zipfile
importing and regular importing.
IResourceProvider
-----------------
``IResourceProvider`` is an abstract class that documents what methods are
required of objects returned by a `provider_factory` registered with
``register_loader_type()``. ``IResourceProvider`` is a subclass of
``IMetadataProvider``, so objects that implement this interface must also
implement all of the `IMetadataProvider Methods`_ as well as the methods
shown here. The `manager` argument to the methods below must be an object
that supports the full `ResourceManager API`_ documented above.
``get_resource_filename(manager, resource_name)``
Return a true filesystem path for `resource_name`, coordinating the
extraction with `manager`, if the resource must be unpacked to the
filesystem.
``get_resource_stream(manager, resource_name)``
Return a readable file-like object for `resource_name`.
``get_resource_string(manager, resource_name)``
Return a string containing the contents of `resource_name`.
``has_resource(resource_name)``
Does the package contain the named resource?
``resource_isdir(resource_name)``
Is the named resource a directory? Return a false value if the resource
does not exist or is not a directory.
``resource_listdir(resource_name)``
Return a list of the contents of the resource directory, ala
``os.listdir()``. Requesting the contents of a non-existent directory may
raise an exception.
Note, by the way, that your provider classes need not (and should not) subclass
``IResourceProvider`` or ``IMetadataProvider``! These classes exist solely
for documentation purposes and do not provide any useful implementation code.
You may instead wish to subclass one of the `built-in resource providers`_.
Built-in Resource Providers
---------------------------
``pkg_resources`` includes several provider classes that are automatically used
where appropriate. Their inheritance tree looks like this::
NullProvider
EggProvider
DefaultProvider
PathMetadata
ZipProvider
EggMetadata
EmptyProvider
FileMetadata
``NullProvider``
This provider class is just an abstract base that provides for common
provider behaviors (such as running scripts), given a definition for just
a few abstract methods.
``EggProvider``
This provider class adds in some egg-specific features that are common
to zipped and unzipped eggs.
``DefaultProvider``
This provider class is used for unpacked eggs and "plain old Python"
filesystem modules.
``ZipProvider``
This provider class is used for all zipped modules, whether they are eggs
or not.
``EmptyProvider``
This provider class always returns answers consistent with a provider that
has no metadata or resources. ``Distribution`` objects created without
a ``metadata`` argument use an instance of this provider class instead.
Since all ``EmptyProvider`` instances are equivalent, there is no need
to have more than one instance. ``pkg_resources`` therefore creates a
global instance of this class under the name ``empty_provider``, and you
may use it if you have need of an ``EmptyProvider`` instance.
``PathMetadata(path, egg_info)``
Create an ``IResourceProvider`` for a filesystem-based distribution, where
`path` is the filesystem location of the importable modules, and `egg_info`
is the filesystem location of the distribution's metadata directory.
`egg_info` should usually be the ``EGG-INFO`` subdirectory of `path` for an
"unpacked egg", and a ``ProjectName.egg-info`` subdirectory of `path` for
a "development egg". However, other uses are possible for custom purposes.
``EggMetadata(zipimporter)``
Create an ``IResourceProvider`` for a zipfile-based distribution. The
`zipimporter` should be a ``zipimport.zipimporter`` instance, and may
represent a "basket" (a zipfile containing multiple ".egg" subdirectories)
a specific egg *within* a basket, or a zipfile egg (where the zipfile
itself is a ".egg"). It can also be a combination, such as a zipfile egg
that also contains other eggs.
``FileMetadata(path_to_pkg_info)``
Create an ``IResourceProvider`` that provides exactly one metadata
resource: ``PKG-INFO``. The supplied path should be a distutils PKG-INFO
file. This is basically the same as an ``EmptyProvider``, except that
requests for ``PKG-INFO`` will be answered using the contents of the
designated file. (This provider is used to wrap ``.egg-info`` files
installed by vendor-supplied system packages.)
Utility Functions
=================
In addition to its high-level APIs, ``pkg_resources`` also includes several
generally-useful utility routines. These routines are used to implement the
high-level APIs, but can also be quite useful by themselves.
Parsing Utilities
-----------------
``parse_version(version)``
Parsed a project's version string as defined by PEP 440. The returned
value will be an object that represents the version. These objects may
be compared to each other and sorted. The sorting algorithm is as defined
by PEP 440 with the addition that any version which is not a valid PEP 440
version will be considered less than any valid PEP 440 version and the
invalid versions will continue sorting using the original algorithm.
.. _yield_lines():
``yield_lines(strs)``
Yield non-empty/non-comment lines from a string/unicode or a possibly-
nested sequence thereof. If `strs` is an instance of ``basestring``, it
is split into lines, and each non-blank, non-comment line is yielded after
stripping leading and trailing whitespace. (Lines whose first non-blank
character is ``#`` are considered comment lines.)
If `strs` is not an instance of ``basestring``, it is iterated over, and
each item is passed recursively to ``yield_lines()``, so that an arbitrarily
nested sequence of strings, or sequences of sequences of strings can be
flattened out to the lines contained therein. So for example, passing
a file object or a list of strings to ``yield_lines`` will both work.
(Note that between each string in a sequence of strings there is assumed to
be an implicit line break, so lines cannot bridge two strings in a
sequence.)
This routine is used extensively by ``pkg_resources`` to parse metadata
and file formats of various kinds, and most other ``pkg_resources``
parsing functions that yield multiple values will use it to break up their
input. However, this routine is idempotent, so calling ``yield_lines()``
on the output of another call to ``yield_lines()`` is completely harmless.
``split_sections(strs)``
Split a string (or possibly-nested iterable thereof), yielding ``(section,
content)`` pairs found using an ``.ini``-like syntax. Each ``section`` is
a whitespace-stripped version of the section name ("``[section]``")
and each ``content`` is a list of stripped lines excluding blank lines and
comment-only lines. If there are any non-blank, non-comment lines before
the first section header, they're yielded in a first ``section`` of
``None``.
This routine uses ``yield_lines()`` as its front end, so you can pass in
anything that ``yield_lines()`` accepts, such as an open text file, string,
or sequence of strings. ``ValueError`` is raised if a malformed section
header is found (i.e. a line starting with ``[`` but not ending with
``]``).
Note that this simplistic parser assumes that any line whose first nonblank
character is ``[`` is a section heading, so it can't support .ini format
variations that allow ``[`` as the first nonblank character on other lines.
``safe_name(name)``
Return a "safe" form of a project's name, suitable for use in a
``Requirement`` string, as a distribution name, or a PyPI project name.
All non-alphanumeric runs are condensed to single "-" characters, such that
a name like "The $$$ Tree" becomes "The-Tree". Note that if you are
generating a filename from this value you should combine it with a call to
``to_filename()`` so all dashes ("-") are replaced by underscores ("_").
See ``to_filename()``.
``safe_version(version)``
This will return the normalized form of any PEP 440 version, if the version
string is not PEP 440 compatible than it is similar to ``safe_name()``
except that spaces in the input become dots, and dots are allowed to exist
in the output. As with ``safe_name()``, if you are generating a filename
from this you should replace any "-" characters in the output with
underscores.
``safe_extra(extra)``
Return a "safe" form of an extra's name, suitable for use in a requirement
string or a setup script's ``extras_require`` keyword. This routine is
similar to ``safe_name()`` except that non-alphanumeric runs are replaced
by a single underbar (``_``), and the result is lowercased.
``to_filename(name_or_version)``
Escape a name or version string so it can be used in a dash-separated
filename (or ``#egg=name-version`` tag) without ambiguity. You
should only pass in values that were returned by ``safe_name()`` or
``safe_version()``.
Platform Utilities
------------------
``get_build_platform()``
Return this platform's identifier string. For Windows, the return value
is ``"win32"``, and for Mac OS X it is a string of the form
``"macosx-10.4-ppc"``. All other platforms return the same uname-based
string that the ``distutils.util.get_platform()`` function returns.
This string is the minimum platform version required by distributions built
on the local machine. (Backward compatibility note: setuptools versions
prior to 0.6b1 called this function ``get_platform()``, and the function is
still available under that name for backward compatibility reasons.)
``get_supported_platform()`` (New in 0.6b1)
This is the similar to ``get_build_platform()``, but is the maximum
platform version that the local machine supports. You will usually want
to use this value as the ``provided`` argument to the
``compatible_platforms()`` function.
``compatible_platforms(provided, required)``
Return true if a distribution built on the `provided` platform may be used
on the `required` platform. If either platform value is ``None``, it is
considered a wildcard, and the platforms are therefore compatible.
Likewise, if the platform strings are equal, they're also considered
compatible, and ``True`` is returned. Currently, the only non-equal
platform strings that are considered compatible are Mac OS X platform
strings with the same hardware type (e.g. ``ppc``) and major version
(e.g. ``10``) with the `provided` platform's minor version being less than
or equal to the `required` platform's minor version.
``get_default_cache()``
Determine the default cache location for extracting resources from zipped
eggs. This routine returns the ``PYTHON_EGG_CACHE`` environment variable,
if set. Otherwise, on Windows, it returns a "Python-Eggs" subdirectory of
the user's "Application Data" directory. On all other systems, it returns
``os.path.expanduser("~/.python-eggs")`` if ``PYTHON_EGG_CACHE`` is not
set.
PEP 302 Utilities
-----------------
``get_importer(path_item)``
Retrieve a PEP 302 "importer" for the given path item (which need not
actually be on ``sys.path``). This routine simulates the PEP 302 protocol
for obtaining an "importer" object. It first checks for an importer for
the path item in ``sys.path_importer_cache``, and if not found it calls
each of the ``sys.path_hooks`` and caches the result if a good importer is
found. If no importer is found, this routine returns an ``ImpWrapper``
instance that wraps the builtin import machinery as a PEP 302-compliant
"importer" object. This ``ImpWrapper`` is *not* cached; instead a new
instance is returned each time.
(Note: When run under Python 2.5, this function is simply an alias for
``pkgutil.get_importer()``, and instead of ``pkg_resources.ImpWrapper``
instances, it may return ``pkgutil.ImpImporter`` instances.)
File/Path Utilities
-------------------
``ensure_directory(path)``
Ensure that the parent directory (``os.path.dirname``) of `path` actually
exists, using ``os.makedirs()`` if necessary.
``normalize_path(path)``
Return a "normalized" version of `path`, such that two paths represent
the same filesystem location if they have equal ``normalized_path()``
values. Specifically, this is a shortcut for calling ``os.path.realpath``
and ``os.path.normcase`` on `path`. Unfortunately, on certain platforms
(notably Cygwin and Mac OS X) the ``normcase`` function does not accurately
reflect the platform's case-sensitivity, so there is always the possibility
of two apparently-different paths being equal on such platforms.
History
-------
0.6c9
* Fix ``resource_listdir('')`` always returning an empty list for zipped eggs.
0.6c7
* Fix package precedence problem where single-version eggs installed in
``site-packages`` would take precedence over ``.egg`` files (or directories)
installed in ``site-packages``.
0.6c6
* Fix extracted C extensions not having executable permissions under Cygwin.
* Allow ``.egg-link`` files to contain relative paths.
* Fix cache dir defaults on Windows when multiple environment vars are needed
to construct a path.
0.6c4
* Fix "dev" versions being considered newer than release candidates.
0.6c3
* Python 2.5 compatibility fixes.
0.6c2
* Fix a problem with eggs specified directly on ``PYTHONPATH`` on
case-insensitive filesystems possibly not showing up in the default
working set, due to differing normalizations of ``sys.path`` entries.
0.6b3
* Fixed a duplicate path insertion problem on case-insensitive filesystems.
0.6b1
* Split ``get_platform()`` into ``get_supported_platform()`` and
``get_build_platform()`` to work around a Mac versioning problem that caused
the behavior of ``compatible_platforms()`` to be platform specific.
* Fix entry point parsing when a standalone module name has whitespace
between it and the extras.
0.6a11
* Added ``ExtractionError`` and ``ResourceManager.extraction_error()`` so that
cache permission problems get a more user-friendly explanation of the
problem, and so that programs can catch and handle extraction errors if they
need to.
0.6a10
* Added the ``extras`` attribute to ``Distribution``, the ``find_plugins()``
method to ``WorkingSet``, and the ``__add__()`` and ``__iadd__()`` methods
to ``Environment``.
* ``safe_name()`` now allows dots in project names.
* There is a new ``to_filename()`` function that escapes project names and
versions for safe use in constructing egg filenames from a Distribution
object's metadata.
* Added ``Distribution.clone()`` method, and keyword argument support to other
``Distribution`` constructors.
* Added the ``DEVELOP_DIST`` precedence, and automatically assign it to
eggs using ``.egg-info`` format.
0.6a9
* Don't raise an error when an invalid (unfinished) distribution is found
unless absolutely necessary. Warn about skipping invalid/unfinished eggs
when building an Environment.
* Added support for ``.egg-info`` files or directories with version/platform
information embedded in the filename, so that system packagers have the
option of including ``PKG-INFO`` files to indicate the presence of a
system-installed egg, without needing to use ``.egg`` directories, zipfiles,
or ``.pth`` manipulation.
* Changed ``parse_version()`` to remove dashes before pre-release tags, so
that ``0.2-rc1`` is considered an *older* version than ``0.2``, and is equal
to ``0.2rc1``. The idea that a dash *always* meant a post-release version
was highly non-intuitive to setuptools users and Python developers, who
seem to want to use ``-rc`` version numbers a lot.
0.6a8
* Fixed a problem with ``WorkingSet.resolve()`` that prevented version
conflicts from being detected at runtime.
* Improved runtime conflict warning message to identify a line in the user's
program, rather than flagging the ``warn()`` call in ``pkg_resources``.
* Avoid giving runtime conflict warnings for namespace packages, even if they
were declared by a different package than the one currently being activated.
* Fix path insertion algorithm for case-insensitive filesystems.
* Fixed a problem with nested namespace packages (e.g. ``peak.util``) not
being set as an attribute of their parent package.
0.6a6
* Activated distributions are now inserted in ``sys.path`` (and the working
set) just before the directory that contains them, instead of at the end.
This allows e.g. eggs in ``site-packages`` to override unmanaged modules in
the same location, and allows eggs found earlier on ``sys.path`` to override
ones found later.
* When a distribution is activated, it now checks whether any contained
non-namespace modules have already been imported and issues a warning if
a conflicting module has already been imported.
* Changed dependency processing so that it's breadth-first, allowing a
depender's preferences to override those of a dependee, to prevent conflicts
when a lower version is acceptable to the dependee, but not the depender.
* Fixed a problem extracting zipped files on Windows, when the egg in question
has had changed contents but still has the same version number.
0.6a4
* Fix a bug in ``WorkingSet.resolve()`` that was introduced in 0.6a3.
0.6a3
* Added ``safe_extra()`` parsing utility routine, and use it for Requirement,
EntryPoint, and Distribution objects' extras handling.
0.6a1
* Enhanced performance of ``require()`` and related operations when all
requirements are already in the working set, and enhanced performance of
directory scanning for distributions.
* Fixed some problems using ``pkg_resources`` w/PEP 302 loaders other than
``zipimport``, and the previously-broken "eager resource" support.
* Fixed ``pkg_resources.resource_exists()`` not working correctly, along with
some other resource API bugs.
* Many API changes and enhancements:
* Added ``EntryPoint``, ``get_entry_map``, ``load_entry_point``, and
``get_entry_info`` APIs for dynamic plugin discovery.
* ``list_resources`` is now ``resource_listdir`` (and it actually works)
* Resource API functions like ``resource_string()`` that accepted a package
name and resource name, will now also accept a ``Requirement`` object in
place of the package name (to allow access to non-package data files in
an egg).
* ``get_provider()`` will now accept a ``Requirement`` instance or a module
name. If it is given a ``Requirement``, it will return a corresponding
``Distribution`` (by calling ``require()`` if a suitable distribution
isn't already in the working set), rather than returning a metadata and
resource provider for a specific module. (The difference is in how
resource paths are interpreted; supplying a module name means resources
path will be module-relative, rather than relative to the distribution's
root.)
* ``Distribution`` objects now implement the ``IResourceProvider`` and
``IMetadataProvider`` interfaces, so you don't need to reference the (no
longer available) ``metadata`` attribute to get at these interfaces.
* ``Distribution`` and ``Requirement`` both have a ``project_name``
attribute for the project name they refer to. (Previously these were
``name`` and ``distname`` attributes.)
* The ``path`` attribute of ``Distribution`` objects is now ``location``,
because it isn't necessarily a filesystem path (and hasn't been for some
time now). The ``location`` of ``Distribution`` objects in the filesystem
should always be normalized using ``pkg_resources.normalize_path()``; all
of the setuptools and EasyInstall code that generates distributions from
the filesystem (including ``Distribution.from_filename()``) ensure this
invariant, but if you use a more generic API like ``Distribution()`` or
``Distribution.from_location()`` you should take care that you don't
create a distribution with an un-normalized filesystem path.
* ``Distribution`` objects now have an ``as_requirement()`` method that
returns a ``Requirement`` for the distribution's project name and version.
* Distribution objects no longer have an ``installed_on()`` method, and the
``install_on()`` method is now ``activate()`` (but may go away altogether
soon). The ``depends()`` method has also been renamed to ``requires()``,
and ``InvalidOption`` is now ``UnknownExtra``.
* ``find_distributions()`` now takes an additional argument called ``only``,
that tells it to only yield distributions whose location is the passed-in
path. (It defaults to False, so that the default behavior is unchanged.)
* ``AvailableDistributions`` is now called ``Environment``, and the
``get()``, ``__len__()``, and ``__contains__()`` methods were removed,
because they weren't particularly useful. ``__getitem__()`` no longer
raises ``KeyError``; it just returns an empty list if there are no
distributions for the named project.
* The ``resolve()`` method of ``Environment`` is now a method of
``WorkingSet`` instead, and the ``best_match()`` method now uses a working
set instead of a path list as its second argument.
* There is a new ``pkg_resources.add_activation_listener()`` API that lets
you register a callback for notifications about distributions added to
``sys.path`` (including the distributions already on it). This is
basically a hook for extensible applications and frameworks to be able to
search for plugin metadata in distributions added at runtime.
0.5a13
* Fixed a bug in resource extraction from nested packages in a zipped egg.
0.5a12
* Updated extraction/cache mechanism for zipped resources to avoid inter-
process and inter-thread races during extraction. The default cache
location can now be set via the ``PYTHON_EGGS_CACHE`` environment variable,
and the default Windows cache is now a ``Python-Eggs`` subdirectory of the
current user's "Application Data" directory, if the ``PYTHON_EGGS_CACHE``
variable isn't set.
0.5a10
* Fix a problem with ``pkg_resources`` being confused by non-existent eggs on
``sys.path`` (e.g. if a user deletes an egg without removing it from the
``easy-install.pth`` file).
* Fix a problem with "basket" support in ``pkg_resources``, where egg-finding
never actually went inside ``.egg`` files.
* Made ``pkg_resources`` import the module you request resources from, if it's
not already imported.
0.5a4
* ``pkg_resources.AvailableDistributions.resolve()`` and related methods now
accept an ``installer`` argument: a callable taking one argument, a
``Requirement`` instance. The callable must return a ``Distribution``
object, or ``None`` if no distribution is found. This feature is used by
EasyInstall to resolve dependencies by recursively invoking itself.
0.4a4
* Fix problems with ``resource_listdir()``, ``resource_isdir()`` and resource
directory extraction for zipped eggs.
0.4a3
* Fixed scripts not being able to see a ``__file__`` variable in ``__main__``
* Fixed a problem with ``resource_isdir()`` implementation that was introduced
in 0.4a2.
0.4a1
* Fixed a bug in requirements processing for exact versions (i.e. ``==`` and
``!=``) when only one condition was included.
* Added ``safe_name()`` and ``safe_version()`` APIs to clean up handling of
arbitrary distribution names and versions found on PyPI.
0.3a4
* ``pkg_resources`` now supports resource directories, not just the resources
in them. In particular, there are ``resource_listdir()`` and
``resource_isdir()`` APIs.
* ``pkg_resources`` now supports "egg baskets" -- .egg zipfiles which contain
multiple distributions in subdirectories whose names end with ``.egg``.
Having such a "basket" in a directory on ``sys.path`` is equivalent to
having the individual eggs in that directory, but the contained eggs can
be individually added (or not) to ``sys.path``. Currently, however, there
is no automated way to create baskets.
* Namespace package manipulation is now protected by the Python import lock.
0.3a1
* Initial release.
doc/alt-python27-setuptools/psfl.txt 0000644 00000030737 15173017726 0013530 0 ustar 00 A. HISTORY OF THE SOFTWARE
==========================
Python was created in the early 1990s by Guido van Rossum at Stichting
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
as a successor of a language called ABC. Guido remains Python's
principal author, although it includes many contributions from others.
In 1995, Guido continued his work on Python at the Corporation for
National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
in Reston, Virginia where he released several versions of the
software.
In May 2000, Guido and the Python core development team moved to
BeOpen.com to form the BeOpen PythonLabs team. In October of the same
year, the PythonLabs team moved to Digital Creations (now Zope
Corporation, see http://www.zope.com). In 2001, the Python Software
Foundation (PSF, see http://www.python.org/psf/) was formed, a
non-profit organization created specifically to own Python-related
Intellectual Property. Zope Corporation is a sponsoring member of
the PSF.
All Python releases are Open Source (see http://www.opensource.org for
the Open Source Definition). Historically, most, but not all, Python
releases have also been GPL-compatible; the table below summarizes
the various releases.
Release Derived Year Owner GPL-
from compatible? (1)
0.9.0 thru 1.2 1991-1995 CWI yes
1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
1.6 1.5.2 2000 CNRI no
2.0 1.6 2000 BeOpen.com no
1.6.1 1.6 2001 CNRI yes (2)
2.1 2.0+1.6.1 2001 PSF no
2.0.1 2.0+1.6.1 2001 PSF yes
2.1.1 2.1+2.0.1 2001 PSF yes
2.1.2 2.1.1 2002 PSF yes
2.1.3 2.1.2 2002 PSF yes
2.2 and above 2.1.1 2001-now PSF yes
Footnotes:
(1) GPL-compatible doesn't mean that we're distributing Python under
the GPL. All Python licenses, unlike the GPL, let you distribute
a modified version without making your changes open source. The
GPL-compatible licenses make it possible to combine Python with
other software that is released under the GPL; the others don't.
(2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
because its license has a choice of law clause. According to
CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
is "not incompatible" with the GPL.
Thanks to the many outside volunteers who have worked under Guido's
direction to make these releases possible.
B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
===============================================================
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.
2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016 Python Software Foundation; All Rights
Reserved" are retained in Python alone or in any derivative version prepared by
Licensee.
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.
4. PSF is making Python available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.
8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
-------------------------------------------
BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
Individual or Organization ("Licensee") accessing and otherwise using
this software in source or binary form and its associated
documentation ("the Software").
2. Subject to the terms and conditions of this BeOpen Python License
Agreement, BeOpen hereby grants Licensee a non-exclusive,
royalty-free, world-wide license to reproduce, analyze, test, perform
and/or display publicly, prepare derivative works, distribute, and
otherwise use the Software alone or in any derivative version,
provided, however, that the BeOpen Python License is retained in the
Software, alone or in any derivative version prepared by Licensee.
3. BeOpen is making the Software available to Licensee on an "AS IS"
basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
5. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
6. This License Agreement shall be governed by and interpreted in all
respects by the law of the State of California, excluding conflict of
law provisions. Nothing in this License Agreement shall be deemed to
create any relationship of agency, partnership, or joint venture
between BeOpen and Licensee. This License Agreement does not grant
permission to use BeOpen trademarks or trade names in a trademark
sense to endorse or promote products or services of Licensee, or any
third party. As an exception, the "BeOpen Python" logos available at
http://www.pythonlabs.com/logos.html may be used according to the
permissions granted on that web page.
7. By copying, installing or otherwise using the software, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
---------------------------------------
1. This LICENSE AGREEMENT is between the Corporation for National
Research Initiatives, having an office at 1895 Preston White Drive,
Reston, VA 20191 ("CNRI"), and the Individual or Organization
("Licensee") accessing and otherwise using Python 1.6.1 software in
source or binary form and its associated documentation.
2. Subject to the terms and conditions of this License Agreement, CNRI
hereby grants Licensee a nonexclusive, royalty-free, world-wide
license to reproduce, analyze, test, perform and/or display publicly,
prepare derivative works, distribute, and otherwise use Python 1.6.1
alone or in any derivative version, provided, however, that CNRI's
License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
1995-2001 Corporation for National Research Initiatives; All Rights
Reserved" are retained in Python 1.6.1 alone or in any derivative
version prepared by Licensee. Alternately, in lieu of CNRI's License
Agreement, Licensee may substitute the following text (omitting the
quotes): "Python 1.6.1 is made available subject to the terms and
conditions in CNRI's License Agreement. This Agreement together with
Python 1.6.1 may be located on the Internet using the following
unique, persistent identifier (known as a handle): 1895.22/1013. This
Agreement may also be obtained from a proxy server on the Internet
using the following URL: http://hdl.handle.net/1895.22/1013".
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python 1.6.1 or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python 1.6.1.
4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. This License Agreement shall be governed by the federal
intellectual property law of the United States, including without
limitation the federal copyright law, and, to the extent such
U.S. federal law does not apply, by the law of the Commonwealth of
Virginia, excluding Virginia's conflict of law provisions.
Notwithstanding the foregoing, with regard to derivative works based
on Python 1.6.1 that incorporate non-separable material that was
previously distributed under the GNU General Public License (GPL), the
law of the Commonwealth of Virginia shall govern this License
Agreement only as to issues arising under or with respect to
Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
License Agreement shall be deemed to create any relationship of
agency, partnership, or joint venture between CNRI and Licensee. This
License Agreement does not grant permission to use CNRI trademarks or
trade name in a trademark sense to endorse or promote products or
services of Licensee, or any third party.
8. By clicking on the "ACCEPT" button where indicated, or by copying,
installing or otherwise using Python 1.6.1, Licensee agrees to be
bound by the terms and conditions of this License Agreement.
ACCEPT
CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
--------------------------------------------------
Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
The Netherlands. All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission.
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
doc/alt-python27-setuptools/easy_install.txt 0000644 00000223431 15173017727 0015247 0 ustar 00 ============
Easy Install
============
Easy Install is a python module (``easy_install``) bundled with ``setuptools``
that lets you automatically download, build, install, and manage Python
packages.
Please share your experiences with us! If you encounter difficulty installing
a package, please contact us via the `distutils mailing list
<http://mail.python.org/pipermail/distutils-sig/>`_. (Note: please DO NOT send
private email directly to the author of setuptools; it will be discarded. The
mailing list is a searchable archive of previously-asked and answered
questions; you should begin your research there before reporting something as a
bug -- and then do so via list discussion first.)
(Also, if you'd like to learn about how you can use ``setuptools`` to make your
own packages work better with EasyInstall, or provide EasyInstall-like features
without requiring your users to use EasyInstall directly, you'll probably want
to check out the full `setuptools`_ documentation as well.)
.. contents:: **Table of Contents**
Using "Easy Install"
====================
.. _installation instructions:
Installing "Easy Install"
-------------------------
Please see the `setuptools PyPI page <https://pypi.python.org/pypi/setuptools>`_
for download links and basic installation instructions for each of the
supported platforms.
You will need at least Python 2.6. An ``easy_install`` script will be
installed in the normal location for Python scripts on your platform.
Note that the instructions on the setuptools PyPI page assume that you are
are installing to Python's primary ``site-packages`` directory. If this is
not the case, you should consult the section below on `Custom Installation
Locations`_ before installing. (And, on Windows, you should not use the
``.exe`` installer when installing to an alternate location.)
Note that ``easy_install`` normally works by downloading files from the
internet. If you are behind an NTLM-based firewall that prevents Python
programs from accessing the net directly, you may wish to first install and use
the `APS proxy server <http://ntlmaps.sf.net/>`_, which lets you get past such
firewalls in the same way that your web browser(s) do.
(Alternately, if you do not wish easy_install to actually download anything, you
can restrict it from doing so with the ``--allow-hosts`` option; see the
sections on `restricting downloads with --allow-hosts`_ and `command-line
options`_ for more details.)
Troubleshooting
~~~~~~~~~~~~~~~
If EasyInstall/setuptools appears to install correctly, and you can run the
``easy_install`` command but it fails with an ``ImportError``, the most likely
cause is that you installed to a location other than ``site-packages``,
without taking any of the steps described in the `Custom Installation
Locations`_ section below. Please see that section and follow the steps to
make sure that your custom location will work correctly. Then re-install.
Similarly, if you can run ``easy_install``, and it appears to be installing
packages, but then you can't import them, the most likely issue is that you
installed EasyInstall correctly but are using it to install packages to a
non-standard location that hasn't been properly prepared. Again, see the
section on `Custom Installation Locations`_ for more details.
Windows Notes
~~~~~~~~~~~~~
Installing setuptools will provide an ``easy_install`` command according to
the techniques described in `Executables and Launchers`_. If the
``easy_install`` command is not available after installation, that section
provides details on how to configure Windows to make the commands available.
Downloading and Installing a Package
------------------------------------
For basic use of ``easy_install``, you need only supply the filename or URL of
a source distribution or .egg file (`Python Egg`__).
__ http://peak.telecommunity.com/DevCenter/PythonEggs
**Example 1**. Install a package by name, searching PyPI for the latest
version, and automatically downloading, building, and installing it::
easy_install SQLObject
**Example 2**. Install or upgrade a package by name and version by finding
links on a given "download page"::
easy_install -f http://pythonpaste.org/package_index.html SQLObject
**Example 3**. Download a source distribution from a specified URL,
automatically building and installing it::
easy_install http://example.com/path/to/MyPackage-1.2.3.tgz
**Example 4**. Install an already-downloaded .egg file::
easy_install /my_downloads/OtherPackage-3.2.1-py2.3.egg
**Example 5**. Upgrade an already-installed package to the latest version
listed on PyPI::
easy_install --upgrade PyProtocols
**Example 6**. Install a source distribution that's already downloaded and
extracted in the current directory (New in 0.5a9)::
easy_install .
**Example 7**. (New in 0.6a1) Find a source distribution or Subversion
checkout URL for a package, and extract it or check it out to
``~/projects/sqlobject`` (the name will always be in all-lowercase), where it
can be examined or edited. (The package will not be installed, but it can
easily be installed with ``easy_install ~/projects/sqlobject``. See `Editing
and Viewing Source Packages`_ below for more info.)::
easy_install --editable --build-directory ~/projects SQLObject
**Example 7**. (New in 0.6.11) Install a distribution within your home dir::
easy_install --user SQLAlchemy
Easy Install accepts URLs, filenames, PyPI package names (i.e., ``distutils``
"distribution" names), and package+version specifiers. In each case, it will
attempt to locate the latest available version that meets your criteria.
When downloading or processing downloaded files, Easy Install recognizes
distutils source distribution files with extensions of .tgz, .tar, .tar.gz,
.tar.bz2, or .zip. And of course it handles already-built .egg
distributions as well as ``.win32.exe`` installers built using distutils.
By default, packages are installed to the running Python installation's
``site-packages`` directory, unless you provide the ``-d`` or ``--install-dir``
option to specify an alternative directory, or specify an alternate location
using distutils configuration files. (See `Configuration Files`_, below.)
By default, any scripts included with the package are installed to the running
Python installation's standard script installation location. However, if you
specify an installation directory via the command line or a config file, then
the default directory for installing scripts will be the same as the package
installation directory, to ensure that the script will have access to the
installed package. You can override this using the ``-s`` or ``--script-dir``
option.
Installed packages are added to an ``easy-install.pth`` file in the install
directory, so that Python will always use the most-recently-installed version
of the package. If you would like to be able to select which version to use at
runtime, you should use the ``-m`` or ``--multi-version`` option.
Upgrading a Package
-------------------
You don't need to do anything special to upgrade a package: just install the
new version, either by requesting a specific version, e.g.::
easy_install "SomePackage==2.0"
a version greater than the one you have now::
easy_install "SomePackage>2.0"
using the upgrade flag, to find the latest available version on PyPI::
easy_install --upgrade SomePackage
or by using a download page, direct download URL, or package filename::
easy_install -f http://example.com/downloads ExamplePackage
easy_install http://example.com/downloads/ExamplePackage-2.0-py2.4.egg
easy_install my_downloads/ExamplePackage-2.0.tgz
If you're using ``-m`` or ``--multi-version`` , using the ``require()``
function at runtime automatically selects the newest installed version of a
package that meets your version criteria. So, installing a newer version is
the only step needed to upgrade such packages.
If you're installing to a directory on PYTHONPATH, or a configured "site"
directory (and not using ``-m``), installing a package automatically replaces
any previous version in the ``easy-install.pth`` file, so that Python will
import the most-recently installed version by default. So, again, installing
the newer version is the only upgrade step needed.
If you haven't suppressed script installation (using ``--exclude-scripts`` or
``-x``), then the upgraded version's scripts will be installed, and they will
be automatically patched to ``require()`` the corresponding version of the
package, so that you can use them even if they are installed in multi-version
mode.
``easy_install`` never actually deletes packages (unless you're installing a
package with the same name and version number as an existing package), so if
you want to get rid of older versions of a package, please see `Uninstalling
Packages`_, below.
Changing the Active Version
---------------------------
If you've upgraded a package, but need to revert to a previously-installed
version, you can do so like this::
easy_install PackageName==1.2.3
Where ``1.2.3`` is replaced by the exact version number you wish to switch to.
If a package matching the requested name and version is not already installed
in a directory on ``sys.path``, it will be located via PyPI and installed.
If you'd like to switch to the latest installed version of ``PackageName``, you
can do so like this::
easy_install PackageName
This will activate the latest installed version. (Note: if you have set any
``find_links`` via distutils configuration files, those download pages will be
checked for the latest available version of the package, and it will be
downloaded and installed if it is newer than your current version.)
Note that changing the active version of a package will install the newly
active version's scripts, unless the ``--exclude-scripts`` or ``-x`` option is
specified.
Uninstalling Packages
---------------------
If you have replaced a package with another version, then you can just delete
the package(s) you don't need by deleting the PackageName-versioninfo.egg file
or directory (found in the installation directory).
If you want to delete the currently installed version of a package (or all
versions of a package), you should first run::
easy_install -m PackageName
This will ensure that Python doesn't continue to search for a package you're
planning to remove. After you've done this, you can safely delete the .egg
files or directories, along with any scripts you wish to remove.
Managing Scripts
----------------
Whenever you install, upgrade, or change versions of a package, EasyInstall
automatically installs the scripts for the selected package version, unless
you tell it not to with ``-x`` or ``--exclude-scripts``. If any scripts in
the script directory have the same name, they are overwritten.
Thus, you do not normally need to manually delete scripts for older versions of
a package, unless the newer version of the package does not include a script
of the same name. However, if you are completely uninstalling a package, you
may wish to manually delete its scripts.
EasyInstall's default behavior means that you can normally only run scripts
from one version of a package at a time. If you want to keep multiple versions
of a script available, however, you can simply use the ``--multi-version`` or
``-m`` option, and rename the scripts that EasyInstall creates. This works
because EasyInstall installs scripts as short code stubs that ``require()`` the
matching version of the package the script came from, so renaming the script
has no effect on what it executes.
For example, suppose you want to use two versions of the ``rst2html`` tool
provided by the `docutils <http://docutils.sf.net/>`_ package. You might
first install one version::
easy_install -m docutils==0.3.9
then rename the ``rst2html.py`` to ``r2h_039``, and install another version::
easy_install -m docutils==0.3.10
This will create another ``rst2html.py`` script, this one using docutils
version 0.3.10 instead of 0.3.9. You now have two scripts, each using a
different version of the package. (Notice that we used ``-m`` for both
installations, so that Python won't lock us out of using anything but the most
recently-installed version of the package.)
Executables and Launchers
-------------------------
On Unix systems, scripts are installed with as natural files with a "#!"
header and no extension and they launch under the Python version indicated in
the header.
On Windows, there is no mechanism to "execute" files without extensions, so
EasyInstall provides two techniques to mirror the Unix behavior. The behavior
is indicated by the SETUPTOOLS_LAUNCHER environment variable, which may be
"executable" (default) or "natural".
Regardless of the technique used, the script(s) will be installed to a Scripts
directory (by default in the Python installation directory). It is recommended
for EasyInstall that you ensure this directory is in the PATH environment
variable. The easiest way to ensure the Scripts directory is in the PATH is
to run ``Tools\Scripts\win_add2path.py`` from the Python directory (requires
Python 2.6 or later).
Note that instead of changing your ``PATH`` to include the Python scripts
directory, you can also retarget the installation location for scripts so they
go on a directory that's already on the ``PATH``. For more information see
`Command-Line Options`_ and `Configuration Files`_. During installation,
pass command line options (such as ``--script-dir``) to
``ez_setup.py`` to control where ``easy_install.exe`` will be installed.
Windows Executable Launcher
~~~~~~~~~~~~~~~~~~~~~~~~~~~
If the "executable" launcher is used, EasyInstall will create a '.exe'
launcher of the same name beside each installed script (including
``easy_install`` itself). These small .exe files launch the script of the
same name using the Python version indicated in the '#!' header.
This behavior is currently default. To force
the use of executable launchers, set ``SETUPTOOLS_LAUNCHER`` to "executable".
Natural Script Launcher
~~~~~~~~~~~~~~~~~~~~~~~
EasyInstall also supports deferring to an external launcher such as
`pylauncher <https://bitbucket.org/pypa/pylauncher>`_ for launching scripts.
Enable this experimental functionality by setting the
``SETUPTOOLS_LAUNCHER`` environment variable to "natural". EasyInstall will
then install scripts as simple
scripts with a .pya (or .pyw) extension appended. If these extensions are
associated with the pylauncher and listed in the PATHEXT environment variable,
these scripts can then be invoked simply and directly just like any other
executable. This behavior may become default in a future version.
EasyInstall uses the .pya extension instead of simply
the typical '.py' extension. This distinct extension is necessary to prevent
Python
from treating the scripts as importable modules (where name conflicts exist).
Current releases of pylauncher do not yet associate with .pya files by
default, but future versions should do so.
Tips & Techniques
-----------------
Multiple Python Versions
~~~~~~~~~~~~~~~~~~~~~~~~
EasyInstall installs itself under two names:
``easy_install`` and ``easy_install-N.N``, where ``N.N`` is the Python version
used to install it. Thus, if you install EasyInstall for both Python 3.2 and
2.7, you can use the ``easy_install-3.2`` or ``easy_install-2.7`` scripts to
install packages for the respective Python version.
Setuptools also supplies easy_install as a runnable module which may be
invoked using ``python -m easy_install`` for any Python with Setuptools
installed.
Restricting Downloads with ``--allow-hosts``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can use the ``--allow-hosts`` (``-H``) option to restrict what domains
EasyInstall will look for links and downloads on. ``--allow-hosts=None``
prevents downloading altogether. You can also use wildcards, for example
to restrict downloading to hosts in your own intranet. See the section below
on `Command-Line Options`_ for more details on the ``--allow-hosts`` option.
By default, there are no host restrictions in effect, but you can change this
default by editing the appropriate `configuration files`_ and adding:
.. code-block:: ini
[easy_install]
allow_hosts = *.myintranet.example.com,*.python.org
The above example would then allow downloads only from hosts in the
``python.org`` and ``myintranet.example.com`` domains, unless overridden on the
command line.
Installing on Un-networked Machines
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Just copy the eggs or source packages you need to a directory on the target
machine, then use the ``-f`` or ``--find-links`` option to specify that
directory's location. For example::
easy_install -H None -f somedir SomePackage
will attempt to install SomePackage using only eggs and source packages found
in ``somedir`` and disallowing all remote access. You should of course make
sure you have all of SomePackage's dependencies available in somedir.
If you have another machine of the same operating system and library versions
(or if the packages aren't platform-specific), you can create the directory of
eggs using a command like this::
easy_install -zmaxd somedir SomePackage
This will tell EasyInstall to put zipped eggs or source packages for
SomePackage and all its dependencies into ``somedir``, without creating any
scripts or .pth files. You can then copy the contents of ``somedir`` to the
target machine. (``-z`` means zipped eggs, ``-m`` means multi-version, which
prevents .pth files from being used, ``-a`` means to copy all the eggs needed,
even if they're installed elsewhere on the machine, and ``-d`` indicates the
directory to place the eggs in.)
You can also build the eggs from local development packages that were installed
with the ``setup.py develop`` command, by including the ``-l`` option, e.g.::
easy_install -zmaxld somedir SomePackage
This will use locally-available source distributions to build the eggs.
Packaging Others' Projects As Eggs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Need to distribute a package that isn't published in egg form? You can use
EasyInstall to build eggs for a project. You'll want to use the ``--zip-ok``,
``--exclude-scripts``, and possibly ``--no-deps`` options (``-z``, ``-x`` and
``-N``, respectively). Use ``-d`` or ``--install-dir`` to specify the location
where you'd like the eggs placed. By placing them in a directory that is
published to the web, you can then make the eggs available for download, either
in an intranet or to the internet at large.
If someone distributes a package in the form of a single ``.py`` file, you can
wrap it in an egg by tacking an ``#egg=name-version`` suffix on the file's URL.
So, something like this::
easy_install -f "http://some.example.com/downloads/foo.py#egg=foo-1.0" foo
will install the package as an egg, and this::
easy_install -zmaxd. \
-f "http://some.example.com/downloads/foo.py#egg=foo-1.0" foo
will create a ``.egg`` file in the current directory.
Creating your own Package Index
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In addition to local directories and the Python Package Index, EasyInstall can
find download links on most any web page whose URL is given to the ``-f``
(``--find-links``) option. In the simplest case, you can simply have a web
page with links to eggs or Python source packages, even an automatically
generated directory listing (such as the Apache web server provides).
If you are setting up an intranet site for package downloads, you may want to
configure the target machines to use your download site by default, adding
something like this to their `configuration files`_:
.. code-block:: ini
[easy_install]
find_links = http://mypackages.example.com/somedir/
http://turbogears.org/download/
http://peak.telecommunity.com/dist/
As you can see, you can list multiple URLs separated by whitespace, continuing
on multiple lines if necessary (as long as the subsequent lines are indented.
If you are more ambitious, you can also create an entirely custom package index
or PyPI mirror. See the ``--index-url`` option under `Command-Line Options`_,
below, and also the section on `Package Index "API"`_.
Password-Protected Sites
------------------------
If a site you want to download from is password-protected using HTTP "Basic"
authentication, you can specify your credentials in the URL, like so::
http://some_userid:some_password@some.example.com/some_path/
You can do this with both index page URLs and direct download URLs. As long
as any HTML pages read by easy_install use *relative* links to point to the
downloads, the same user ID and password will be used to do the downloading.
Using .pypirc Credentials
-------------------------
In additional to supplying credentials in the URL, ``easy_install`` will also
honor credentials if present in the .pypirc file. Teams maintaining a private
repository of packages may already have defined access credentials for
uploading packages according to the distutils documentation. ``easy_install``
will attempt to honor those if present. Refer to the distutils documentation
for Python 2.5 or later for details on the syntax.
Controlling Build Options
~~~~~~~~~~~~~~~~~~~~~~~~~
EasyInstall respects standard distutils `Configuration Files`_, so you can use
them to configure build options for packages that it installs from source. For
example, if you are on Windows using the MinGW compiler, you can configure the
default compiler by putting something like this:
.. code-block:: ini
[build]
compiler = mingw32
into the appropriate distutils configuration file. In fact, since this is just
normal distutils configuration, it will affect any builds using that config
file, not just ones done by EasyInstall. For example, if you add those lines
to ``distutils.cfg`` in the ``distutils`` package directory, it will be the
default compiler for *all* packages you build. See `Configuration Files`_
below for a list of the standard configuration file locations, and links to
more documentation on using distutils configuration files.
Editing and Viewing Source Packages
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sometimes a package's source distribution contains additional documentation,
examples, configuration files, etc., that are not part of its actual code. If
you want to be able to examine these files, you can use the ``--editable``
option to EasyInstall, and EasyInstall will look for a source distribution
or Subversion URL for the package, then download and extract it or check it out
as a subdirectory of the ``--build-directory`` you specify. If you then wish
to install the package after editing or configuring it, you can do so by
rerunning EasyInstall with that directory as the target.
Note that using ``--editable`` stops EasyInstall from actually building or
installing the package; it just finds, obtains, and possibly unpacks it for
you. This allows you to make changes to the package if necessary, and to
either install it in development mode using ``setup.py develop`` (if the
package uses setuptools, that is), or by running ``easy_install projectdir``
(where ``projectdir`` is the subdirectory EasyInstall created for the
downloaded package.
In order to use ``--editable`` (``-e`` for short), you *must* also supply a
``--build-directory`` (``-b`` for short). The project will be placed in a
subdirectory of the build directory. The subdirectory will have the same
name as the project itself, but in all-lowercase. If a file or directory of
that name already exists, EasyInstall will print an error message and exit.
Also, when using ``--editable``, you cannot use URLs or filenames as arguments.
You *must* specify project names (and optional version requirements) so that
EasyInstall knows what directory name(s) to create. If you need to force
EasyInstall to use a particular URL or filename, you should specify it as a
``--find-links`` item (``-f`` for short), and then also specify
the project name, e.g.::
easy_install -eb ~/projects \
-fhttp://prdownloads.sourceforge.net/ctypes/ctypes-0.9.6.tar.gz?download \
ctypes==0.9.6
Dealing with Installation Conflicts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(NOTE: As of 0.6a11, this section is obsolete; it is retained here only so that
people using older versions of EasyInstall can consult it. As of version
0.6a11, installation conflicts are handled automatically without deleting the
old or system-installed packages, and without ignoring the issue. Instead,
eggs are automatically shifted to the front of ``sys.path`` using special
code added to the ``easy-install.pth`` file. So, if you are using version
0.6a11 or better of setuptools, you do not need to worry about conflicts,
and the following issues do not apply to you.)
EasyInstall installs distributions in a "managed" way, such that each
distribution can be independently activated or deactivated on ``sys.path``.
However, packages that were not installed by EasyInstall are "unmanaged",
in that they usually live all in one directory and cannot be independently
activated or deactivated.
As a result, if you are using EasyInstall to upgrade an existing package, or
to install a package with the same name as an existing package, EasyInstall
will warn you of the conflict. (This is an improvement over ``setup.py
install``, because the ``distutils`` just install new packages on top of old
ones, possibly combining two unrelated packages or leaving behind modules that
have been deleted in the newer version of the package.)
EasyInstall will stop the installation if it detects a conflict
between an existing, "unmanaged" package, and a module or package in any of
the distributions you're installing. It will display a list of all of the
existing files and directories that would need to be deleted for the new
package to be able to function correctly. To proceed, you must manually
delete these conflicting files and directories and re-run EasyInstall.
Of course, once you've replaced all of your existing "unmanaged" packages with
versions managed by EasyInstall, you won't have any more conflicts to worry
about!
Compressed Installation
~~~~~~~~~~~~~~~~~~~~~~~
EasyInstall tries to install packages in zipped form, if it can. Zipping
packages can improve Python's overall import performance if you're not using
the ``--multi-version`` option, because Python processes zipfile entries on
``sys.path`` much faster than it does directories.
As of version 0.5a9, EasyInstall analyzes packages to determine whether they
can be safely installed as a zipfile, and then acts on its analysis. (Previous
versions would not install a package as a zipfile unless you used the
``--zip-ok`` option.)
The current analysis approach is fairly conservative; it currently looks for:
* Any use of the ``__file__`` or ``__path__`` variables (which should be
replaced with ``pkg_resources`` API calls)
* Possible use of ``inspect`` functions that expect to manipulate source files
(e.g. ``inspect.getsource()``)
* Top-level modules that might be scripts used with ``python -m`` (Python 2.4)
If any of the above are found in the package being installed, EasyInstall will
assume that the package cannot be safely run from a zipfile, and unzip it to
a directory instead. You can override this analysis with the ``-zip-ok`` flag,
which will tell EasyInstall to install the package as a zipfile anyway. Or,
you can use the ``--always-unzip`` flag, in which case EasyInstall will always
unzip, even if its analysis says the package is safe to run as a zipfile.
Normally, however, it is simplest to let EasyInstall handle the determination
of whether to zip or unzip, and only specify overrides when needed to work
around a problem. If you find you need to override EasyInstall's guesses, you
may want to contact the package author and the EasyInstall maintainers, so that
they can make appropriate changes in future versions.
(Note: If a package uses ``setuptools`` in its setup script, the package author
has the option to declare the package safe or unsafe for zipped usage via the
``zip_safe`` argument to ``setup()``. If the package author makes such a
declaration, EasyInstall believes the package's author and does not perform its
own analysis. However, your command-line option, if any, will still override
the package author's choice.)
Reference Manual
================
Configuration Files
-------------------
(New in 0.4a2)
You may specify default options for EasyInstall using the standard
distutils configuration files, under the command heading ``easy_install``.
EasyInstall will look first for a ``setup.cfg`` file in the current directory,
then a ``~/.pydistutils.cfg`` or ``$HOME\\pydistutils.cfg`` (on Unix-like OSes
and Windows, respectively), and finally a ``distutils.cfg`` file in the
``distutils`` package directory. Here's a simple example:
.. code-block:: ini
[easy_install]
# set the default location to install packages
install_dir = /home/me/lib/python
# Notice that indentation can be used to continue an option
# value; this is especially useful for the "--find-links"
# option, which tells easy_install to use download links on
# these pages before consulting PyPI:
#
find_links = http://sqlobject.org/
http://peak.telecommunity.com/dist/
In addition to accepting configuration for its own options under
``[easy_install]``, EasyInstall also respects defaults specified for other
distutils commands. For example, if you don't set an ``install_dir`` for
``[easy_install]``, but *have* set an ``install_lib`` for the ``[install]``
command, this will become EasyInstall's default installation directory. Thus,
if you are already using distutils configuration files to set default install
locations, build options, etc., EasyInstall will respect your existing settings
until and unless you override them explicitly in an ``[easy_install]`` section.
For more information, see also the current Python documentation on the `use and
location of distutils configuration files <https://docs.python.org/install/index.html#inst-config-files>`_.
Notice that ``easy_install`` will use the ``setup.cfg`` from the current
working directory only if it was triggered from ``setup.py`` through the
``install_requires`` option. The standalone command will not use that file.
Command-Line Options
--------------------
``--zip-ok, -z``
Install all packages as zip files, even if they are marked as unsafe for
running as a zipfile. This can be useful when EasyInstall's analysis
of a non-setuptools package is too conservative, but keep in mind that
the package may not work correctly. (Changed in 0.5a9; previously this
option was required in order for zipped installation to happen at all.)
``--always-unzip, -Z``
Don't install any packages as zip files, even if the packages are marked
as safe for running as a zipfile. This can be useful if a package does
something unsafe, but not in a way that EasyInstall can easily detect.
EasyInstall's default analysis is currently very conservative, however, so
you should only use this option if you've had problems with a particular
package, and *after* reporting the problem to the package's maintainer and
to the EasyInstall maintainers.
(Note: the ``-z/-Z`` options only affect the installation of newly-built
or downloaded packages that are not already installed in the target
directory; if you want to convert an existing installed version from
zipped to unzipped or vice versa, you'll need to delete the existing
version first, and re-run EasyInstall.)
``--multi-version, -m``
"Multi-version" mode. Specifying this option prevents ``easy_install`` from
adding an ``easy-install.pth`` entry for the package being installed, and
if an entry for any version the package already exists, it will be removed
upon successful installation. In multi-version mode, no specific version of
the package is available for importing, unless you use
``pkg_resources.require()`` to put it on ``sys.path``. This can be as
simple as::
from pkg_resources import require
require("SomePackage", "OtherPackage", "MyPackage")
which will put the latest installed version of the specified packages on
``sys.path`` for you. (For more advanced uses, like selecting specific
versions and enabling optional dependencies, see the ``pkg_resources`` API
doc.)
Changed in 0.6a10: this option is no longer silently enabled when
installing to a non-PYTHONPATH, non-"site" directory. You must always
explicitly use this option if you want it to be active.
``--upgrade, -U`` (New in 0.5a4)
By default, EasyInstall only searches online if a project/version
requirement can't be met by distributions already installed
on sys.path or the installation directory. However, if you supply the
``--upgrade`` or ``-U`` flag, EasyInstall will always check the package
index and ``--find-links`` URLs before selecting a version to install. In
this way, you can force EasyInstall to use the latest available version of
any package it installs (subject to any version requirements that might
exclude such later versions).
``--install-dir=DIR, -d DIR``
Set the installation directory. It is up to you to ensure that this
directory is on ``sys.path`` at runtime, and to use
``pkg_resources.require()`` to enable the installed package(s) that you
need.
(New in 0.4a2) If this option is not directly specified on the command line
or in a distutils configuration file, the distutils default installation
location is used. Normally, this would be the ``site-packages`` directory,
but if you are using distutils configuration files, setting things like
``prefix`` or ``install_lib``, then those settings are taken into
account when computing the default installation directory, as is the
``--prefix`` option.
``--script-dir=DIR, -s DIR``
Set the script installation directory. If you don't supply this option
(via the command line or a configuration file), but you *have* supplied
an ``--install-dir`` (via command line or config file), then this option
defaults to the same directory, so that the scripts will be able to find
their associated package installation. Otherwise, this setting defaults
to the location where the distutils would normally install scripts, taking
any distutils configuration file settings into account.
``--exclude-scripts, -x``
Don't install scripts. This is useful if you need to install multiple
versions of a package, but do not want to reset the version that will be
run by scripts that are already installed.
``--user`` (New in 0.6.11)
Use the user-site-packages as specified in :pep:`370`
instead of the global site-packages.
``--always-copy, -a`` (New in 0.5a4)
Copy all needed distributions to the installation directory, even if they
are already present in a directory on sys.path. In older versions of
EasyInstall, this was the default behavior, but now you must explicitly
request it. By default, EasyInstall will no longer copy such distributions
from other sys.path directories to the installation directory, unless you
explicitly gave the distribution's filename on the command line.
Note that as of 0.6a10, using this option excludes "system" and
"development" eggs from consideration because they can't be reliably
copied. This may cause EasyInstall to choose an older version of a package
than what you expected, or it may cause downloading and installation of a
fresh copy of something that's already installed. You will see warning
messages for any eggs that EasyInstall skips, before it falls back to an
older version or attempts to download a fresh copy.
``--find-links=URLS_OR_FILENAMES, -f URLS_OR_FILENAMES``
Scan the specified "download pages" or directories for direct links to eggs
or other distributions. Any existing file or directory names or direct
download URLs are immediately added to EasyInstall's search cache, and any
indirect URLs (ones that don't point to eggs or other recognized archive
formats) are added to a list of additional places to search for download
links. As soon as EasyInstall has to go online to find a package (either
because it doesn't exist locally, or because ``--upgrade`` or ``-U`` was
used), the specified URLs will be downloaded and scanned for additional
direct links.
Eggs and archives found by way of ``--find-links`` are only downloaded if
they are needed to meet a requirement specified on the command line; links
to unneeded packages are ignored.
If all requested packages can be found using links on the specified
download pages, the Python Package Index will not be consulted unless you
also specified the ``--upgrade`` or ``-U`` option.
(Note: if you want to refer to a local HTML file containing links, you must
use a ``file:`` URL, as filenames that do not refer to a directory, egg, or
archive are ignored.)
You may specify multiple URLs or file/directory names with this option,
separated by whitespace. Note that on the command line, you will probably
have to surround the URL list with quotes, so that it is recognized as a
single option value. You can also specify URLs in a configuration file;
see `Configuration Files`_, above.
Changed in 0.6a10: previously all URLs and directories passed to this
option were scanned as early as possible, but from 0.6a10 on, only
directories and direct archive links are scanned immediately; URLs are not
retrieved unless a package search was already going to go online due to a
package not being available locally, or due to the use of the ``--update``
or ``-U`` option.
``--no-find-links`` Blocks the addition of any link.
This parameter is useful if you want to avoid adding links defined in a
project easy_install is installing (whether it's a requested project or a
dependency). When used, ``--find-links`` is ignored.
Added in Distribute 0.6.11 and Setuptools 0.7.
``--index-url=URL, -i URL`` (New in 0.4a1; default changed in 0.6c7)
Specifies the base URL of the Python Package Index. The default is
https://pypi.python.org/simple if not specified. When a package is requested
that is not locally available or linked from a ``--find-links`` download
page, the package index will be searched for download pages for the needed
package, and those download pages will be searched for links to download
an egg or source distribution.
``--editable, -e`` (New in 0.6a1)
Only find and download source distributions for the specified projects,
unpacking them to subdirectories of the specified ``--build-directory``.
EasyInstall will not actually build or install the requested projects or
their dependencies; it will just find and extract them for you. See
`Editing and Viewing Source Packages`_ above for more details.
``--build-directory=DIR, -b DIR`` (UPDATED in 0.6a1)
Set the directory used to build source packages. If a package is built
from a source distribution or checkout, it will be extracted to a
subdirectory of the specified directory. The subdirectory will have the
same name as the extracted distribution's project, but in all-lowercase.
If a file or directory of that name already exists in the given directory,
a warning will be printed to the console, and the build will take place in
a temporary directory instead.
This option is most useful in combination with the ``--editable`` option,
which forces EasyInstall to *only* find and extract (but not build and
install) source distributions. See `Editing and Viewing Source Packages`_,
above, for more information.
``--verbose, -v, --quiet, -q`` (New in 0.4a4)
Control the level of detail of EasyInstall's progress messages. The
default detail level is "info", which prints information only about
relatively time-consuming operations like running a setup script, unpacking
an archive, or retrieving a URL. Using ``-q`` or ``--quiet`` drops the
detail level to "warn", which will only display installation reports,
warnings, and errors. Using ``-v`` or ``--verbose`` increases the detail
level to include individual file-level operations, link analysis messages,
and distutils messages from any setup scripts that get run. If you include
the ``-v`` option more than once, the second and subsequent uses are passed
down to any setup scripts, increasing the verbosity of their reporting as
well.
``--dry-run, -n`` (New in 0.4a4)
Don't actually install the package or scripts. This option is passed down
to any setup scripts run, so packages should not actually build either.
This does *not* skip downloading, nor does it skip extracting source
distributions to a temporary/build directory.
``--optimize=LEVEL``, ``-O LEVEL`` (New in 0.4a4)
If you are installing from a source distribution, and are *not* using the
``--zip-ok`` option, this option controls the optimization level for
compiling installed ``.py`` files to ``.pyo`` files. It does not affect
the compilation of modules contained in ``.egg`` files, only those in
``.egg`` directories. The optimization level can be set to 0, 1, or 2;
the default is 0 (unless it's set under ``install`` or ``install_lib`` in
one of your distutils configuration files).
``--record=FILENAME`` (New in 0.5a4)
Write a record of all installed files to FILENAME. This is basically the
same as the same option for the standard distutils "install" command, and
is included for compatibility with tools that expect to pass this option
to "setup.py install".
``--site-dirs=DIRLIST, -S DIRLIST`` (New in 0.6a1)
Specify one or more custom "site" directories (separated by commas).
"Site" directories are directories where ``.pth`` files are processed, such
as the main Python ``site-packages`` directory. As of 0.6a10, EasyInstall
automatically detects whether a given directory processes ``.pth`` files
(or can be made to do so), so you should not normally need to use this
option. It is is now only necessary if you want to override EasyInstall's
judgment and force an installation directory to be treated as if it
supported ``.pth`` files.
``--no-deps, -N`` (New in 0.6a6)
Don't install any dependencies. This is intended as a convenience for
tools that wrap eggs in a platform-specific packaging system. (We don't
recommend that you use it for anything else.)
``--allow-hosts=PATTERNS, -H PATTERNS`` (New in 0.6a6)
Restrict downloading and spidering to hosts matching the specified glob
patterns. E.g. ``-H *.python.org`` restricts web access so that only
packages listed and downloadable from machines in the ``python.org``
domain. The glob patterns must match the *entire* user/host/port section of
the target URL(s). For example, ``*.python.org`` will NOT accept a URL
like ``http://python.org/foo`` or ``http://www.python.org:8080/``.
Multiple patterns can be specified by separating them with commas. The
default pattern is ``*``, which matches anything.
In general, this option is mainly useful for blocking EasyInstall's web
access altogether (e.g. ``-Hlocalhost``), or to restrict it to an intranet
or other trusted site. EasyInstall will do the best it can to satisfy
dependencies given your host restrictions, but of course can fail if it
can't find suitable packages. EasyInstall displays all blocked URLs, so
that you can adjust your ``--allow-hosts`` setting if it is more strict
than you intended. Some sites may wish to define a restrictive default
setting for this option in their `configuration files`_, and then manually
override the setting on the command line as needed.
``--prefix=DIR`` (New in 0.6a10)
Use the specified directory as a base for computing the default
installation and script directories. On Windows, the resulting default
directories will be ``prefix\\Lib\\site-packages`` and ``prefix\\Scripts``,
while on other platforms the defaults will be
``prefix/lib/python2.X/site-packages`` (with the appropriate version
substituted) for libraries and ``prefix/bin`` for scripts.
Note that the ``--prefix`` option only sets the *default* installation and
script directories, and does not override the ones set on the command line
or in a configuration file.
``--local-snapshots-ok, -l`` (New in 0.6c6)
Normally, EasyInstall prefers to only install *released* versions of
projects, not in-development ones, because such projects may not
have a currently-valid version number. So, it usually only installs them
when their ``setup.py`` directory is explicitly passed on the command line.
However, if this option is used, then any in-development projects that were
installed using the ``setup.py develop`` command, will be used to build
eggs, effectively upgrading the "in-development" project to a snapshot
release. Normally, this option is used only in conjunction with the
``--always-copy`` option to create a distributable snapshot of every egg
needed to run an application.
Note that if you use this option, you must make sure that there is a valid
version number (such as an SVN revision number tag) for any in-development
projects that may be used, as otherwise EasyInstall may not be able to tell
what version of the project is "newer" when future installations or
upgrades are attempted.
.. _non-root installation:
Custom Installation Locations
-----------------------------
By default, EasyInstall installs python packages into Python's main ``site-packages`` directory,
and manages them using a custom ``.pth`` file in that same directory.
Very often though, a user or developer wants ``easy_install`` to install and manage python packages
in an alternative location, usually for one of 3 reasons:
1. They don't have access to write to the main Python site-packages directory.
2. They want a user-specific stash of packages, that is not visible to other users.
3. They want to isolate a set of packages to a specific python application, usually to minimize
the possibility of version conflicts.
Historically, there have been many approaches to achieve custom installation.
The following section lists only the easiest and most relevant approaches [1]_.
`Use the "--user" option`_
`Use the "--user" option and customize "PYTHONUSERBASE"`_
`Use "virtualenv"`_
.. [1] There are older ways to achieve custom installation using various ``easy_install`` and ``setup.py install`` options, combined with ``PYTHONPATH`` and/or ``PYTHONUSERBASE`` alterations, but all of these are effectively deprecated by the User scheme brought in by `PEP-370`_ in Python 2.6.
.. _PEP-370: http://www.python.org/dev/peps/pep-0370/
Use the "--user" option
~~~~~~~~~~~~~~~~~~~~~~~
With Python 2.6 came the User scheme for installation, which means that all
python distributions support an alternative install location that is specific to a user [2]_ [3]_.
The Default location for each OS is explained in the python documentation
for the ``site.USER_BASE`` variable. This mode of installation can be turned on by
specifying the ``--user`` option to ``setup.py install`` or ``easy_install``.
This approach serves the need to have a user-specific stash of packages.
.. [2] Prior to Python2.6, Mac OS X offered a form of the User scheme. That is now subsumed into the User scheme introduced in Python 2.6.
.. [3] Prior to the User scheme, there was the Home scheme, which is still available, but requires more effort than the User scheme to get packages recognized.
Use the "--user" option and customize "PYTHONUSERBASE"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The User scheme install location can be customized by setting the ``PYTHONUSERBASE`` environment
variable, which updates the value of ``site.USER_BASE``. To isolate packages to a specific
application, simply set the OS environment of that application to a specific value of
``PYTHONUSERBASE``, that contains just those packages.
Use "virtualenv"
~~~~~~~~~~~~~~~~
"virtualenv" is a 3rd-party python package that effectively "clones" a python installation, thereby
creating an isolated location to install packages. The evolution of "virtualenv" started before the existence
of the User installation scheme. "virtualenv" provides a version of ``easy_install`` that is
scoped to the cloned python install and is used in the normal way. "virtualenv" does offer various features
that the User installation scheme alone does not provide, e.g. the ability to hide the main python site-packages.
Please refer to the `virtualenv`_ documentation for more details.
.. _virtualenv: https://pypi.python.org/pypi/virtualenv
Package Index "API"
-------------------
Custom package indexes (and PyPI) must follow the following rules for
EasyInstall to be able to look up and download packages:
1. Except where stated otherwise, "pages" are HTML or XHTML, and "links"
refer to ``href`` attributes.
2. Individual project version pages' URLs must be of the form
``base/projectname/version``, where ``base`` is the package index's base URL.
3. Omitting the ``/version`` part of a project page's URL (but keeping the
trailing ``/``) should result in a page that is either:
a) The single active version of that project, as though the version had been
explicitly included, OR
b) A page with links to all of the active version pages for that project.
4. Individual project version pages should contain direct links to downloadable
distributions where possible. It is explicitly permitted for a project's
"long_description" to include URLs, and these should be formatted as HTML
links by the package index, as EasyInstall does no special processing to
identify what parts of a page are index-specific and which are part of the
project's supplied description.
5. Where available, MD5 information should be added to download URLs by
appending a fragment identifier of the form ``#md5=...``, where ``...`` is
the 32-character hex MD5 digest. EasyInstall will verify that the
downloaded file's MD5 digest matches the given value.
6. Individual project version pages should identify any "homepage" or
"download" URLs using ``rel="homepage"`` and ``rel="download"`` attributes
on the HTML elements linking to those URLs. Use of these attributes will
cause EasyInstall to always follow the provided links, unless it can be
determined by inspection that they are downloadable distributions. If the
links are not to downloadable distributions, they are retrieved, and if they
are HTML, they are scanned for download links. They are *not* scanned for
additional "homepage" or "download" links, as these are only processed for
pages that are part of a package index site.
7. The root URL of the index, if retrieved with a trailing ``/``, must result
in a page containing links to *all* projects' active version pages.
(Note: This requirement is a workaround for the absence of case-insensitive
``safe_name()`` matching of project names in URL paths. If project names are
matched in this fashion (e.g. via the PyPI server, mod_rewrite, or a similar
mechanism), then it is not necessary to include this all-packages listing
page.)
8. If a package index is accessed via a ``file://`` URL, then EasyInstall will
automatically use ``index.html`` files, if present, when trying to read a
directory with a trailing ``/`` on the URL.
Backward Compatibility
~~~~~~~~~~~~~~~~~~~~~~
Package indexes that wish to support setuptools versions prior to 0.6b4 should
also follow these rules:
* Homepage and download links must be preceded with ``"<th>Home Page"`` or
``"<th>Download URL"``, in addition to (or instead of) the ``rel=""``
attributes on the actual links. These marker strings do not need to be
visible, or uncommented, however! For example, the following is a valid
homepage link that will work with any version of setuptools::
<li>
<strong>Home Page:</strong>
<!-- <th>Home Page -->
<a rel="homepage" href="http://sqlobject.org">http://sqlobject.org</a>
</li>
Even though the marker string is in an HTML comment, older versions of
EasyInstall will still "see" it and know that the link that follows is the
project's home page URL.
* The pages described by paragraph 3(b) of the preceding section *must*
contain the string ``"Index of Packages</title>"`` somewhere in their text.
This can be inside of an HTML comment, if desired, and it can be anywhere
in the page. (Note: this string MUST NOT appear on normal project pages, as
described in paragraphs 2 and 3(a)!)
In addition, for compatibility with PyPI versions that do not use ``#md5=``
fragment IDs, EasyInstall uses the following regular expression to match PyPI's
displayed MD5 info (broken onto two lines for readability)::
<a href="([^"#]+)">([^<]+)</a>\n\s+\(<a href="[^?]+\?:action=show_md5
&digest=([0-9a-f]{32})">md5</a>\)
History
=======
0.6c9
* Fixed ``win32.exe`` support for .pth files, so unnecessary directory nesting
is flattened out in the resulting egg. (There was a case-sensitivity
problem that affected some distributions, notably ``pywin32``.)
* Prevent ``--help-commands`` and other junk from showing under Python 2.5
when running ``easy_install --help``.
* Fixed GUI scripts sometimes not executing on Windows
* Fixed not picking up dependency links from recursive dependencies.
* Only make ``.py``, ``.dll`` and ``.so`` files executable when unpacking eggs
* Changes for Jython compatibility
* Improved error message when a requirement is also a directory name, but the
specified directory is not a source package.
* Fixed ``--allow-hosts`` option blocking ``file:`` URLs
* Fixed HTTP SVN detection failing when the page title included a project
name (e.g. on SourceForge-hosted SVN)
* Fix Jython script installation to handle ``#!`` lines better when
``sys.executable`` is a script.
* Removed use of deprecated ``md5`` module if ``hashlib`` is available
* Keep site directories (e.g. ``site-packages``) from being included in
``.pth`` files.
0.6c7
* ``ftp:`` download URLs now work correctly.
* The default ``--index-url`` is now ``https://pypi.python.org/simple``, to use
the Python Package Index's new simpler (and faster!) REST API.
0.6c6
* EasyInstall no longer aborts the installation process if a URL it wants to
retrieve can't be downloaded, unless the URL is an actual package download.
Instead, it issues a warning and tries to keep going.
* Fixed distutils-style scripts originally built on Windows having their line
endings doubled when installed on any platform.
* Added ``--local-snapshots-ok`` flag, to allow building eggs from projects
installed using ``setup.py develop``.
* Fixed not HTML-decoding URLs scraped from web pages
0.6c5
* Fixed ``.dll`` files on Cygwin not having executable permissions when an egg
is installed unzipped.
0.6c4
* Added support for HTTP "Basic" authentication using ``http://user:pass@host``
URLs. If a password-protected page contains links to the same host (and
protocol), those links will inherit the credentials used to access the
original page.
* Removed all special support for Sourceforge mirrors, as Sourceforge's
mirror system now works well for non-browser downloads.
* Fixed not recognizing ``win32.exe`` installers that included a custom
bitmap.
* Fixed not allowing ``os.open()`` of paths outside the sandbox, even if they
are opened read-only (e.g. reading ``/dev/urandom`` for random numbers, as
is done by ``os.urandom()`` on some platforms).
* Fixed a problem with ``.pth`` testing on Windows when ``sys.executable``
has a space in it (e.g., the user installed Python to a ``Program Files``
directory).
0.6c3
* You can once again use "python -m easy_install" with Python 2.4 and above.
* Python 2.5 compatibility fixes added.
0.6c2
* Windows script wrappers now support quoted arguments and arguments
containing spaces. (Patch contributed by Jim Fulton.)
* The ``ez_setup.py`` script now actually works when you put a setuptools
``.egg`` alongside it for bootstrapping an offline machine.
* A writable installation directory on ``sys.path`` is no longer required to
download and extract a source distribution using ``--editable``.
* Generated scripts now use ``-x`` on the ``#!`` line when ``sys.executable``
contains non-ASCII characters, to prevent deprecation warnings about an
unspecified encoding when the script is run.
0.6c1
* EasyInstall now includes setuptools version information in the
``User-Agent`` string sent to websites it visits.
0.6b4
* Fix creating Python wrappers for non-Python scripts
* Fix ``ftp://`` directory listing URLs from causing a crash when used in the
"Home page" or "Download URL" slots on PyPI.
* Fix ``sys.path_importer_cache`` not being updated when an existing zipfile
or directory is deleted/overwritten.
* Fix not recognizing HTML 404 pages from package indexes.
* Allow ``file://`` URLs to be used as a package index. URLs that refer to
directories will use an internally-generated directory listing if there is
no ``index.html`` file in the directory.
* Allow external links in a package index to be specified using
``rel="homepage"`` or ``rel="download"``, without needing the old
PyPI-specific visible markup.
* Suppressed warning message about possibly-misspelled project name, if an egg
or link for that project name has already been seen.
0.6b3
* Fix local ``--find-links`` eggs not being copied except with
``--always-copy``.
* Fix sometimes not detecting local packages installed outside of "site"
directories.
* Fix mysterious errors during initial ``setuptools`` install, caused by
``ez_setup`` trying to run ``easy_install`` twice, due to a code fallthru
after deleting the egg from which it's running.
0.6b2
* Don't install or update a ``site.py`` patch when installing to a
``PYTHONPATH`` directory with ``--multi-version``, unless an
``easy-install.pth`` file is already in use there.
* Construct ``.pth`` file paths in such a way that installing an egg whose
name begins with ``import`` doesn't cause a syntax error.
* Fixed a bogus warning message that wasn't updated since the 0.5 versions.
0.6b1
* Better ambiguity management: accept ``#egg`` name/version even if processing
what appears to be a correctly-named distutils file, and ignore ``.egg``
files with no ``-``, since valid Python ``.egg`` files always have a version
number (but Scheme eggs often don't).
* Support ``file://`` links to directories in ``--find-links``, so that
easy_install can build packages from local source checkouts.
* Added automatic retry for Sourceforge mirrors. The new download process is
to first just try dl.sourceforge.net, then randomly select mirror IPs and
remove ones that fail, until something works. The removed IPs stay removed
for the remainder of the run.
* Ignore bdist_dumb distributions when looking at download URLs.
0.6a11
* Process ``dependency_links.txt`` if found in a distribution, by adding the
URLs to the list for scanning.
* Use relative paths in ``.pth`` files when eggs are being installed to the
same directory as the ``.pth`` file. This maximizes portability of the
target directory when building applications that contain eggs.
* Added ``easy_install-N.N`` script(s) for convenience when using multiple
Python versions.
* Added automatic handling of installation conflicts. Eggs are now shifted to
the front of sys.path, in an order consistent with where they came from,
making EasyInstall seamlessly co-operate with system package managers.
The ``--delete-conflicting`` and ``--ignore-conflicts-at-my-risk`` options
are now no longer necessary, and will generate warnings at the end of a
run if you use them.
* Don't recursively traverse subdirectories given to ``--find-links``.
0.6a10
* Added exhaustive testing of the install directory, including a spawn test
for ``.pth`` file support, and directory writability/existence checks. This
should virtually eliminate the need to set or configure ``--site-dirs``.
* Added ``--prefix`` option for more do-what-I-mean-ishness in the absence of
RTFM-ing. :)
* Enhanced ``PYTHONPATH`` support so that you don't have to put any eggs on it
manually to make it work. ``--multi-version`` is no longer a silent
default; you must explicitly use it if installing to a non-PYTHONPATH,
non-"site" directory.
* Expand ``$variables`` used in the ``--site-dirs``, ``--build-directory``,
``--install-dir``, and ``--script-dir`` options, whether on the command line
or in configuration files.
* Improved SourceForge mirror processing to work faster and be less affected
by transient HTML changes made by SourceForge.
* PyPI searches now use the exact spelling of requirements specified on the
command line or in a project's ``install_requires``. Previously, a
normalized form of the name was used, which could lead to unnecessary
full-index searches when a project's name had an underscore (``_``) in it.
* EasyInstall can now download bare ``.py`` files and wrap them in an egg,
as long as you include an ``#egg=name-version`` suffix on the URL, or if
the ``.py`` file is listed as the "Download URL" on the project's PyPI page.
This allows third parties to "package" trivial Python modules just by
linking to them (e.g. from within their own PyPI page or download links
page).
* The ``--always-copy`` option now skips "system" and "development" eggs since
they can't be reliably copied. Note that this may cause EasyInstall to
choose an older version of a package than what you expected, or it may cause
downloading and installation of a fresh version of what's already installed.
* The ``--find-links`` option previously scanned all supplied URLs and
directories as early as possible, but now only directories and direct
archive links are scanned immediately. URLs are not retrieved unless a
package search was already going to go online due to a package not being
available locally, or due to the use of the ``--update`` or ``-U`` option.
* Fixed the annoying ``--help-commands`` wart.
0.6a9
* Fixed ``.pth`` file processing picking up nested eggs (i.e. ones inside
"baskets") when they weren't explicitly listed in the ``.pth`` file.
* If more than one URL appears to describe the exact same distribution, prefer
the shortest one. This helps to avoid "table of contents" CGI URLs like the
ones on effbot.org.
* Quote arguments to python.exe (including python's path) to avoid problems
when Python (or a script) is installed in a directory whose name contains
spaces on Windows.
* Support full roundtrip translation of eggs to and from ``bdist_wininst``
format. Running ``bdist_wininst`` on a setuptools-based package wraps the
egg in an .exe that will safely install it as an egg (i.e., with metadata
and entry-point wrapper scripts), and ``easy_install`` can turn the .exe
back into an ``.egg`` file or directory and install it as such.
0.6a8
* Update for changed SourceForge mirror format
* Fixed not installing dependencies for some packages fetched via Subversion
* Fixed dependency installation with ``--always-copy`` not using the same
dependency resolution procedure as other operations.
* Fixed not fully removing temporary directories on Windows, if a Subversion
checkout left read-only files behind
* Fixed some problems building extensions when Pyrex was installed, especially
with Python 2.4 and/or packages using SWIG.
0.6a7
* Fixed not being able to install Windows script wrappers using Python 2.3
0.6a6
* Added support for "traditional" PYTHONPATH-based non-root installation, and
also the convenient ``virtual-python.py`` script, based on a contribution
by Ian Bicking. The setuptools egg now contains a hacked ``site`` module
that makes the PYTHONPATH-based approach work with .pth files, so that you
can get the full EasyInstall feature set on such installations.
* Added ``--no-deps`` and ``--allow-hosts`` options.
* Improved Windows ``.exe`` script wrappers so that the script can have the
same name as a module without confusing Python.
* Changed dependency processing so that it's breadth-first, allowing a
depender's preferences to override those of a dependee, to prevent conflicts
when a lower version is acceptable to the dependee, but not the depender.
Also, ensure that currently installed/selected packages aren't given
precedence over ones desired by a package being installed, which could
cause conflict errors.
0.6a3
* Improved error message when trying to use old ways of running
``easy_install``. Removed the ability to run via ``python -m`` or by
running ``easy_install.py``; ``easy_install`` is the command to run on all
supported platforms.
* Improved wrapper script generation and runtime initialization so that a
VersionConflict doesn't occur if you later install a competing version of a
needed package as the default version of that package.
* Fixed a problem parsing version numbers in ``#egg=`` links.
0.6a2
* EasyInstall can now install "console_scripts" defined by packages that use
``setuptools`` and define appropriate entry points. On Windows, console
scripts get an ``.exe`` wrapper so you can just type their name. On other
platforms, the scripts are installed without a file extension.
* Using ``python -m easy_install`` or running ``easy_install.py`` is now
DEPRECATED, since an ``easy_install`` wrapper is now available on all
platforms.
0.6a1
* EasyInstall now does MD5 validation of downloads from PyPI, or from any link
that has an "#md5=..." trailer with a 32-digit lowercase hex md5 digest.
* EasyInstall now handles symlinks in target directories by removing the link,
rather than attempting to overwrite the link's destination. This makes it
easier to set up an alternate Python "home" directory (as described above in
the `Non-Root Installation`_ section).
* Added support for handling MacOS platform information in ``.egg`` filenames,
based on a contribution by Kevin Dangoor. You may wish to delete and
reinstall any eggs whose filename includes "darwin" and "Power_Macintosh",
because the format for this platform information has changed so that minor
OS X upgrades (such as 10.4.1 to 10.4.2) do not cause eggs built with a
previous OS version to become obsolete.
* easy_install's dependency processing algorithms have changed. When using
``--always-copy``, it now ensures that dependencies are copied too. When
not using ``--always-copy``, it tries to use a single resolution loop,
rather than recursing.
* Fixed installing extra ``.pyc`` or ``.pyo`` files for scripts with ``.py``
extensions.
* Added ``--site-dirs`` option to allow adding custom "site" directories.
Made ``easy-install.pth`` work in platform-specific alternate site
directories (e.g. ``~/Library/Python/2.x/site-packages`` on Mac OS X).
* If you manually delete the current version of a package, the next run of
EasyInstall against the target directory will now remove the stray entry
from the ``easy-install.pth`` file.
* EasyInstall now recognizes URLs with a ``#egg=project_name`` fragment ID
as pointing to the named project's source checkout. Such URLs have a lower
match precedence than any other kind of distribution, so they'll only be
used if they have a higher version number than any other available
distribution, or if you use the ``--editable`` option. The ``#egg``
fragment can contain a version if it's formatted as ``#egg=proj-ver``,
where ``proj`` is the project name, and ``ver`` is the version number. You
*must* use the format for these values that the ``bdist_egg`` command uses;
i.e., all non-alphanumeric runs must be condensed to single underscore
characters.
* Added the ``--editable`` option; see `Editing and Viewing Source Packages`_
above for more info. Also, slightly changed the behavior of the
``--build-directory`` option.
* Fixed the setup script sandbox facility not recognizing certain paths as
valid on case-insensitive platforms.
0.5a12
* Fix ``python -m easy_install`` not working due to setuptools being installed
as a zipfile. Update safety scanner to check for modules that might be used
as ``python -m`` scripts.
* Misc. fixes for win32.exe support, including changes to support Python 2.4's
changed ``bdist_wininst`` format.
0.5a10
* Put the ``easy_install`` module back in as a module, as it's needed for
``python -m`` to run it!
* Allow ``--find-links/-f`` to accept local directories or filenames as well
as URLs.
0.5a9
* EasyInstall now automatically detects when an "unmanaged" package or
module is going to be on ``sys.path`` ahead of a package you're installing,
thereby preventing the newer version from being imported. By default, it
will abort installation to alert you of the problem, but there are also
new options (``--delete-conflicting`` and ``--ignore-conflicts-at-my-risk``)
available to change the default behavior. (Note: this new feature doesn't
take effect for egg files that were built with older ``setuptools``
versions, because they lack the new metadata file required to implement it.)
* The ``easy_install`` distutils command now uses ``DistutilsError`` as its
base error type for errors that should just issue a message to stderr and
exit the program without a traceback.
* EasyInstall can now be given a path to a directory containing a setup
script, and it will attempt to build and install the package there.
* EasyInstall now performs a safety analysis on module contents to determine
whether a package is likely to run in zipped form, and displays
information about what modules may be doing introspection that would break
when running as a zipfile.
* Added the ``--always-unzip/-Z`` option, to force unzipping of packages that
would ordinarily be considered safe to unzip, and changed the meaning of
``--zip-ok/-z`` to "always leave everything zipped".
0.5a8
* There is now a separate documentation page for `setuptools`_; revision
history that's not specific to EasyInstall has been moved to that page.
.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools
0.5a5
* Made ``easy_install`` a standard ``setuptools`` command, moving it from
the ``easy_install`` module to ``setuptools.command.easy_install``. Note
that if you were importing or extending it, you must now change your imports
accordingly. ``easy_install.py`` is still installed as a script, but not as
a module.
0.5a4
* Added ``--always-copy/-a`` option to always copy needed packages to the
installation directory, even if they're already present elsewhere on
sys.path. (In previous versions, this was the default behavior, but now
you must request it.)
* Added ``--upgrade/-U`` option to force checking PyPI for latest available
version(s) of all packages requested by name and version, even if a matching
version is available locally.
* Added automatic installation of dependencies declared by a distribution
being installed. These dependencies must be listed in the distribution's
``EGG-INFO`` directory, so the distribution has to have declared its
dependencies by using setuptools. If a package has requirements it didn't
declare, you'll still have to deal with them yourself. (E.g., by asking
EasyInstall to find and install them.)
* Added the ``--record`` option to ``easy_install`` for the benefit of tools
that run ``setup.py install --record=filename`` on behalf of another
packaging system.)
0.5a3
* Fixed not setting script permissions to allow execution.
* Improved sandboxing so that setup scripts that want a temporary directory
(e.g. pychecker) can still run in the sandbox.
0.5a2
* Fix stupid stupid refactoring-at-the-last-minute typos. :(
0.5a1
* Added support for converting ``.win32.exe`` installers to eggs on the fly.
EasyInstall will now recognize such files by name and install them.
* Fixed a problem with picking the "best" version to install (versions were
being sorted as strings, rather than as parsed values)
0.4a4
* Added support for the distutils "verbose/quiet" and "dry-run" options, as
well as the "optimize" flag.
* Support downloading packages that were uploaded to PyPI (by scanning all
links on package pages, not just the homepage/download links).
0.4a3
* Add progress messages to the search/download process so that you can tell
what URLs it's reading to find download links. (Hopefully, this will help
people report out-of-date and broken links to package authors, and to tell
when they've asked for a package that doesn't exist.)
0.4a2
* Added support for installing scripts
* Added support for setting options via distutils configuration files, and
using distutils' default options as a basis for EasyInstall's defaults.
* Renamed ``--scan-url/-s`` to ``--find-links/-f`` to free up ``-s`` for the
script installation directory option.
* Use ``urllib2`` instead of ``urllib``, to allow use of ``https:`` URLs if
Python includes SSL support.
0.4a1
* Added ``--scan-url`` and ``--index-url`` options, to scan download pages
and search PyPI for needed packages.
0.3a4
* Restrict ``--build-directory=DIR/-b DIR`` option to only be used with single
URL installs, to avoid running the wrong setup.py.
0.3a3
* Added ``--build-directory=DIR/-b DIR`` option.
* Added "installation report" that explains how to use 'require()' when doing
a multiversion install or alternate installation directory.
* Added SourceForge mirror auto-select (Contributed by Ian Bicking)
* Added "sandboxing" that stops a setup script from running if it attempts to
write to the filesystem outside of the build area
* Added more workarounds for packages with quirky ``install_data`` hacks
0.3a2
* Added subversion download support for ``svn:`` and ``svn+`` URLs, as well as
automatic recognition of HTTP subversion URLs (Contributed by Ian Bicking)
* Misc. bug fixes
0.3a1
* Initial release.
Future Plans
============
* Additional utilities to list/remove/verify packages
* Signature checking? SSL? Ability to suppress PyPI search?
* Display byte progress meter when downloading distributions and long pages?
* Redirect stdout/stderr to log during run_setup?
doc/alt-python27-setuptools/setuptools.txt 0000644 00000367272 15173017727 0015015 0 ustar 00 ==================================================
Building and Distributing Packages with Setuptools
==================================================
``Setuptools`` is a collection of enhancements to the Python ``distutils``
(for Python 2.6 and up) that allow developers to more easily build and
distribute Python packages, especially ones that have dependencies on other
packages.
Packages built and distributed using ``setuptools`` look to the user like
ordinary Python packages based on the ``distutils``. Your users don't need to
install or even know about setuptools in order to use them, and you don't
have to include the entire setuptools package in your distributions. By
including just a single `bootstrap module`_ (a 12K .py file), your package will
automatically download and install ``setuptools`` if the user is building your
package from source and doesn't have a suitable version already installed.
.. _bootstrap module: https://bootstrap.pypa.io/ez_setup.py
Feature Highlights:
* Automatically find/download/install/upgrade dependencies at build time using
the `EasyInstall tool <easy_install.html>`_,
which supports downloading via HTTP, FTP, Subversion, and SourceForge, and
automatically scans web pages linked from PyPI to find download links. (It's
the closest thing to CPAN currently available for Python.)
* Create `Python Eggs <http://peak.telecommunity.com/DevCenter/PythonEggs>`_ -
a single-file importable distribution format
* Enhanced support for accessing data files hosted in zipped packages.
* Automatically include all packages in your source tree, without listing them
individually in setup.py
* Automatically include all relevant files in your source distributions,
without needing to create a ``MANIFEST.in`` file, and without having to force
regeneration of the ``MANIFEST`` file when your source tree changes.
* Automatically generate wrapper scripts or Windows (console and GUI) .exe
files for any number of "main" functions in your project. (Note: this is not
a py2exe replacement; the .exe files rely on the local Python installation.)
* Transparent Pyrex support, so that your setup.py can list ``.pyx`` files and
still work even when the end-user doesn't have Pyrex installed (as long as
you include the Pyrex-generated C in your source distribution)
* Command aliases - create project-specific, per-user, or site-wide shortcut
names for commonly used commands and options
* PyPI upload support - upload your source distributions and eggs to PyPI
* Deploy your project in "development mode", such that it's available on
``sys.path``, yet can still be edited directly from its source checkout.
* Easily extend the distutils with new commands or ``setup()`` arguments, and
distribute/reuse your extensions for multiple projects, without copying code.
* Create extensible applications and frameworks that automatically discover
extensions, using simple "entry points" declared in a project's setup script.
.. contents:: **Table of Contents**
.. _ez_setup.py: `bootstrap module`_
-----------------
Developer's Guide
-----------------
Installing ``setuptools``
=========================
Please follow the `EasyInstall Installation Instructions`_ to install the
current stable version of setuptools. In particular, be sure to read the
section on `Custom Installation Locations`_ if you are installing anywhere
other than Python's ``site-packages`` directory.
.. _EasyInstall Installation Instructions: easy_install.html#installation-instructions
.. _Custom Installation Locations: easy_install.html#custom-installation-locations
If you want the current in-development version of setuptools, you should first
install a stable version, and then run::
ez_setup.py setuptools==dev
This will download and install the latest development (i.e. unstable) version
of setuptools from the Python Subversion sandbox.
Basic Use
=========
For basic use of setuptools, just import things from setuptools instead of
the distutils. Here's a minimal setup script using setuptools::
from setuptools import setup, find_packages
setup(
name="HelloWorld",
version="0.1",
packages=find_packages(),
)
As you can see, it doesn't take much to use setuptools in a project.
Run that script in your project folder, alongside the Python packages
you have developed.
Invoke that script to produce eggs, upload to
PyPI, and automatically include all packages in the directory where the
setup.py lives. See the `Command Reference`_ section below to see what
commands you can give to this setup script. For example,
to produce a source distribution, simply invoke::
python setup.py sdist
Of course, before you release your project to PyPI, you'll want to add a bit
more information to your setup script to help people find or learn about your
project. And maybe your project will have grown by then to include a few
dependencies, and perhaps some data files and scripts::
from setuptools import setup, find_packages
setup(
name="HelloWorld",
version="0.1",
packages=find_packages(),
scripts=['say_hello.py'],
# Project uses reStructuredText, so ensure that the docutils get
# installed or upgraded on the target machine
install_requires=['docutils>=0.3'],
package_data={
# If any package contains *.txt or *.rst files, include them:
'': ['*.txt', '*.rst'],
# And include any *.msg files found in the 'hello' package, too:
'hello': ['*.msg'],
},
# metadata for upload to PyPI
author="Me",
author_email="me@example.com",
description="This is an Example Package",
license="PSF",
keywords="hello world example examples",
url="http://example.com/HelloWorld/", # project home page, if any
# could also include long_description, download_url, classifiers, etc.
)
In the sections that follow, we'll explain what most of these ``setup()``
arguments do (except for the metadata ones), and the various ways you might use
them in your own project(s).
Specifying Your Project's Version
---------------------------------
Setuptools can work well with most versioning schemes; there are, however, a
few special things to watch out for, in order to ensure that setuptools and
EasyInstall can always tell what version of your package is newer than another
version. Knowing these things will also help you correctly specify what
versions of other projects your project depends on.
A version consists of an alternating series of release numbers and pre-release
or post-release tags. A release number is a series of digits punctuated by
dots, such as ``2.4`` or ``0.5``. Each series of digits is treated
numerically, so releases ``2.1`` and ``2.1.0`` are different ways to spell the
same release number, denoting the first subrelease of release 2. But ``2.10``
is the *tenth* subrelease of release 2, and so is a different and newer release
from ``2.1`` or ``2.1.0``. Leading zeros within a series of digits are also
ignored, so ``2.01`` is the same as ``2.1``, and different from ``2.0.1``.
Following a release number, you can have either a pre-release or post-release
tag. Pre-release tags make a version be considered *older* than the version
they are appended to. So, revision ``2.4`` is *newer* than revision ``2.4c1``,
which in turn is newer than ``2.4b1`` or ``2.4a1``. Postrelease tags make
a version be considered *newer* than the version they are appended to. So,
revisions like ``2.4-1`` and ``2.4pl3`` are newer than ``2.4``, but are *older*
than ``2.4.1`` (which has a higher release number).
A pre-release tag is a series of letters that are alphabetically before
"final". Some examples of prerelease tags would include ``alpha``, ``beta``,
``a``, ``c``, ``dev``, and so on. You do not have to place a dot or dash
before the prerelease tag if it's immediately after a number, but it's okay to
do so if you prefer. Thus, ``2.4c1`` and ``2.4.c1`` and ``2.4-c1`` all
represent release candidate 1 of version ``2.4``, and are treated as identical
by setuptools.
In addition, there are three special prerelease tags that are treated as if
they were the letter ``c``: ``pre``, ``preview``, and ``rc``. So, version
``2.4rc1``, ``2.4pre1`` and ``2.4preview1`` are all the exact same version as
``2.4c1``, and are treated as identical by setuptools.
A post-release tag is either a series of letters that are alphabetically
greater than or equal to "final", or a dash (``-``). Post-release tags are
generally used to separate patch numbers, port numbers, build numbers, revision
numbers, or date stamps from the release number. For example, the version
``2.4-r1263`` might denote Subversion revision 1263 of a post-release patch of
version ``2.4``. Or you might use ``2.4-20051127`` to denote a date-stamped
post-release.
Notice that after each pre or post-release tag, you are free to place another
release number, followed again by more pre- or post-release tags. For example,
``0.6a9.dev-r41475`` could denote Subversion revision 41475 of the in-
development version of the ninth alpha of release 0.6. Notice that ``dev`` is
a pre-release tag, so this version is a *lower* version number than ``0.6a9``,
which would be the actual ninth alpha of release 0.6. But the ``-r41475`` is
a post-release tag, so this version is *newer* than ``0.6a9.dev``.
For the most part, setuptools' interpretation of version numbers is intuitive,
but here are a few tips that will keep you out of trouble in the corner cases:
* Don't stick adjoining pre-release tags together without a dot or number
between them. Version ``1.9adev`` is the ``adev`` prerelease of ``1.9``,
*not* a development pre-release of ``1.9a``. Use ``.dev`` instead, as in
``1.9a.dev``, or separate the prerelease tags with a number, as in
``1.9a0dev``. ``1.9a.dev``, ``1.9a0dev``, and even ``1.9.a.dev`` are
identical versions from setuptools' point of view, so you can use whatever
scheme you prefer.
* If you want to be certain that your chosen numbering scheme works the way
you think it will, you can use the ``pkg_resources.parse_version()`` function
to compare different version numbers::
>>> from pkg_resources import parse_version
>>> parse_version('1.9.a.dev') == parse_version('1.9a0dev')
True
>>> parse_version('2.1-rc2') < parse_version('2.1')
True
>>> parse_version('0.6a9dev-r41475') < parse_version('0.6a9')
True
Once you've decided on a version numbering scheme for your project, you can
have setuptools automatically tag your in-development releases with various
pre- or post-release tags. See the following sections for more details:
* `Tagging and "Daily Build" or "Snapshot" Releases`_
* `Managing "Continuous Releases" Using Subversion`_
* The `egg_info`_ command
New and Changed ``setup()`` Keywords
====================================
The following keyword arguments to ``setup()`` are added or changed by
``setuptools``. All of them are optional; you do not have to supply them
unless you need the associated ``setuptools`` feature.
``include_package_data``
If set to ``True``, this tells ``setuptools`` to automatically include any
data files it finds inside your package directories that are specified by
your ``MANIFEST.in`` file. For more information, see the section below on
`Including Data Files`_.
``exclude_package_data``
A dictionary mapping package names to lists of glob patterns that should
be *excluded* from your package directories. You can use this to trim back
any excess files included by ``include_package_data``. For a complete
description and examples, see the section below on `Including Data Files`_.
``package_data``
A dictionary mapping package names to lists of glob patterns. For a
complete description and examples, see the section below on `Including
Data Files`_. You do not need to use this option if you are using
``include_package_data``, unless you need to add e.g. files that are
generated by your setup script and build process. (And are therefore not
in source control or are files that you don't want to include in your
source distribution.)
``zip_safe``
A boolean (True or False) flag specifying whether the project can be
safely installed and run from a zip file. If this argument is not
supplied, the ``bdist_egg`` command will have to analyze all of your
project's contents for possible problems each time it builds an egg.
``install_requires``
A string or list of strings specifying what other distributions need to
be installed when this one is. See the section below on `Declaring
Dependencies`_ for details and examples of the format of this argument.
``entry_points``
A dictionary mapping entry point group names to strings or lists of strings
defining the entry points. Entry points are used to support dynamic
discovery of services or plugins provided by a project. See `Dynamic
Discovery of Services and Plugins`_ for details and examples of the format
of this argument. In addition, this keyword is used to support `Automatic
Script Creation`_.
``extras_require``
A dictionary mapping names of "extras" (optional features of your project)
to strings or lists of strings specifying what other distributions must be
installed to support those features. See the section below on `Declaring
Dependencies`_ for details and examples of the format of this argument.
``python_requires``
A string corresponding to a version specifier (as defined in PEP 440) for
the Python version, used to specify the Requires-Python defined in PEP 345.
``setup_requires``
A string or list of strings specifying what other distributions need to
be present in order for the *setup script* to run. ``setuptools`` will
attempt to obtain these (even going so far as to download them using
``EasyInstall``) before processing the rest of the setup script or commands.
This argument is needed if you are using distutils extensions as part of
your build process; for example, extensions that process setup() arguments
and turn them into EGG-INFO metadata files.
(Note: projects listed in ``setup_requires`` will NOT be automatically
installed on the system where the setup script is being run. They are
simply downloaded to the ./.eggs directory if they're not locally available
already. If you want them to be installed, as well as being available
when the setup script is run, you should add them to ``install_requires``
**and** ``setup_requires``.)
``dependency_links``
A list of strings naming URLs to be searched when satisfying dependencies.
These links will be used if needed to install packages specified by
``setup_requires`` or ``tests_require``. They will also be written into
the egg's metadata for use by tools like EasyInstall to use when installing
an ``.egg`` file.
``namespace_packages``
A list of strings naming the project's "namespace packages". A namespace
package is a package that may be split across multiple project
distributions. For example, Zope 3's ``zope`` package is a namespace
package, because subpackages like ``zope.interface`` and ``zope.publisher``
may be distributed separately. The egg runtime system can automatically
merge such subpackages into a single parent package at runtime, as long
as you declare them in each project that contains any subpackages of the
namespace package, and as long as the namespace package's ``__init__.py``
does not contain any code other than a namespace declaration. See the
section below on `Namespace Packages`_ for more information.
``test_suite``
A string naming a ``unittest.TestCase`` subclass (or a package or module
containing one or more of them, or a method of such a subclass), or naming
a function that can be called with no arguments and returns a
``unittest.TestSuite``. If the named suite is a module, and the module
has an ``additional_tests()`` function, it is called and the results are
added to the tests to be run. If the named suite is a package, any
submodules and subpackages are recursively added to the overall test suite.
Specifying this argument enables use of the `test`_ command to run the
specified test suite, e.g. via ``setup.py test``. See the section on the
`test`_ command below for more details.
``tests_require``
If your project's tests need one or more additional packages besides those
needed to install it, you can use this option to specify them. It should
be a string or list of strings specifying what other distributions need to
be present for the package's tests to run. When you run the ``test``
command, ``setuptools`` will attempt to obtain these (even going
so far as to download them using ``EasyInstall``). Note that these
required projects will *not* be installed on the system where the tests
are run, but only downloaded to the project's setup directory if they're
not already installed locally.
.. _test_loader:
``test_loader``
If you would like to use a different way of finding tests to run than what
setuptools normally uses, you can specify a module name and class name in
this argument. The named class must be instantiable with no arguments, and
its instances must support the ``loadTestsFromNames()`` method as defined
in the Python ``unittest`` module's ``TestLoader`` class. Setuptools will
pass only one test "name" in the `names` argument: the value supplied for
the ``test_suite`` argument. The loader you specify may interpret this
string in any way it likes, as there are no restrictions on what may be
contained in a ``test_suite`` string.
The module name and class name must be separated by a ``:``. The default
value of this argument is ``"setuptools.command.test:ScanningLoader"``. If
you want to use the default ``unittest`` behavior, you can specify
``"unittest:TestLoader"`` as your ``test_loader`` argument instead. This
will prevent automatic scanning of submodules and subpackages.
The module and class you specify here may be contained in another package,
as long as you use the ``tests_require`` option to ensure that the package
containing the loader class is available when the ``test`` command is run.
``eager_resources``
A list of strings naming resources that should be extracted together, if
any of them is needed, or if any C extensions included in the project are
imported. This argument is only useful if the project will be installed as
a zipfile, and there is a need to have all of the listed resources be
extracted to the filesystem *as a unit*. Resources listed here
should be '/'-separated paths, relative to the source root, so to list a
resource ``foo.png`` in package ``bar.baz``, you would include the string
``bar/baz/foo.png`` in this argument.
If you only need to obtain resources one at a time, or you don't have any C
extensions that access other files in the project (such as data files or
shared libraries), you probably do NOT need this argument and shouldn't
mess with it. For more details on how this argument works, see the section
below on `Automatic Resource Extraction`_.
``use_2to3``
Convert the source code from Python 2 to Python 3 with 2to3 during the
build process. See :doc:`python3` for more details.
``convert_2to3_doctests``
List of doctest source files that need to be converted with 2to3.
See :doc:`python3` for more details.
``use_2to3_fixers``
A list of modules to search for additional fixers to be used during
the 2to3 conversion. See :doc:`python3` for more details.
Using ``find_packages()``
-------------------------
For simple projects, it's usually easy enough to manually add packages to
the ``packages`` argument of ``setup()``. However, for very large projects
(Twisted, PEAK, Zope, Chandler, etc.), it can be a big burden to keep the
package list updated. That's what ``setuptools.find_packages()`` is for.
``find_packages()`` takes a source directory and two lists of package name
patterns to exclude and include. If omitted, the source directory defaults to
the same
directory as the setup script. Some projects use a ``src`` or ``lib``
directory as the root of their source tree, and those projects would of course
use ``"src"`` or ``"lib"`` as the first argument to ``find_packages()``. (And
such projects also need something like ``package_dir={'':'src'}`` in their
``setup()`` arguments, but that's just a normal distutils thing.)
Anyway, ``find_packages()`` walks the target directory, filtering by inclusion
patterns, and finds Python packages (any directory). On Python 3.2 and
earlier, packages are only recognized if they include an ``__init__.py`` file.
Finally, exclusion patterns are applied to remove matching packages.
Inclusion and exclusion patterns are package names, optionally including
wildcards. For
example, ``find_packages(exclude=["*.tests"])`` will exclude all packages whose
last name part is ``tests``. Or, ``find_packages(exclude=["*.tests",
"*.tests.*"])`` will also exclude any subpackages of packages named ``tests``,
but it still won't exclude a top-level ``tests`` package or the children
thereof. In fact, if you really want no ``tests`` packages at all, you'll need
something like this::
find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"])
in order to cover all the bases. Really, the exclusion patterns are intended
to cover simpler use cases than this, like excluding a single, specified
package and its subpackages.
Regardless of the parameters, the ``find_packages()``
function returns a list of package names suitable for use as the ``packages``
argument to ``setup()``, and so is usually the easiest way to set that
argument in your setup script. Especially since it frees you from having to
remember to modify your setup script whenever your project grows additional
top-level packages or subpackages.
Automatic Script Creation
=========================
Packaging and installing scripts can be a bit awkward with the distutils. For
one thing, there's no easy way to have a script's filename match local
conventions on both Windows and POSIX platforms. For another, you often have
to create a separate file just for the "main" script, when your actual "main"
is a function in a module somewhere. And even in Python 2.4, using the ``-m``
option only works for actual ``.py`` files that aren't installed in a package.
``setuptools`` fixes all of these problems by automatically generating scripts
for you with the correct extension, and on Windows it will even create an
``.exe`` file so that users don't have to change their ``PATHEXT`` settings.
The way to use this feature is to define "entry points" in your setup script
that indicate what function the generated script should import and run. For
example, to create two console scripts called ``foo`` and ``bar``, and a GUI
script called ``baz``, you might do something like this::
setup(
# other arguments here...
entry_points={
'console_scripts': [
'foo = my_package.some_module:main_func',
'bar = other_module:some_func',
],
'gui_scripts': [
'baz = my_package_gui:start_func',
]
}
)
When this project is installed on non-Windows platforms (using "setup.py
install", "setup.py develop", or by using EasyInstall), a set of ``foo``,
``bar``, and ``baz`` scripts will be installed that import ``main_func`` and
``some_func`` from the specified modules. The functions you specify are called
with no arguments, and their return value is passed to ``sys.exit()``, so you
can return an errorlevel or message to print to stderr.
On Windows, a set of ``foo.exe``, ``bar.exe``, and ``baz.exe`` launchers are
created, alongside a set of ``foo.py``, ``bar.py``, and ``baz.pyw`` files. The
``.exe`` wrappers find and execute the right version of Python to run the
``.py`` or ``.pyw`` file.
You may define as many "console script" and "gui script" entry points as you
like, and each one can optionally specify "extras" that it depends on, that
will be added to ``sys.path`` when the script is run. For more information on
"extras", see the section below on `Declaring Extras`_. For more information
on "entry points" in general, see the section below on `Dynamic Discovery of
Services and Plugins`_.
"Eggsecutable" Scripts
----------------------
Occasionally, there are situations where it's desirable to make an ``.egg``
file directly executable. You can do this by including an entry point such
as the following::
setup(
# other arguments here...
entry_points={
'setuptools.installation': [
'eggsecutable = my_package.some_module:main_func',
]
}
)
Any eggs built from the above setup script will include a short executable
prelude that imports and calls ``main_func()`` from ``my_package.some_module``.
The prelude can be run on Unix-like platforms (including Mac and Linux) by
invoking the egg with ``/bin/sh``, or by enabling execute permissions on the
``.egg`` file. For the executable prelude to run, the appropriate version of
Python must be available via the ``PATH`` environment variable, under its
"long" name. That is, if the egg is built for Python 2.3, there must be a
``python2.3`` executable present in a directory on ``PATH``.
This feature is primarily intended to support ez_setup the installation of
setuptools itself on non-Windows platforms, but may also be useful for other
projects as well.
IMPORTANT NOTE: Eggs with an "eggsecutable" header cannot be renamed, or
invoked via symlinks. They *must* be invoked using their original filename, in
order to ensure that, once running, ``pkg_resources`` will know what project
and version is in use. The header script will check this and exit with an
error if the ``.egg`` file has been renamed or is invoked via a symlink that
changes its base name.
Declaring Dependencies
======================
``setuptools`` supports automatically installing dependencies when a package is
installed, and including information about dependencies in Python Eggs (so that
package management tools like EasyInstall can use the information).
``setuptools`` and ``pkg_resources`` use a common syntax for specifying a
project's required dependencies. This syntax consists of a project's PyPI
name, optionally followed by a comma-separated list of "extras" in square
brackets, optionally followed by a comma-separated list of version
specifiers. A version specifier is one of the operators ``<``, ``>``, ``<=``,
``>=``, ``==`` or ``!=``, followed by a version identifier. Tokens may be
separated by whitespace, but any whitespace or nonstandard characters within a
project name or version identifier must be replaced with ``-``.
Version specifiers for a given project are internally sorted into ascending
version order, and used to establish what ranges of versions are acceptable.
Adjacent redundant conditions are also consolidated (e.g. ``">1, >2"`` becomes
``">1"``, and ``"<2,<3"`` becomes ``"<3"``). ``"!="`` versions are excised from
the ranges they fall within. A project's version is then checked for
membership in the resulting ranges. (Note that providing conflicting conditions
for the same version (e.g. "<2,>=2" or "==2,!=2") is meaningless and may
therefore produce bizarre results.)
Here are some example requirement specifiers::
docutils >= 0.3
# comment lines and \ continuations are allowed in requirement strings
BazSpam ==1.1, ==1.2, ==1.3, ==1.4, ==1.5, \
==1.6, ==1.7 # and so are line-end comments
PEAK[FastCGI, reST]>=0.5a4
setuptools==0.5a7
The simplest way to include requirement specifiers is to use the
``install_requires`` argument to ``setup()``. It takes a string or list of
strings containing requirement specifiers. If you include more than one
requirement in a string, each requirement must begin on a new line.
This has three effects:
1. When your project is installed, either by using EasyInstall, ``setup.py
install``, or ``setup.py develop``, all of the dependencies not already
installed will be located (via PyPI), downloaded, built (if necessary),
and installed.
2. Any scripts in your project will be installed with wrappers that verify
the availability of the specified dependencies at runtime, and ensure that
the correct versions are added to ``sys.path`` (e.g. if multiple versions
have been installed).
3. Python Egg distributions will include a metadata file listing the
dependencies.
Note, by the way, that if you declare your dependencies in ``setup.py``, you do
*not* need to use the ``require()`` function in your scripts or modules, as
long as you either install the project or use ``setup.py develop`` to do
development work on it. (See `"Development Mode"`_ below for more details on
using ``setup.py develop``.)
Dependencies that aren't in PyPI
--------------------------------
If your project depends on packages that aren't registered in PyPI, you may
still be able to depend on them, as long as they are available for download
as:
- an egg, in the standard distutils ``sdist`` format,
- a single ``.py`` file, or
- a VCS repository (Subversion, Mercurial, or Git).
You just need to add some URLs to the ``dependency_links`` argument to
``setup()``.
The URLs must be either:
1. direct download URLs,
2. the URLs of web pages that contain direct download links, or
3. the repository's URL
In general, it's better to link to web pages, because it is usually less
complex to update a web page than to release a new version of your project.
You can also use a SourceForge ``showfiles.php`` link in the case where a
package you depend on is distributed via SourceForge.
If you depend on a package that's distributed as a single ``.py`` file, you
must include an ``"#egg=project-version"`` suffix to the URL, to give a project
name and version number. (Be sure to escape any dashes in the name or version
by replacing them with underscores.) EasyInstall will recognize this suffix
and automatically create a trivial ``setup.py`` to wrap the single ``.py`` file
as an egg.
In the case of a VCS checkout, you should also append ``#egg=project-version``
in order to identify for what package that checkout should be used. You can
append ``@REV`` to the URL's path (before the fragment) to specify a revision.
Additionally, you can also force the VCS being used by prepending the URL with
a certain prefix. Currently available are:
- ``svn+URL`` for Subversion,
- ``git+URL`` for Git, and
- ``hg+URL`` for Mercurial
A more complete example would be:
``vcs+proto://host/path@revision#egg=project-version``
Be careful with the version. It should match the one inside the project files.
If you want to disregard the version, you have to omit it both in the
``requires`` and in the URL's fragment.
This will do a checkout (or a clone, in Git and Mercurial parlance) to a
temporary folder and run ``setup.py bdist_egg``.
The ``dependency_links`` option takes the form of a list of URL strings. For
example, the below will cause EasyInstall to search the specified page for
eggs or source distributions, if the package's dependencies aren't already
installed::
setup(
...
dependency_links=[
"http://peak.telecommunity.com/snapshots/"
],
)
.. _Declaring Extras:
Declaring "Extras" (optional features with their own dependencies)
------------------------------------------------------------------
Sometimes a project has "recommended" dependencies, that are not required for
all uses of the project. For example, a project might offer optional PDF
output if ReportLab is installed, and reStructuredText support if docutils is
installed. These optional features are called "extras", and setuptools allows
you to define their requirements as well. In this way, other projects that
require these optional features can force the additional requirements to be
installed, by naming the desired extras in their ``install_requires``.
For example, let's say that Project A offers optional PDF and reST support::
setup(
name="Project-A",
...
extras_require={
'PDF': ["ReportLab>=1.2", "RXP"],
'reST': ["docutils>=0.3"],
}
)
As you can see, the ``extras_require`` argument takes a dictionary mapping
names of "extra" features, to strings or lists of strings describing those
features' requirements. These requirements will *not* be automatically
installed unless another package depends on them (directly or indirectly) by
including the desired "extras" in square brackets after the associated project
name. (Or if the extras were listed in a requirement spec on the EasyInstall
command line.)
Extras can be used by a project's `entry points`_ to specify dynamic
dependencies. For example, if Project A includes a "rst2pdf" script, it might
declare it like this, so that the "PDF" requirements are only resolved if the
"rst2pdf" script is run::
setup(
name="Project-A",
...
entry_points={
'console_scripts': [
'rst2pdf = project_a.tools.pdfgen [PDF]',
'rst2html = project_a.tools.htmlgen',
# more script entry points ...
],
}
)
Projects can also use another project's extras when specifying dependencies.
For example, if project B needs "project A" with PDF support installed, it
might declare the dependency like this::
setup(
name="Project-B",
install_requires=["Project-A[PDF]"],
...
)
This will cause ReportLab to be installed along with project A, if project B is
installed -- even if project A was already installed. In this way, a project
can encapsulate groups of optional "downstream dependencies" under a feature
name, so that packages that depend on it don't have to know what the downstream
dependencies are. If a later version of Project A builds in PDF support and
no longer needs ReportLab, or if it ends up needing other dependencies besides
ReportLab in order to provide PDF support, Project B's setup information does
not need to change, but the right packages will still be installed if needed.
Note, by the way, that if a project ends up not needing any other packages to
support a feature, it should keep an empty requirements list for that feature
in its ``extras_require`` argument, so that packages depending on that feature
don't break (due to an invalid feature name). For example, if Project A above
builds in PDF support and no longer needs ReportLab, it could change its
setup to this::
setup(
name="Project-A",
...
extras_require={
'PDF': [],
'reST': ["docutils>=0.3"],
}
)
so that Package B doesn't have to remove the ``[PDF]`` from its requirement
specifier.
.. _Platform Specific Dependencies:
Declaring platform specific dependencies
----------------------------------------
Sometimes a project might require a dependency to run on a specific platform.
This could to a package that back ports a module so that it can be used in
older python versions. Or it could be a package that is required to run on a
specific operating system. This will allow a project to work on multiple
different platforms without installing dependencies that are not required for
a platform that is installing the project.
For example, here is a project that uses the ``enum`` module and ``pywin32``::
setup(
name="Project",
...
install_requires=[
'enum34;python_version<"3.4"',
'pywin32 >= 1.0;platform_system=="Windows"'
]
)
Since the ``enum`` module was added in Python 3.4, it should only be installed
if the python version is earlier. Since ``pywin32`` will only be used on
windows, it should only be installed when the operating system is Windows.
Specifying version requirements for the dependencies is supported as normal.
The environmental markers that may be used for testing platform types are
detailed in `PEP 508`_.
.. _PEP 508: https://www.python.org/dev/peps/pep-0508/
Including Data Files
====================
The distutils have traditionally allowed installation of "data files", which
are placed in a platform-specific location. However, the most common use case
for data files distributed with a package is for use *by* the package, usually
by including the data files in the package directory.
Setuptools offers three ways to specify data files to be included in your
packages. First, you can simply use the ``include_package_data`` keyword,
e.g.::
from setuptools import setup, find_packages
setup(
...
include_package_data=True
)
This tells setuptools to install any data files it finds in your packages.
The data files must be specified via the distutils' ``MANIFEST.in`` file.
(They can also be tracked by a revision control system, using an appropriate
plugin. See the section below on `Adding Support for Revision Control
Systems`_ for information on how to write such plugins.)
If you want finer-grained control over what files are included (for example,
if you have documentation files in your package directories and want to exclude
them from installation), then you can also use the ``package_data`` keyword,
e.g.::
from setuptools import setup, find_packages
setup(
...
package_data={
# If any package contains *.txt or *.rst files, include them:
'': ['*.txt', '*.rst'],
# And include any *.msg files found in the 'hello' package, too:
'hello': ['*.msg'],
}
)
The ``package_data`` argument is a dictionary that maps from package names to
lists of glob patterns. The globs may include subdirectory names, if the data
files are contained in a subdirectory of the package. For example, if the
package tree looks like this::
setup.py
src/
mypkg/
__init__.py
mypkg.txt
data/
somefile.dat
otherdata.dat
The setuptools setup file might look like this::
from setuptools import setup, find_packages
setup(
...
packages=find_packages('src'), # include all packages under src
package_dir={'':'src'}, # tell distutils packages are under src
package_data={
# If any package contains *.txt files, include them:
'': ['*.txt'],
# And include any *.dat files found in the 'data' subdirectory
# of the 'mypkg' package, also:
'mypkg': ['data/*.dat'],
}
)
Notice that if you list patterns in ``package_data`` under the empty string,
these patterns are used to find files in every package, even ones that also
have their own patterns listed. Thus, in the above example, the ``mypkg.txt``
file gets included even though it's not listed in the patterns for ``mypkg``.
Also notice that if you use paths, you *must* use a forward slash (``/``) as
the path separator, even if you are on Windows. Setuptools automatically
converts slashes to appropriate platform-specific separators at build time.
(Note: although the ``package_data`` argument was previously only available in
``setuptools``, it was also added to the Python ``distutils`` package as of
Python 2.4; there is `some documentation for the feature`__ available on the
python.org website. If using the setuptools-specific ``include_package_data``
argument, files specified by ``package_data`` will *not* be automatically
added to the manifest unless they are listed in the MANIFEST.in file.)
__ http://docs.python.org/dist/node11.html
Sometimes, the ``include_package_data`` or ``package_data`` options alone
aren't sufficient to precisely define what files you want included. For
example, you may want to include package README files in your revision control
system and source distributions, but exclude them from being installed. So,
setuptools offers an ``exclude_package_data`` option as well, that allows you
to do things like this::
from setuptools import setup, find_packages
setup(
...
packages=find_packages('src'), # include all packages under src
package_dir={'':'src'}, # tell distutils packages are under src
include_package_data=True, # include everything in source control
# ...but exclude README.txt from all packages
exclude_package_data={'': ['README.txt']},
)
The ``exclude_package_data`` option is a dictionary mapping package names to
lists of wildcard patterns, just like the ``package_data`` option. And, just
as with that option, a key of ``''`` will apply the given pattern(s) to all
packages. However, any files that match these patterns will be *excluded*
from installation, even if they were listed in ``package_data`` or were
included as a result of using ``include_package_data``.
In summary, the three options allow you to:
``include_package_data``
Accept all data files and directories matched by ``MANIFEST.in``.
``package_data``
Specify additional patterns to match files and directories that may or may
not be matched by ``MANIFEST.in`` or found in source control.
``exclude_package_data``
Specify patterns for data files and directories that should *not* be
included when a package is installed, even if they would otherwise have
been included due to the use of the preceding options.
NOTE: Due to the way the distutils build process works, a data file that you
include in your project and then stop including may be "orphaned" in your
project's build directories, requiring you to run ``setup.py clean --all`` to
fully remove them. This may also be important for your users and contributors
if they track intermediate revisions of your project using Subversion; be sure
to let them know when you make changes that remove files from inclusion so they
can run ``setup.py clean --all``.
Accessing Data Files at Runtime
-------------------------------
Typically, existing programs manipulate a package's ``__file__`` attribute in
order to find the location of data files. However, this manipulation isn't
compatible with PEP 302-based import hooks, including importing from zip files
and Python Eggs. It is strongly recommended that, if you are using data files,
you should use the :ref:`ResourceManager API` of ``pkg_resources`` to access
them. The ``pkg_resources`` module is distributed as part of setuptools, so if
you're using setuptools to distribute your package, there is no reason not to
use its resource management API. See also `Accessing Package Resources`_ for
a quick example of converting code that uses ``__file__`` to use
``pkg_resources`` instead.
.. _Accessing Package Resources: http://peak.telecommunity.com/DevCenter/PythonEggs#accessing-package-resources
Non-Package Data Files
----------------------
The ``distutils`` normally install general "data files" to a platform-specific
location (e.g. ``/usr/share``). This feature intended to be used for things
like documentation, example configuration files, and the like. ``setuptools``
does not install these data files in a separate location, however. They are
bundled inside the egg file or directory, alongside the Python modules and
packages. The data files can also be accessed using the :ref:`ResourceManager
API`, by specifying a ``Requirement`` instead of a package name::
from pkg_resources import Requirement, resource_filename
filename = resource_filename(Requirement.parse("MyProject"),"sample.conf")
The above code will obtain the filename of the "sample.conf" file in the data
root of the "MyProject" distribution.
Note, by the way, that this encapsulation of data files means that you can't
actually install data files to some arbitrary location on a user's machine;
this is a feature, not a bug. You can always include a script in your
distribution that extracts and copies your the documentation or data files to
a user-specified location, at their discretion. If you put related data files
in a single directory, you can use ``resource_filename()`` with the directory
name to get a filesystem directory that then can be copied with the ``shutil``
module. (Even if your package is installed as a zipfile, calling
``resource_filename()`` on a directory will return an actual filesystem
directory, whose contents will be that entire subtree of your distribution.)
(Of course, if you're writing a new package, you can just as easily place your
data files or directories inside one of your packages, rather than using the
distutils' approach. However, if you're updating an existing application, it
may be simpler not to change the way it currently specifies these data files.)
Automatic Resource Extraction
-----------------------------
If you are using tools that expect your resources to be "real" files, or your
project includes non-extension native libraries or other files that your C
extensions expect to be able to access, you may need to list those files in
the ``eager_resources`` argument to ``setup()``, so that the files will be
extracted together, whenever a C extension in the project is imported.
This is especially important if your project includes shared libraries *other*
than distutils-built C extensions, and those shared libraries use file
extensions other than ``.dll``, ``.so``, or ``.dylib``, which are the
extensions that setuptools 0.6a8 and higher automatically detects as shared
libraries and adds to the ``native_libs.txt`` file for you. Any shared
libraries whose names do not end with one of those extensions should be listed
as ``eager_resources``, because they need to be present in the filesystem when
he C extensions that link to them are used.
The ``pkg_resources`` runtime for compressed packages will automatically
extract *all* C extensions and ``eager_resources`` at the same time, whenever
*any* C extension or eager resource is requested via the ``resource_filename()``
API. (C extensions are imported using ``resource_filename()`` internally.)
This ensures that C extensions will see all of the "real" files that they
expect to see.
Note also that you can list directory resource names in ``eager_resources`` as
well, in which case the directory's contents (including subdirectories) will be
extracted whenever any C extension or eager resource is requested.
Please note that if you're not sure whether you need to use this argument, you
don't! It's really intended to support projects with lots of non-Python
dependencies and as a last resort for crufty projects that can't otherwise
handle being compressed. If your package is pure Python, Python plus data
files, or Python plus C, you really don't need this. You've got to be using
either C or an external program that needs "real" files in your project before
there's any possibility of ``eager_resources`` being relevant to your project.
Extensible Applications and Frameworks
======================================
.. _Entry Points:
Dynamic Discovery of Services and Plugins
-----------------------------------------
``setuptools`` supports creating libraries that "plug in" to extensible
applications and frameworks, by letting you register "entry points" in your
project that can be imported by the application or framework.
For example, suppose that a blogging tool wants to support plugins
that provide translation for various file types to the blog's output format.
The framework might define an "entry point group" called ``blogtool.parsers``,
and then allow plugins to register entry points for the file extensions they
support.
This would allow people to create distributions that contain one or more
parsers for different file types, and then the blogging tool would be able to
find the parsers at runtime by looking up an entry point for the file
extension (or mime type, or however it wants to).
Note that if the blogging tool includes parsers for certain file formats, it
can register these as entry points in its own setup script, which means it
doesn't have to special-case its built-in formats. They can just be treated
the same as any other plugin's entry points would be.
If you're creating a project that plugs in to an existing application or
framework, you'll need to know what entry points or entry point groups are
defined by that application or framework. Then, you can register entry points
in your setup script. Here are a few examples of ways you might register an
``.rst`` file parser entry point in the ``blogtool.parsers`` entry point group,
for our hypothetical blogging tool::
setup(
# ...
entry_points={'blogtool.parsers': '.rst = some_module:SomeClass'}
)
setup(
# ...
entry_points={'blogtool.parsers': ['.rst = some_module:a_func']}
)
setup(
# ...
entry_points="""
[blogtool.parsers]
.rst = some.nested.module:SomeClass.some_classmethod [reST]
""",
extras_require=dict(reST="Docutils>=0.3.5")
)
The ``entry_points`` argument to ``setup()`` accepts either a string with
``.ini``-style sections, or a dictionary mapping entry point group names to
either strings or lists of strings containing entry point specifiers. An
entry point specifier consists of a name and value, separated by an ``=``
sign. The value consists of a dotted module name, optionally followed by a
``:`` and a dotted identifier naming an object within the module. It can
also include a bracketed list of "extras" that are required for the entry
point to be used. When the invoking application or framework requests loading
of an entry point, any requirements implied by the associated extras will be
passed to ``pkg_resources.require()``, so that an appropriate error message
can be displayed if the needed package(s) are missing. (Of course, the
invoking app or framework can ignore such errors if it wants to make an entry
point optional if a requirement isn't installed.)
Defining Additional Metadata
----------------------------
Some extensible applications and frameworks may need to define their own kinds
of metadata to include in eggs, which they can then access using the
``pkg_resources`` metadata APIs. Ordinarily, this is done by having plugin
developers include additional files in their ``ProjectName.egg-info``
directory. However, since it can be tedious to create such files by hand, you
may want to create a distutils extension that will create the necessary files
from arguments to ``setup()``, in much the same way that ``setuptools`` does
for many of the ``setup()`` arguments it adds. See the section below on
`Creating distutils Extensions`_ for more details, especially the subsection on
`Adding new EGG-INFO Files`_.
"Development Mode"
==================
Under normal circumstances, the ``distutils`` assume that you are going to
build a distribution of your project, not use it in its "raw" or "unbuilt"
form. If you were to use the ``distutils`` that way, you would have to rebuild
and reinstall your project every time you made a change to it during
development.
Another problem that sometimes comes up with the ``distutils`` is that you may
need to do development on two related projects at the same time. You may need
to put both projects' packages in the same directory to run them, but need to
keep them separate for revision control purposes. How can you do this?
Setuptools allows you to deploy your projects for use in a common directory or
staging area, but without copying any files. Thus, you can edit each project's
code in its checkout directory, and only need to run build commands when you
change a project's C extensions or similarly compiled files. You can even
deploy a project into another project's checkout directory, if that's your
preferred way of working (as opposed to using a common independent staging area
or the site-packages directory).
To do this, use the ``setup.py develop`` command. It works very similarly to
``setup.py install`` or the EasyInstall tool, except that it doesn't actually
install anything. Instead, it creates a special ``.egg-link`` file in the
deployment directory, that links to your project's source code. And, if your
deployment directory is Python's ``site-packages`` directory, it will also
update the ``easy-install.pth`` file to include your project's source code,
thereby making it available on ``sys.path`` for all programs using that Python
installation.
If you have enabled the ``use_2to3`` flag, then of course the ``.egg-link``
will not link directly to your source code when run under Python 3, since
that source code would be made for Python 2 and not work under Python 3.
Instead the ``setup.py develop`` will build Python 3 code under the ``build``
directory, and link there. This means that after doing code changes you will
have to run ``setup.py build`` before these changes are picked up by your
Python 3 installation.
In addition, the ``develop`` command creates wrapper scripts in the target
script directory that will run your in-development scripts after ensuring that
all your ``install_requires`` packages are available on ``sys.path``.
You can deploy the same project to multiple staging areas, e.g. if you have
multiple projects on the same machine that are sharing the same project you're
doing development work.
When you're done with a given development task, you can remove the project
source from a staging area using ``setup.py develop --uninstall``, specifying
the desired staging area if it's not the default.
There are several options to control the precise behavior of the ``develop``
command; see the section on the `develop`_ command below for more details.
Note that you can also apply setuptools commands to non-setuptools projects,
using commands like this::
python -c "import setuptools; execfile('setup.py')" develop
That is, you can simply list the normal setup commands and options following
the quoted part.
Distributing a ``setuptools``-based project
===========================================
Using ``setuptools``... Without bundling it!
---------------------------------------------
.. warning:: **ez_setup** is deprecated in favor of PIP with **PEP-518** support.
Your users might not have ``setuptools`` installed on their machines, or even
if they do, it might not be the right version. Fixing this is easy; just
download `ez_setup.py`_, and put it in the same directory as your ``setup.py``
script. (Be sure to add it to your revision control system, too.) Then add
these two lines to the very top of your setup script, before the script imports
anything from setuptools:
.. code-block:: python
import ez_setup
ez_setup.use_setuptools()
That's it. The ``ez_setup`` module will automatically download a matching
version of ``setuptools`` from PyPI, if it isn't present on the target system.
Whenever you install an updated version of setuptools, you should also update
your projects' ``ez_setup.py`` files, so that a matching version gets installed
on the target machine(s).
By the way, setuptools supports the new PyPI "upload" command, so you can use
``setup.py sdist upload`` or ``setup.py bdist_egg upload`` to upload your
source or egg distributions respectively. Your project's current version must
be registered with PyPI first, of course; you can use ``setup.py register`` to
do that. Or you can do it all in one step, e.g. ``setup.py register sdist
bdist_egg upload`` will register the package, build source and egg
distributions, and then upload them both to PyPI, where they'll be easily
found by other projects that depend on them.
(By the way, if you need to distribute a specific version of ``setuptools``,
you can specify the exact version and base download URL as parameters to the
``use_setuptools()`` function. See the function's docstring for details.)
What Your Users Should Know
---------------------------
In general, a setuptools-based project looks just like any distutils-based
project -- as long as your users have an internet connection and are installing
to ``site-packages``, that is. But for some users, these conditions don't
apply, and they may become frustrated if this is their first encounter with
a setuptools-based project. To keep these users happy, you should review the
following topics in your project's installation instructions, if they are
relevant to your project and your target audience isn't already familiar with
setuptools and ``easy_install``.
Network Access
If your project is using ``ez_setup``, you should inform users of the
need to either have network access, or to preinstall the correct version of
setuptools using the `EasyInstall installation instructions`_. Those
instructions also have tips for dealing with firewalls as well as how to
manually download and install setuptools.
Custom Installation Locations
You should inform your users that if they are installing your project to
somewhere other than the main ``site-packages`` directory, they should
first install setuptools using the instructions for `Custom Installation
Locations`_, before installing your project.
Your Project's Dependencies
If your project depends on other projects that may need to be downloaded
from PyPI or elsewhere, you should list them in your installation
instructions, or tell users how to find out what they are. While most
users will not need this information, any users who don't have unrestricted
internet access may have to find, download, and install the other projects
manually. (Note, however, that they must still install those projects
using ``easy_install``, or your project will not know they are installed,
and your setup script will try to download them again.)
If you want to be especially friendly to users with limited network access,
you may wish to build eggs for your project and its dependencies, making
them all available for download from your site, or at least create a page
with links to all of the needed eggs. In this way, users with limited
network access can manually download all the eggs to a single directory,
then use the ``-f`` option of ``easy_install`` to specify the directory
to find eggs in. Users who have full network access can just use ``-f``
with the URL of your download page, and ``easy_install`` will find all the
needed eggs using your links directly. This is also useful when your
target audience isn't able to compile packages (e.g. most Windows users)
and your package or some of its dependencies include C code.
Revision Control System Users and Co-Developers
Users and co-developers who are tracking your in-development code using
a revision control system should probably read this manual's sections
regarding such development. Alternately, you may wish to create a
quick-reference guide containing the tips from this manual that apply to
your particular situation. For example, if you recommend that people use
``setup.py develop`` when tracking your in-development code, you should let
them know that this needs to be run after every update or commit.
Similarly, if you remove modules or data files from your project, you
should remind them to run ``setup.py clean --all`` and delete any obsolete
``.pyc`` or ``.pyo``. (This tip applies to the distutils in general, not
just setuptools, but not everybody knows about them; be kind to your users
by spelling out your project's best practices rather than leaving them
guessing.)
Creating System Packages
Some users want to manage all Python packages using a single package
manager, and sometimes that package manager isn't ``easy_install``!
Setuptools currently supports ``bdist_rpm``, ``bdist_wininst``, and
``bdist_dumb`` formats for system packaging. If a user has a locally-
installed "bdist" packaging tool that internally uses the distutils
``install`` command, it should be able to work with ``setuptools``. Some
examples of "bdist" formats that this should work with include the
``bdist_nsi`` and ``bdist_msi`` formats for Windows.
However, packaging tools that build binary distributions by running
``setup.py install`` on the command line or as a subprocess will require
modification to work with setuptools. They should use the
``--single-version-externally-managed`` option to the ``install`` command,
combined with the standard ``--root`` or ``--record`` options.
See the `install command`_ documentation below for more details. The
``bdist_deb`` command is an example of a command that currently requires
this kind of patching to work with setuptools.
If you or your users have a problem building a usable system package for
your project, please report the problem via the mailing list so that
either the "bdist" tool in question or setuptools can be modified to
resolve the issue.
Setting the ``zip_safe`` flag
-----------------------------
For some use cases (such as bundling as part of a larger application), Python
packages may be run directly from a zip file.
Not all packages, however, are capable of running in compressed form, because
they may expect to be able to access either source code or data files as
normal operating system files. So, ``setuptools`` can install your project
as a zipfile or a directory, and its default choice is determined by the
project's ``zip_safe`` flag.
You can pass a True or False value for the ``zip_safe`` argument to the
``setup()`` function, or you can omit it. If you omit it, the ``bdist_egg``
command will analyze your project's contents to see if it can detect any
conditions that would prevent it from working in a zipfile. It will output
notices to the console about any such conditions that it finds.
Currently, this analysis is extremely conservative: it will consider the
project unsafe if it contains any C extensions or datafiles whatsoever. This
does *not* mean that the project can't or won't work as a zipfile! It just
means that the ``bdist_egg`` authors aren't yet comfortable asserting that
the project *will* work. If the project contains no C or data files, and does
no ``__file__`` or ``__path__`` introspection or source code manipulation, then
there is an extremely solid chance the project will work when installed as a
zipfile. (And if the project uses ``pkg_resources`` for all its data file
access, then C extensions and other data files shouldn't be a problem at all.
See the `Accessing Data Files at Runtime`_ section above for more information.)
However, if ``bdist_egg`` can't be *sure* that your package will work, but
you've checked over all the warnings it issued, and you are either satisfied it
*will* work (or if you want to try it for yourself), then you should set
``zip_safe`` to ``True`` in your ``setup()`` call. If it turns out that it
doesn't work, you can always change it to ``False``, which will force
``setuptools`` to install your project as a directory rather than as a zipfile.
Of course, the end-user can still override either decision, if they are using
EasyInstall to install your package. And, if you want to override for testing
purposes, you can just run ``setup.py easy_install --zip-ok .`` or ``setup.py
easy_install --always-unzip .`` in your project directory. to install the
package as a zipfile or directory, respectively.
In the future, as we gain more experience with different packages and become
more satisfied with the robustness of the ``pkg_resources`` runtime, the
"zip safety" analysis may become less conservative. However, we strongly
recommend that you determine for yourself whether your project functions
correctly when installed as a zipfile, correct any problems if you can, and
then make an explicit declaration of ``True`` or ``False`` for the ``zip_safe``
flag, so that it will not be necessary for ``bdist_egg`` or ``EasyInstall`` to
try to guess whether your project can work as a zipfile.
Namespace Packages
------------------
Sometimes, a large package is more useful if distributed as a collection of
smaller eggs. However, Python does not normally allow the contents of a
package to be retrieved from more than one location. "Namespace packages"
are a solution for this problem. When you declare a package to be a namespace
package, it means that the package has no meaningful contents in its
``__init__.py``, and that it is merely a container for modules and subpackages.
The ``pkg_resources`` runtime will then automatically ensure that the contents
of namespace packages that are spread over multiple eggs or directories are
combined into a single "virtual" package.
The ``namespace_packages`` argument to ``setup()`` lets you declare your
project's namespace packages, so that they will be included in your project's
metadata. The argument should list the namespace packages that the egg
participates in. For example, the ZopeInterface project might do this::
setup(
# ...
namespace_packages=['zope']
)
because it contains a ``zope.interface`` package that lives in the ``zope``
namespace package. Similarly, a project for a standalone ``zope.publisher``
would also declare the ``zope`` namespace package. When these projects are
installed and used, Python will see them both as part of a "virtual" ``zope``
package, even though they will be installed in different locations.
Namespace packages don't have to be top-level packages. For example, Zope 3's
``zope.app`` package is a namespace package, and in the future PEAK's
``peak.util`` package will be too.
Note, by the way, that your project's source tree must include the namespace
packages' ``__init__.py`` files (and the ``__init__.py`` of any parent
packages), in a normal Python package layout. These ``__init__.py`` files
*must* contain the line::
__import__('pkg_resources').declare_namespace(__name__)
This code ensures that the namespace package machinery is operating and that
the current package is registered as a namespace package.
You must NOT include any other code and data in a namespace package's
``__init__.py``. Even though it may appear to work during development, or when
projects are installed as ``.egg`` files, it will not work when the projects
are installed using "system" packaging tools -- in such cases the
``__init__.py`` files will not be installed, let alone executed.
You must include the ``declare_namespace()`` line in the ``__init__.py`` of
*every* project that has contents for the namespace package in question, in
order to ensure that the namespace will be declared regardless of which
project's copy of ``__init__.py`` is loaded first. If the first loaded
``__init__.py`` doesn't declare it, it will never *be* declared, because no
other copies will ever be loaded!
TRANSITIONAL NOTE
~~~~~~~~~~~~~~~~~
Setuptools automatically calls ``declare_namespace()`` for you at runtime,
but future versions may *not*. This is because the automatic declaration
feature has some negative side effects, such as needing to import all namespace
packages during the initialization of the ``pkg_resources`` runtime, and also
the need for ``pkg_resources`` to be explicitly imported before any namespace
packages work at all. In some future releases, you'll be responsible
for including your own declaration lines, and the automatic declaration feature
will be dropped to get rid of the negative side effects.
During the remainder of the current development cycle, therefore, setuptools
will warn you about missing ``declare_namespace()`` calls in your
``__init__.py`` files, and you should correct these as soon as possible
before the compatibility support is removed.
Namespace packages without declaration lines will not work
correctly once a user has upgraded to a later version, so it's important that
you make this change now in order to avoid having your code break in the field.
Our apologies for the inconvenience, and thank you for your patience.
Tagging and "Daily Build" or "Snapshot" Releases
------------------------------------------------
When a set of related projects are under development, it may be important to
track finer-grained version increments than you would normally use for e.g.
"stable" releases. While stable releases might be measured in dotted numbers
with alpha/beta/etc. status codes, development versions of a project often
need to be tracked by revision or build number or even build date. This is
especially true when projects in development need to refer to one another, and
therefore may literally need an up-to-the-minute version of something!
To support these scenarios, ``setuptools`` allows you to "tag" your source and
egg distributions by adding one or more of the following to the project's
"official" version identifier:
* A manually-specified pre-release tag, such as "build" or "dev", or a
manually-specified post-release tag, such as a build or revision number
(``--tag-build=STRING, -bSTRING``)
* An 8-character representation of the build date (``--tag-date, -d``), as
a postrelease tag
You can add these tags by adding ``egg_info`` and the desired options to
the command line ahead of the ``sdist`` or ``bdist`` commands that you want
to generate a daily build or snapshot for. See the section below on the
`egg_info`_ command for more details.
(Also, before you release your project, be sure to see the section above on
`Specifying Your Project's Version`_ for more information about how pre- and
post-release tags affect how setuptools and EasyInstall interpret version
numbers. This is important in order to make sure that dependency processing
tools will know which versions of your project are newer than others.)
Finally, if you are creating builds frequently, and either building them in a
downloadable location or are copying them to a distribution server, you should
probably also check out the `rotate`_ command, which lets you automatically
delete all but the N most-recently-modified distributions matching a glob
pattern. So, you can use a command line like::
setup.py egg_info -rbDEV bdist_egg rotate -m.egg -k3
to build an egg whose version info includes 'DEV-rNNNN' (where NNNN is the
most recent Subversion revision that affected the source tree), and then
delete any egg files from the distribution directory except for the three
that were built most recently.
If you have to manage automated builds for multiple packages, each with
different tagging and rotation policies, you may also want to check out the
`alias`_ command, which would let each package define an alias like ``daily``
that would perform the necessary tag, build, and rotate commands. Then, a
simpler script or cron job could just run ``setup.py daily`` in each project
directory. (And, you could also define sitewide or per-user default versions
of the ``daily`` alias, so that projects that didn't define their own would
use the appropriate defaults.)
Generating Source Distributions
-------------------------------
``setuptools`` enhances the distutils' default algorithm for source file
selection with pluggable endpoints for looking up files to include. If you are
using a revision control system, and your source distributions only need to
include files that you're tracking in revision control, use a corresponding
plugin instead of writing a ``MANIFEST.in`` file. See the section below on
`Adding Support for Revision Control Systems`_ for information on plugins.
If you need to include automatically generated files, or files that are kept in
an unsupported revision control system, you'll need to create a ``MANIFEST.in``
file to specify any files that the default file location algorithm doesn't
catch. See the distutils documentation for more information on the format of
the ``MANIFEST.in`` file.
But, be sure to ignore any part of the distutils documentation that deals with
``MANIFEST`` or how it's generated from ``MANIFEST.in``; setuptools shields you
from these issues and doesn't work the same way in any case. Unlike the
distutils, setuptools regenerates the source distribution manifest file
every time you build a source distribution, and it builds it inside the
project's ``.egg-info`` directory, out of the way of your main project
directory. You therefore need not worry about whether it is up-to-date or not.
Indeed, because setuptools' approach to determining the contents of a source
distribution is so much simpler, its ``sdist`` command omits nearly all of
the options that the distutils' more complex ``sdist`` process requires. For
all practical purposes, you'll probably use only the ``--formats`` option, if
you use any option at all.
Making your package available for EasyInstall
---------------------------------------------
If you use the ``register`` command (``setup.py register``) to register your
package with PyPI, that's most of the battle right there. (See the
`docs for the register command`_ for more details.)
.. _docs for the register command: http://docs.python.org/dist/package-index.html
If you also use the `upload`_ command to upload actual distributions of your
package, that's even better, because EasyInstall will be able to find and
download them directly from your project's PyPI page.
However, there may be reasons why you don't want to upload distributions to
PyPI, and just want your existing distributions (or perhaps a Subversion
checkout) to be used instead.
So here's what you need to do before running the ``register`` command. There
are three ``setup()`` arguments that affect EasyInstall:
``url`` and ``download_url``
These become links on your project's PyPI page. EasyInstall will examine
them to see if they link to a package ("primary links"), or whether they are
HTML pages. If they're HTML pages, EasyInstall scans all HREF's on the
page for primary links
``long_description``
EasyInstall will check any URLs contained in this argument to see if they
are primary links.
A URL is considered a "primary link" if it is a link to a .tar.gz, .tgz, .zip,
.egg, .egg.zip, .tar.bz2, or .exe file, or if it has an ``#egg=project`` or
``#egg=project-version`` fragment identifier attached to it. EasyInstall
attempts to determine a project name and optional version number from the text
of a primary link *without* downloading it. When it has found all the primary
links, EasyInstall will select the best match based on requested version,
platform compatibility, and other criteria.
So, if your ``url`` or ``download_url`` point either directly to a downloadable
source distribution, or to HTML page(s) that have direct links to such, then
EasyInstall will be able to locate downloads automatically. If you want to
make Subversion checkouts available, then you should create links with either
``#egg=project`` or ``#egg=project-version`` added to the URL. You should
replace ``project`` and ``version`` with the values they would have in an egg
filename. (Be sure to actually generate an egg and then use the initial part
of the filename, rather than trying to guess what the escaped form of the
project name and version number will be.)
Note that Subversion checkout links are of lower precedence than other kinds
of distributions, so EasyInstall will not select a Subversion checkout for
downloading unless it has a version included in the ``#egg=`` suffix, and
it's a higher version than EasyInstall has seen in any other links for your
project.
As a result, it's a common practice to use mark checkout URLs with a version of
"dev" (i.e., ``#egg=projectname-dev``), so that users can do something like
this::
easy_install --editable projectname==dev
in order to check out the in-development version of ``projectname``.
Making "Official" (Non-Snapshot) Releases
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When you make an official release, creating source or binary distributions,
you will need to override the tag settings from ``setup.cfg``, so that you
don't end up registering versions like ``foobar-0.7a1.dev-r34832``. This is
easy to do if you are developing on the trunk and using tags or branches for
your releases - just make the change to ``setup.cfg`` after branching or
tagging the release, so the trunk will still produce development snapshots.
Alternately, if you are not branching for releases, you can override the
default version options on the command line, using something like::
python setup.py egg_info -Db "" sdist bdist_egg register upload
The first part of this command (``egg_info -Db ""``) will override the
configured tag information, before creating source and binary eggs, registering
the project with PyPI, and uploading the files. Thus, these commands will use
the plain version from your ``setup.py``, without adding the build designation
string.
Of course, if you will be doing this a lot, you may wish to create a personal
alias for this operation, e.g.::
python setup.py alias -u release egg_info -Db ""
You can then use it like this::
python setup.py release sdist bdist_egg register upload
Or of course you can create more elaborate aliases that do all of the above.
See the sections below on the `egg_info`_ and `alias`_ commands for more ideas.
Distributing Extensions compiled with Pyrex
-------------------------------------------
``setuptools`` includes transparent support for building Pyrex extensions, as
long as you define your extensions using ``setuptools.Extension``, *not*
``distutils.Extension``. You must also not import anything from Pyrex in
your setup script.
If you follow these rules, you can safely list ``.pyx`` files as the source
of your ``Extension`` objects in the setup script. ``setuptools`` will detect
at build time whether Pyrex is installed or not. If it is, then ``setuptools``
will use it. If not, then ``setuptools`` will silently change the
``Extension`` objects to refer to the ``.c`` counterparts of the ``.pyx``
files, so that the normal distutils C compilation process will occur.
Of course, for this to work, your source distributions must include the C
code generated by Pyrex, as well as your original ``.pyx`` files. This means
that you will probably want to include current ``.c`` files in your revision
control system, rebuilding them whenever you check changes in for the ``.pyx``
source files. This will ensure that people tracking your project in a revision
control system will be able to build it even if they don't have Pyrex
installed, and that your source releases will be similarly usable with or
without Pyrex.
-----------------
Command Reference
-----------------
.. _alias:
``alias`` - Define shortcuts for commonly used commands
=======================================================
Sometimes, you need to use the same commands over and over, but you can't
necessarily set them as defaults. For example, if you produce both development
snapshot releases and "stable" releases of a project, you may want to put
the distributions in different places, or use different ``egg_info`` tagging
options, etc. In these cases, it doesn't make sense to set the options in
a distutils configuration file, because the values of the options changed based
on what you're trying to do.
Setuptools therefore allows you to define "aliases" - shortcut names for
an arbitrary string of commands and options, using ``setup.py alias aliasname
expansion``, where aliasname is the name of the new alias, and the remainder of
the command line supplies its expansion. For example, this command defines
a sitewide alias called "daily", that sets various ``egg_info`` tagging
options::
setup.py alias --global-config daily egg_info --tag-build=development
Once the alias is defined, it can then be used with other setup commands,
e.g.::
setup.py daily bdist_egg # generate a daily-build .egg file
setup.py daily sdist # generate a daily-build source distro
setup.py daily sdist bdist_egg # generate both
The above commands are interpreted as if the word ``daily`` were replaced with
``egg_info --tag-build=development``.
Note that setuptools will expand each alias *at most once* in a given command
line. This serves two purposes. First, if you accidentally create an alias
loop, it will have no effect; you'll instead get an error message about an
unknown command. Second, it allows you to define an alias for a command, that
uses that command. For example, this (project-local) alias::
setup.py alias bdist_egg bdist_egg rotate -k1 -m.egg
redefines the ``bdist_egg`` command so that it always runs the ``rotate``
command afterwards to delete all but the newest egg file. It doesn't loop
indefinitely on ``bdist_egg`` because the alias is only expanded once when
used.
You can remove a defined alias with the ``--remove`` (or ``-r``) option, e.g.::
setup.py alias --global-config --remove daily
would delete the "daily" alias we defined above.
Aliases can be defined on a project-specific, per-user, or sitewide basis. The
default is to define or remove a project-specific alias, but you can use any of
the `configuration file options`_ (listed under the `saveopts`_ command, below)
to determine which distutils configuration file an aliases will be added to
(or removed from).
Note that if you omit the "expansion" argument to the ``alias`` command,
you'll get output showing that alias' current definition (and what
configuration file it's defined in). If you omit the alias name as well,
you'll get a listing of all current aliases along with their configuration
file locations.
``bdist_egg`` - Create a Python Egg for the project
===================================================
This command generates a Python Egg (``.egg`` file) for the project. Python
Eggs are the preferred binary distribution format for EasyInstall, because they
are cross-platform (for "pure" packages), directly importable, and contain
project metadata including scripts and information about the project's
dependencies. They can be simply downloaded and added to ``sys.path``
directly, or they can be placed in a directory on ``sys.path`` and then
automatically discovered by the egg runtime system.
This command runs the `egg_info`_ command (if it hasn't already run) to update
the project's metadata (``.egg-info``) directory. If you have added any extra
metadata files to the ``.egg-info`` directory, those files will be included in
the new egg file's metadata directory, for use by the egg runtime system or by
any applications or frameworks that use that metadata.
You won't usually need to specify any special options for this command; just
use ``bdist_egg`` and you're done. But there are a few options that may
be occasionally useful:
``--dist-dir=DIR, -d DIR``
Set the directory where the ``.egg`` file will be placed. If you don't
supply this, then the ``--dist-dir`` setting of the ``bdist`` command
will be used, which is usually a directory named ``dist`` in the project
directory.
``--plat-name=PLATFORM, -p PLATFORM``
Set the platform name string that will be embedded in the egg's filename
(assuming the egg contains C extensions). This can be used to override
the distutils default platform name with something more meaningful. Keep
in mind, however, that the egg runtime system expects to see eggs with
distutils platform names, so it may ignore or reject eggs with non-standard
platform names. Similarly, the EasyInstall program may ignore them when
searching web pages for download links. However, if you are
cross-compiling or doing some other unusual things, you might find a use
for this option.
``--exclude-source-files``
Don't include any modules' ``.py`` files in the egg, just compiled Python,
C, and data files. (Note that this doesn't affect any ``.py`` files in the
EGG-INFO directory or its subdirectories, since for example there may be
scripts with a ``.py`` extension which must still be retained.) We don't
recommend that you use this option except for packages that are being
bundled for proprietary end-user applications, or for "embedded" scenarios
where space is at an absolute premium. On the other hand, if your package
is going to be installed and used in compressed form, you might as well
exclude the source because Python's ``traceback`` module doesn't currently
understand how to display zipped source code anyway, or how to deal with
files that are in a different place from where their code was compiled.
There are also some options you will probably never need, but which are there
because they were copied from similar ``bdist`` commands used as an example for
creating this one. They may be useful for testing and debugging, however,
which is why we kept them:
``--keep-temp, -k``
Keep the contents of the ``--bdist-dir`` tree around after creating the
``.egg`` file.
``--bdist-dir=DIR, -b DIR``
Set the temporary directory for creating the distribution. The entire
contents of this directory are zipped to create the ``.egg`` file, after
running various installation commands to copy the package's modules, data,
and extensions here.
``--skip-build``
Skip doing any "build" commands; just go straight to the
install-and-compress phases.
.. _develop:
``develop`` - Deploy the project source in "Development Mode"
=============================================================
This command allows you to deploy your project's source for use in one or more
"staging areas" where it will be available for importing. This deployment is
done in such a way that changes to the project source are immediately available
in the staging area(s), without needing to run a build or install step after
each change.
The ``develop`` command works by creating an ``.egg-link`` file (named for the
project) in the given staging area. If the staging area is Python's
``site-packages`` directory, it also updates an ``easy-install.pth`` file so
that the project is on ``sys.path`` by default for all programs run using that
Python installation.
The ``develop`` command also installs wrapper scripts in the staging area (or
a separate directory, as specified) that will ensure the project's dependencies
are available on ``sys.path`` before running the project's source scripts.
And, it ensures that any missing project dependencies are available in the
staging area, by downloading and installing them if necessary.
Last, but not least, the ``develop`` command invokes the ``build_ext -i``
command to ensure any C extensions in the project have been built and are
up-to-date, and the ``egg_info`` command to ensure the project's metadata is
updated (so that the runtime and wrappers know what the project's dependencies
are). If you make any changes to the project's setup script or C extensions,
you should rerun the ``develop`` command against all relevant staging areas to
keep the project's scripts, metadata and extensions up-to-date. Most other
kinds of changes to your project should not require any build operations or
rerunning ``develop``, but keep in mind that even minor changes to the setup
script (e.g. changing an entry point definition) require you to re-run the
``develop`` or ``test`` commands to keep the distribution updated.
Here are some of the options that the ``develop`` command accepts. Note that
they affect the project's dependencies as well as the project itself, so if you
have dependencies that need to be installed and you use ``--exclude-scripts``
(for example), the dependencies' scripts will not be installed either! For
this reason, you may want to use EasyInstall to install the project's
dependencies before using the ``develop`` command, if you need finer control
over the installation options for dependencies.
``--uninstall, -u``
Un-deploy the current project. You may use the ``--install-dir`` or ``-d``
option to designate the staging area. The created ``.egg-link`` file will
be removed, if present and it is still pointing to the project directory.
The project directory will be removed from ``easy-install.pth`` if the
staging area is Python's ``site-packages`` directory.
Note that this option currently does *not* uninstall script wrappers! You
must uninstall them yourself, or overwrite them by using EasyInstall to
activate a different version of the package. You can also avoid installing
script wrappers in the first place, if you use the ``--exclude-scripts``
(aka ``-x``) option when you run ``develop`` to deploy the project.
``--multi-version, -m``
"Multi-version" mode. Specifying this option prevents ``develop`` from
adding an ``easy-install.pth`` entry for the project(s) being deployed, and
if an entry for any version of a project already exists, the entry will be
removed upon successful deployment. In multi-version mode, no specific
version of the package is available for importing, unless you use
``pkg_resources.require()`` to put it on ``sys.path``, or you are running
a wrapper script generated by ``setuptools`` or EasyInstall. (In which
case the wrapper script calls ``require()`` for you.)
Note that if you install to a directory other than ``site-packages``,
this option is automatically in effect, because ``.pth`` files can only be
used in ``site-packages`` (at least in Python 2.3 and 2.4). So, if you use
the ``--install-dir`` or ``-d`` option (or they are set via configuration
file(s)) your project and its dependencies will be deployed in multi-
version mode.
``--install-dir=DIR, -d DIR``
Set the installation directory (staging area). If this option is not
directly specified on the command line or in a distutils configuration
file, the distutils default installation location is used. Normally, this
will be the ``site-packages`` directory, but if you are using distutils
configuration files, setting things like ``prefix`` or ``install_lib``,
then those settings are taken into account when computing the default
staging area.
``--script-dir=DIR, -s DIR``
Set the script installation directory. If you don't supply this option
(via the command line or a configuration file), but you *have* supplied
an ``--install-dir`` (via command line or config file), then this option
defaults to the same directory, so that the scripts will be able to find
their associated package installation. Otherwise, this setting defaults
to the location where the distutils would normally install scripts, taking
any distutils configuration file settings into account.
``--exclude-scripts, -x``
Don't deploy script wrappers. This is useful if you don't want to disturb
existing versions of the scripts in the staging area.
``--always-copy, -a``
Copy all needed distributions to the staging area, even if they
are already present in another directory on ``sys.path``. By default, if
a requirement can be met using a distribution that is already available in
a directory on ``sys.path``, it will not be copied to the staging area.
``--egg-path=DIR``
Force the generated ``.egg-link`` file to use a specified relative path
to the source directory. This can be useful in circumstances where your
installation directory is being shared by code running under multiple
platforms (e.g. Mac and Windows) which have different absolute locations
for the code under development, but the same *relative* locations with
respect to the installation directory. If you use this option when
installing, you must supply the same relative path when uninstalling.
In addition to the above options, the ``develop`` command also accepts all of
the same options accepted by ``easy_install``. If you've configured any
``easy_install`` settings in your ``setup.cfg`` (or other distutils config
files), the ``develop`` command will use them as defaults, unless you override
them in a ``[develop]`` section or on the command line.
``easy_install`` - Find and install packages
============================================
This command runs the `EasyInstall tool
<easy_install.html>`_ for you. It is exactly
equivalent to running the ``easy_install`` command. All command line arguments
following this command are consumed and not processed further by the distutils,
so this must be the last command listed on the command line. Please see
the EasyInstall documentation for the options reference and usage examples.
Normally, there is no reason to use this command via the command line, as you
can just use ``easy_install`` directly. It's only listed here so that you know
it's a distutils command, which means that you can:
* create command aliases that use it,
* create distutils extensions that invoke it as a subcommand, and
* configure options for it in your ``setup.cfg`` or other distutils config
files.
.. _egg_info:
``egg_info`` - Create egg metadata and set build tags
=====================================================
This command performs two operations: it updates a project's ``.egg-info``
metadata directory (used by the ``bdist_egg``, ``develop``, and ``test``
commands), and it allows you to temporarily change a project's version string,
to support "daily builds" or "snapshot" releases. It is run automatically by
the ``sdist``, ``bdist_egg``, ``develop``, ``register``, and ``test`` commands
in order to update the project's metadata, but you can also specify it
explicitly in order to temporarily change the project's version string while
executing other commands. (It also generates the``.egg-info/SOURCES.txt``
manifest file, which is used when you are building source distributions.)
In addition to writing the core egg metadata defined by ``setuptools`` and
required by ``pkg_resources``, this command can be extended to write other
metadata files as well, by defining entry points in the ``egg_info.writers``
group. See the section on `Adding new EGG-INFO Files`_ below for more details.
Note that using additional metadata writers may require you to include a
``setup_requires`` argument to ``setup()`` in order to ensure that the desired
writers are available on ``sys.path``.
Release Tagging Options
-----------------------
The following options can be used to modify the project's version string for
all remaining commands on the setup command line. The options are processed
in the order shown, so if you use more than one, the requested tags will be
added in the following order:
``--tag-build=NAME, -b NAME``
Append NAME to the project's version string. Due to the way setuptools
processes "pre-release" version suffixes beginning with the letters "a"
through "e" (like "alpha", "beta", and "candidate"), you will usually want
to use a tag like ".build" or ".dev", as this will cause the version number
to be considered *lower* than the project's default version. (If you
want to make the version number *higher* than the default version, you can
always leave off --tag-build and then use one or both of the following
options.)
If you have a default build tag set in your ``setup.cfg``, you can suppress
it on the command line using ``-b ""`` or ``--tag-build=""`` as an argument
to the ``egg_info`` command.
``--tag-date, -d``
Add a date stamp of the form "-YYYYMMDD" (e.g. "-20050528") to the
project's version number.
``--no-date, -D``
Don't include a date stamp in the version number. This option is included
so you can override a default setting in ``setup.cfg``.
(Note: Because these options modify the version number used for source and
binary distributions of your project, you should first make sure that you know
how the resulting version numbers will be interpreted by automated tools
like EasyInstall. See the section above on `Specifying Your Project's
Version`_ for an explanation of pre- and post-release tags, as well as tips on
how to choose and verify a versioning scheme for your your project.)
For advanced uses, there is one other option that can be set, to change the
location of the project's ``.egg-info`` directory. Commands that need to find
the project's source directory or metadata should get it from this setting:
Other ``egg_info`` Options
--------------------------
``--egg-base=SOURCEDIR, -e SOURCEDIR``
Specify the directory that should contain the .egg-info directory. This
should normally be the root of your project's source tree (which is not
necessarily the same as your project directory; some projects use a ``src``
or ``lib`` subdirectory as the source root). You should not normally need
to specify this directory, as it is normally determined from the
``package_dir`` argument to the ``setup()`` function, if any. If there is
no ``package_dir`` set, this option defaults to the current directory.
``egg_info`` Examples
---------------------
Creating a dated "nightly build" snapshot egg::
python setup.py egg_info --tag-date --tag-build=DEV bdist_egg
Creating and uploading a release with no version tags, even if some default
tags are specified in ``setup.cfg``::
python setup.py egg_info -RDb "" sdist bdist_egg register upload
(Notice that ``egg_info`` must always appear on the command line *before* any
commands that you want the version changes to apply to.)
.. _install command:
``install`` - Run ``easy_install`` or old-style installation
============================================================
The setuptools ``install`` command is basically a shortcut to run the
``easy_install`` command on the current project. However, for convenience
in creating "system packages" of setuptools-based projects, you can also
use this option:
``--single-version-externally-managed``
This boolean option tells the ``install`` command to perform an "old style"
installation, with the addition of an ``.egg-info`` directory so that the
installed project will still have its metadata available and operate
normally. If you use this option, you *must* also specify the ``--root``
or ``--record`` options (or both), because otherwise you will have no way
to identify and remove the installed files.
This option is automatically in effect when ``install`` is invoked by another
distutils command, so that commands like ``bdist_wininst`` and ``bdist_rpm``
will create system packages of eggs. It is also automatically in effect if
you specify the ``--root`` option.
``install_egg_info`` - Install an ``.egg-info`` directory in ``site-packages``
==============================================================================
Setuptools runs this command as part of ``install`` operations that use the
``--single-version-externally-managed`` options. You should not invoke it
directly; it is documented here for completeness and so that distutils
extensions such as system package builders can make use of it. This command
has only one option:
``--install-dir=DIR, -d DIR``
The parent directory where the ``.egg-info`` directory will be placed.
Defaults to the same as the ``--install-dir`` option specified for the
``install_lib`` command, which is usually the system ``site-packages``
directory.
This command assumes that the ``egg_info`` command has been given valid options
via the command line or ``setup.cfg``, as it will invoke the ``egg_info``
command and use its options to locate the project's source ``.egg-info``
directory.
.. _rotate:
``rotate`` - Delete outdated distribution files
===============================================
As you develop new versions of your project, your distribution (``dist``)
directory will gradually fill up with older source and/or binary distribution
files. The ``rotate`` command lets you automatically clean these up, keeping
only the N most-recently modified files matching a given pattern.
``--match=PATTERNLIST, -m PATTERNLIST``
Comma-separated list of glob patterns to match. This option is *required*.
The project name and ``-*`` is prepended to the supplied patterns, in order
to match only distributions belonging to the current project (in case you
have a shared distribution directory for multiple projects). Typically,
you will use a glob pattern like ``.zip`` or ``.egg`` to match files of
the specified type. Note that each supplied pattern is treated as a
distinct group of files for purposes of selecting files to delete.
``--keep=COUNT, -k COUNT``
Number of matching distributions to keep. For each group of files
identified by a pattern specified with the ``--match`` option, delete all
but the COUNT most-recently-modified files in that group. This option is
*required*.
``--dist-dir=DIR, -d DIR``
Directory where the distributions are. This defaults to the value of the
``bdist`` command's ``--dist-dir`` option, which will usually be the
project's ``dist`` subdirectory.
**Example 1**: Delete all .tar.gz files from the distribution directory, except
for the 3 most recently modified ones::
setup.py rotate --match=.tar.gz --keep=3
**Example 2**: Delete all Python 2.3 or Python 2.4 eggs from the distribution
directory, except the most recently modified one for each Python version::
setup.py rotate --match=-py2.3*.egg,-py2.4*.egg --keep=1
.. _saveopts:
``saveopts`` - Save used options to a configuration file
========================================================
Finding and editing ``distutils`` configuration files can be a pain, especially
since you also have to translate the configuration options from command-line
form to the proper configuration file format. You can avoid these hassles by
using the ``saveopts`` command. Just add it to the command line to save the
options you used. For example, this command builds the project using
the ``mingw32`` C compiler, then saves the --compiler setting as the default
for future builds (even those run implicitly by the ``install`` command)::
setup.py build --compiler=mingw32 saveopts
The ``saveopts`` command saves all options for every command specified on the
command line to the project's local ``setup.cfg`` file, unless you use one of
the `configuration file options`_ to change where the options are saved. For
example, this command does the same as above, but saves the compiler setting
to the site-wide (global) distutils configuration::
setup.py build --compiler=mingw32 saveopts -g
Note that it doesn't matter where you place the ``saveopts`` command on the
command line; it will still save all the options specified for all commands.
For example, this is another valid way to spell the last example::
setup.py saveopts -g build --compiler=mingw32
Note, however, that all of the commands specified are always run, regardless of
where ``saveopts`` is placed on the command line.
Configuration File Options
--------------------------
Normally, settings such as options and aliases are saved to the project's
local ``setup.cfg`` file. But you can override this and save them to the
global or per-user configuration files, or to a manually-specified filename.
``--global-config, -g``
Save settings to the global ``distutils.cfg`` file inside the ``distutils``
package directory. You must have write access to that directory to use
this option. You also can't combine this option with ``-u`` or ``-f``.
``--user-config, -u``
Save settings to the current user's ``~/.pydistutils.cfg`` (POSIX) or
``$HOME/pydistutils.cfg`` (Windows) file. You can't combine this option
with ``-g`` or ``-f``.
``--filename=FILENAME, -f FILENAME``
Save settings to the specified configuration file to use. You can't
combine this option with ``-g`` or ``-u``. Note that if you specify a
non-standard filename, the ``distutils`` and ``setuptools`` will not
use the file's contents. This option is mainly included for use in
testing.
These options are used by other ``setuptools`` commands that modify
configuration files, such as the `alias`_ and `setopt`_ commands.
.. _setopt:
``setopt`` - Set a distutils or setuptools option in a config file
==================================================================
This command is mainly for use by scripts, but it can also be used as a quick
and dirty way to change a distutils configuration option without having to
remember what file the options are in and then open an editor.
**Example 1**. Set the default C compiler to ``mingw32`` (using long option
names)::
setup.py setopt --command=build --option=compiler --set-value=mingw32
**Example 2**. Remove any setting for the distutils default package
installation directory (short option names)::
setup.py setopt -c install -o install_lib -r
Options for the ``setopt`` command:
``--command=COMMAND, -c COMMAND``
Command to set the option for. This option is required.
``--option=OPTION, -o OPTION``
The name of the option to set. This option is required.
``--set-value=VALUE, -s VALUE``
The value to set the option to. Not needed if ``-r`` or ``--remove`` is
set.
``--remove, -r``
Remove (unset) the option, instead of setting it.
In addition to the above options, you may use any of the `configuration file
options`_ (listed under the `saveopts`_ command, above) to determine which
distutils configuration file the option will be added to (or removed from).
.. _test:
``test`` - Build package and run a unittest suite
=================================================
When doing test-driven development, or running automated builds that need
testing before they are deployed for downloading or use, it's often useful
to be able to run a project's unit tests without actually deploying the project
anywhere, even using the ``develop`` command. The ``test`` command runs a
project's unit tests without actually deploying it, by temporarily putting the
project's source on ``sys.path``, after first running ``build_ext -i`` and
``egg_info`` to ensure that any C extensions and project metadata are
up-to-date.
To use this command, your project's tests must be wrapped in a ``unittest``
test suite by either a function, a ``TestCase`` class or method, or a module
or package containing ``TestCase`` classes. If the named suite is a module,
and the module has an ``additional_tests()`` function, it is called and the
result (which must be a ``unittest.TestSuite``) is added to the tests to be
run. If the named suite is a package, any submodules and subpackages are
recursively added to the overall test suite. (Note: if your project specifies
a ``test_loader``, the rules for processing the chosen ``test_suite`` may
differ; see the `test_loader`_ documentation for more details.)
Note that many test systems including ``doctest`` support wrapping their
non-``unittest`` tests in ``TestSuite`` objects. So, if you are using a test
package that does not support this, we suggest you encourage its developers to
implement test suite support, as this is a convenient and standard way to
aggregate a collection of tests to be run under a common test harness.
By default, tests will be run in the "verbose" mode of the ``unittest``
package's text test runner, but you can get the "quiet" mode (just dots) if
you supply the ``-q`` or ``--quiet`` option, either as a global option to
the setup script (e.g. ``setup.py -q test``) or as an option for the ``test``
command itself (e.g. ``setup.py test -q``). There is one other option
available:
``--test-suite=NAME, -s NAME``
Specify the test suite (or module, class, or method) to be run
(e.g. ``some_module.test_suite``). The default for this option can be
set by giving a ``test_suite`` argument to the ``setup()`` function, e.g.::
setup(
# ...
test_suite="my_package.tests.test_all"
)
If you did not set a ``test_suite`` in your ``setup()`` call, and do not
provide a ``--test-suite`` option, an error will occur.
.. _upload:
``upload`` - Upload source and/or egg distributions to PyPI
===========================================================
The ``upload`` command is implemented and `documented
<https://docs.python.org/3.1/distutils/uploading.html>`_
in distutils.
Setuptools augments the ``upload`` command with support
for `keyring <https://pypi.python.org/pypi/keyring>`_,
allowing the password to be stored in a secure
location and not in plaintext in the .pypirc file. To use
keyring, first install keyring and set the password for
the relevant repository, e.g.::
python -m keyring set <repository> <username>
Password for '<username>' in '<repository>': ********
Then, in .pypirc, set the repository configuration as normal,
but omit the password. Thereafter, uploads will use the
password from the keyring.
New in 20.1: Added keyring support.
-----------------------------------------
Configuring setup() using setup.cfg files
-----------------------------------------
.. note:: New in 30.3.0 (8 Dec 2016).
.. important:: ``setup.py`` with ``setup()`` function call is still required even
if your configuration resides in ``setup.cfg``.
``Setuptools`` allows using configuration files (usually `setup.cfg`)
to define package’s metadata and other options which are normally supplied
to ``setup()`` function.
This approach not only allows automation scenarios, but also reduces
boilerplate code in some cases.
.. note::
Implementation presents limited compatibility with distutils2-like
``setup.cfg`` sections (used by ``pbr`` and ``d2to1`` packages).
Namely: only metadata related keys from ``metadata`` section are supported
(except for ``description-file``); keys from ``files``, ``entry_points``
and ``backwards_compat`` are not supported.
.. code-block:: ini
[metadata]
name = my_package
version = attr: src.VERSION
description = My package description
long_description = file: README.rst, CHANGELOG.rst, LICENSE.rst
keywords = one, two
license = BSD 3-Clause License
classifiers =
Framework :: Django
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5
[options]
zip_safe = False
include_package_data = True
packages = find:
scripts =
bin/first.py
bin/second.py
[options.package_data]
* = *.txt, *.rst
hello = *.msg
[options.extras_require]
pdf = ReportLab>=1.2; RXP
rest = docutils>=0.3; pack ==1.1, ==1.3
[options.packages.find]
exclude =
src.subpackage1
src.subpackage2
Metadata and options could be set in sections with the same names.
* Keys are the same as keyword arguments one provides to ``setup()`` function.
* Complex values could be placed comma-separated or one per line
in *dangling* sections. The following are the same:
.. code-block:: ini
[metadata]
keywords = one, two
[metadata]
keywords =
one
two
* In some cases complex values could be provided in subsections for clarity.
* Some keys allow ``file:``, ``attr:`` and ``find:`` directives to cover
common usecases.
* Unknown keys are ignored.
Specifying values
=================
Some values are treated as simple strings, some allow more logic.
Type names used below:
* ``str`` - simple string
* ``list-comma`` - dangling list or comma-separated values string
* ``list-semi`` - dangling list or semicolon-separated values string
* ``bool`` - ``True`` is 1, yes, true
* ``dict`` - list-comma where keys from values are separated by =
* ``section`` - values could be read from a dedicated (sub)section
Special directives:
* ``attr:`` - value could be read from module attribute
* ``file:`` - value could be read from a list of files and then concatenated
.. note::
``file:`` directive is sandboxed and won't reach anything outside
directory with ``setup.py``.
Metadata
--------
.. note::
Aliases given below are supported for compatibility reasons,
but not advised.
================= ================= =====
Key Aliases Accepted value type
================= ================= =====
name str
version attr:, str
url home-page str
download_url download-url str
author str
author_email author-email str
maintainer str
maintainer_email maintainer-email str
classifiers classifier file:, list-comma
license file:, str
description summary file:, str
long_description long-description file:, str
keywords list-comma
platforms platform list-comma
provides list-comma
requires list-comma
obsoletes list-comma
================= ================= =====
.. note::
**version** - ``attr:`` supports callables; supports iterables;
unsupported types are casted using ``str()``.
Options
-------
======================= =====
Key Accepted value type
======================= =====
zip_safe bool
setup_requires list-semi
install_requires list-semi
extras_require section
python_requires str
entry_points file:, section
use_2to3 bool
use_2to3_fixers list-comma
use_2to3_exclude_fixers list-comma
convert_2to3_doctests list-comma
scripts list-comma
eager_resources list-comma
dependency_links list-comma
tests_require list-semi
include_package_data bool
packages find:, list-comma
package_dir dict
package_data section
exclude_package_data section
namespace_packages list-comma
py_modules list-comma
======================= =====
.. note::
**packages** - ``find:`` directive can be further configured
in a dedicated subsection `options.packages.find`. This subsection
accepts the same keys as `setuptools.find` function:
`where`, `include`, `exclude`.
Configuration API
=================
Some automation tools may wish to access data from a configuration file.
``Setuptools`` exposes ``read_configuration()`` function allowing
parsing ``metadata`` and ``options`` sections into a dictionary.
.. code-block:: python
from setuptools.config import read_configuration
conf_dict = read_configuration('/home/user/dev/package/setup.cfg')
By default ``read_configuration()`` will read only file provided
in the first argument. To include values from other configuration files
which could be in various places set `find_others` function argument
to ``True``.
If you have only a configuration file but not the whole package you can still
try to get data out of it with the help of `ignore_option_errors` function
argument. When it is set to ``True`` all options with errors possibly produced
by directives, such as ``attr:`` and others will be silently ignored.
As a consequence the resulting dictionary will include no such options.
--------------------------------
Extending and Reusing Setuptools
--------------------------------
Creating ``distutils`` Extensions
=================================
It can be hard to add new commands or setup arguments to the distutils. But
the ``setuptools`` package makes it a bit easier, by allowing you to distribute
a distutils extension as a separate project, and then have projects that need
the extension just refer to it in their ``setup_requires`` argument.
With ``setuptools``, your distutils extension projects can hook in new
commands and ``setup()`` arguments just by defining "entry points". These
are mappings from command or argument names to a specification of where to
import a handler from. (See the section on `Dynamic Discovery of Services and
Plugins`_ above for some more background on entry points.)
Adding Commands
---------------
You can add new ``setup`` commands by defining entry points in the
``distutils.commands`` group. For example, if you wanted to add a ``foo``
command, you might add something like this to your distutils extension
project's setup script::
setup(
# ...
entry_points={
"distutils.commands": [
"foo = mypackage.some_module:foo",
],
},
)
(Assuming, of course, that the ``foo`` class in ``mypackage.some_module`` is
a ``setuptools.Command`` subclass.)
Once a project containing such entry points has been activated on ``sys.path``,
(e.g. by running "install" or "develop" with a site-packages installation
directory) the command(s) will be available to any ``setuptools``-based setup
scripts. It is not necessary to use the ``--command-packages`` option or
to monkeypatch the ``distutils.command`` package to install your commands;
``setuptools`` automatically adds a wrapper to the distutils to search for
entry points in the active distributions on ``sys.path``. In fact, this is
how setuptools' own commands are installed: the setuptools project's setup
script defines entry points for them!
Adding ``setup()`` Arguments
----------------------------
Sometimes, your commands may need additional arguments to the ``setup()``
call. You can enable this by defining entry points in the
``distutils.setup_keywords`` group. For example, if you wanted a ``setup()``
argument called ``bar_baz``, you might add something like this to your
distutils extension project's setup script::
setup(
# ...
entry_points={
"distutils.commands": [
"foo = mypackage.some_module:foo",
],
"distutils.setup_keywords": [
"bar_baz = mypackage.some_module:validate_bar_baz",
],
},
)
The idea here is that the entry point defines a function that will be called
to validate the ``setup()`` argument, if it's supplied. The ``Distribution``
object will have the initial value of the attribute set to ``None``, and the
validation function will only be called if the ``setup()`` call sets it to
a non-None value. Here's an example validation function::
def assert_bool(dist, attr, value):
"""Verify that value is True, False, 0, or 1"""
if bool(value) != value:
raise DistutilsSetupError(
"%r must be a boolean value (got %r)" % (attr,value)
)
Your function should accept three arguments: the ``Distribution`` object,
the attribute name, and the attribute value. It should raise a
``DistutilsSetupError`` (from the ``distutils.errors`` module) if the argument
is invalid. Remember, your function will only be called with non-None values,
and the default value of arguments defined this way is always None. So, your
commands should always be prepared for the possibility that the attribute will
be ``None`` when they access it later.
If more than one active distribution defines an entry point for the same
``setup()`` argument, *all* of them will be called. This allows multiple
distutils extensions to define a common argument, as long as they agree on
what values of that argument are valid.
Also note that as with commands, it is not necessary to subclass or monkeypatch
the distutils ``Distribution`` class in order to add your arguments; it is
sufficient to define the entry points in your extension, as long as any setup
script using your extension lists your project in its ``setup_requires``
argument.
Adding new EGG-INFO Files
-------------------------
Some extensible applications or frameworks may want to allow third parties to
develop plugins with application or framework-specific metadata included in
the plugins' EGG-INFO directory, for easy access via the ``pkg_resources``
metadata API. The easiest way to allow this is to create a distutils extension
to be used from the plugin projects' setup scripts (via ``setup_requires``)
that defines a new setup keyword, and then uses that data to write an EGG-INFO
file when the ``egg_info`` command is run.
The ``egg_info`` command looks for extension points in an ``egg_info.writers``
group, and calls them to write the files. Here's a simple example of a
distutils extension defining a setup argument ``foo_bar``, which is a list of
lines that will be written to ``foo_bar.txt`` in the EGG-INFO directory of any
project that uses the argument::
setup(
# ...
entry_points={
"distutils.setup_keywords": [
"foo_bar = setuptools.dist:assert_string_list",
],
"egg_info.writers": [
"foo_bar.txt = setuptools.command.egg_info:write_arg",
],
},
)
This simple example makes use of two utility functions defined by setuptools
for its own use: a routine to validate that a setup keyword is a sequence of
strings, and another one that looks up a setup argument and writes it to
a file. Here's what the writer utility looks like::
def write_arg(cmd, basename, filename):
argname = os.path.splitext(basename)[0]
value = getattr(cmd.distribution, argname, None)
if value is not None:
value = '\n'.join(value) + '\n'
cmd.write_or_delete_file(argname, filename, value)
As you can see, ``egg_info.writers`` entry points must be a function taking
three arguments: a ``egg_info`` command instance, the basename of the file to
write (e.g. ``foo_bar.txt``), and the actual full filename that should be
written to.
In general, writer functions should honor the command object's ``dry_run``
setting when writing files, and use the ``distutils.log`` object to do any
console output. The easiest way to conform to this requirement is to use
the ``cmd`` object's ``write_file()``, ``delete_file()``, and
``write_or_delete_file()`` methods exclusively for your file operations. See
those methods' docstrings for more details.
Adding Support for Revision Control Systems
-------------------------------------------------
If the files you want to include in the source distribution are tracked using
Git, Mercurial or SVN, you can use the following packages to achieve that:
- Git and Mercurial: `setuptools_scm <https://pypi.python.org/pypi/setuptools_scm>`_
- SVN: `setuptools_svn <https://pypi.python.org/pypi/setuptools_svn>`_
If you would like to create a plugin for ``setuptools`` to find files tracked
by another revision control system, you can do so by adding an entry point to
the ``setuptools.file_finders`` group. The entry point should be a function
accepting a single directory name, and should yield all the filenames within
that directory (and any subdirectories thereof) that are under revision
control.
For example, if you were going to create a plugin for a revision control system
called "foobar", you would write a function something like this:
.. code-block:: python
def find_files_for_foobar(dirname):
# loop to yield paths that start with `dirname`
And you would register it in a setup script using something like this::
entry_points={
"setuptools.file_finders": [
"foobar = my_foobar_module:find_files_for_foobar",
]
}
Then, anyone who wants to use your plugin can simply install it, and their
local setuptools installation will be able to find the necessary files.
It is not necessary to distribute source control plugins with projects that
simply use the other source control system, or to specify the plugins in
``setup_requires``. When you create a source distribution with the ``sdist``
command, setuptools automatically records what files were found in the
``SOURCES.txt`` file. That way, recipients of source distributions don't need
to have revision control at all. However, if someone is working on a package
by checking out with that system, they will need the same plugin(s) that the
original author is using.
A few important points for writing revision control file finders:
* Your finder function MUST return relative paths, created by appending to the
passed-in directory name. Absolute paths are NOT allowed, nor are relative
paths that reference a parent directory of the passed-in directory.
* Your finder function MUST accept an empty string as the directory name,
meaning the current directory. You MUST NOT convert this to a dot; just
yield relative paths. So, yielding a subdirectory named ``some/dir`` under
the current directory should NOT be rendered as ``./some/dir`` or
``/somewhere/some/dir``, but *always* as simply ``some/dir``
* Your finder function SHOULD NOT raise any errors, and SHOULD deal gracefully
with the absence of needed programs (i.e., ones belonging to the revision
control system itself. It *may*, however, use ``distutils.log.warn()`` to
inform the user of the missing program(s).
Subclassing ``Command``
-----------------------
Sorry, this section isn't written yet, and neither is a lot of what's below
this point.
XXX
Reusing ``setuptools`` Code
===========================
``ez_setup``
------------
XXX
``setuptools.archive_util``
---------------------------
XXX
``setuptools.sandbox``
----------------------
XXX
``setuptools.package_index``
----------------------------
XXX
Mailing List and Bug Tracker
============================
Please use the `distutils-sig mailing list`_ for questions and discussion about
setuptools, and the `setuptools bug tracker`_ ONLY for issues you have
confirmed via the list are actual bugs, and which you have reduced to a minimal
set of steps to reproduce.
.. _distutils-sig mailing list: http://mail.python.org/pipermail/distutils-sig/
.. _setuptools bug tracker: https://github.com/pypa/setuptools/
doc/alt-python27-setuptools/formats.txt 0000644 00000075012 15173017727 0014233 0 ustar 00 =====================================
The Internal Structure of Python Eggs
=====================================
STOP! This is not the first document you should read!
.. contents:: **Table of Contents**
----------------------
Eggs and their Formats
----------------------
A "Python egg" is a logical structure embodying the release of a
specific version of a Python project, comprising its code, resources,
and metadata. There are multiple formats that can be used to physically
encode a Python egg, and others can be developed. However, a key
principle of Python eggs is that they should be discoverable and
importable. That is, it should be possible for a Python application to
easily and efficiently find out what eggs are present on a system, and
to ensure that the desired eggs' contents are importable.
There are two basic formats currently implemented for Python eggs:
1. ``.egg`` format: a directory or zipfile *containing* the project's
code and resources, along with an ``EGG-INFO`` subdirectory that
contains the project's metadata
2. ``.egg-info`` format: a file or directory placed *adjacent* to the
project's code and resources, that directly contains the project's
metadata.
Both formats can include arbitrary Python code and resources, including
static data files, package and non-package directories, Python
modules, C extension modules, and so on. But each format is optimized
for different purposes.
The ``.egg`` format is well-suited to distribution and the easy
uninstallation or upgrades of code, since the project is essentially
self-contained within a single directory or file, unmingled with any
other projects' code or resources. It also makes it possible to have
multiple versions of a project simultaneously installed, such that
individual programs can select the versions they wish to use.
The ``.egg-info`` format, on the other hand, was created to support
backward-compatibility, performance, and ease of installation for system
packaging tools that expect to install all projects' code and resources
to a single directory (e.g. ``site-packages``). Placing the metadata
in that same directory simplifies the installation process, since it
isn't necessary to create ``.pth`` files or otherwise modify
``sys.path`` to include each installed egg.
Its disadvantage, however, is that it provides no support for clean
uninstallation or upgrades, and of course only a single version of a
project can be installed to a given directory. Thus, support from a
package management tool is required. (This is why setuptools' "install"
command refers to this type of egg installation as "single-version,
externally managed".) Also, they lack sufficient data to allow them to
be copied from their installation source. easy_install can "ship" an
application by copying ``.egg`` files or directories to a target
location, but it cannot do this for ``.egg-info`` installs, because
there is no way to tell what code and resources belong to a particular
egg -- there may be several eggs "scrambled" together in a single
installation location, and the ``.egg-info`` format does not currently
include a way to list the files that were installed. (This may change
in a future version.)
Code and Resources
==================
The layout of the code and resources is dictated by Python's normal
import layout, relative to the egg's "base location".
For the ``.egg`` format, the base location is the ``.egg`` itself. That
is, adding the ``.egg`` filename or directory name to ``sys.path``
makes its contents importable.
For the ``.egg-info`` format, however, the base location is the
directory that *contains* the ``.egg-info``, and thus it is the
directory that must be added to ``sys.path`` to make the egg importable.
(Note that this means that the "normal" installation of a package to a
``sys.path`` directory is sufficient to make it an "egg" if it has an
``.egg-info`` file or directory installed alongside of it.)
Project Metadata
=================
If eggs contained only code and resources, there would of course be
no difference between them and any other directory or zip file on
``sys.path``. Thus, metadata must also be included, using a metadata
file or directory.
For the ``.egg`` format, the metadata is placed in an ``EGG-INFO``
subdirectory, directly within the ``.egg`` file or directory. For the
``.egg-info`` format, metadata is stored directly within the
``.egg-info`` directory itself.
The minimum project metadata that all eggs must have is a standard
Python ``PKG-INFO`` file, named ``PKG-INFO`` and placed within the
metadata directory appropriate to the format. Because it's possible for
this to be the only metadata file included, ``.egg-info`` format eggs
are not required to be a directory; they can just be a ``.egg-info``
file that directly contains the ``PKG-INFO`` metadata. This eliminates
the need to create a directory just to store one file. This option is
*not* available for ``.egg`` formats, since setuptools always includes
other metadata. (In fact, setuptools itself never generates
``.egg-info`` files, either; the support for using files was added so
that the requirement could easily be satisfied by other tools, such
as the distutils in Python 2.5).
In addition to the ``PKG-INFO`` file, an egg's metadata directory may
also include files and directories representing various forms of
optional standard metadata (see the section on `Standard Metadata`_,
below) or user-defined metadata required by the project. For example,
some projects may define a metadata format to describe their application
plugins, and metadata in this format would then be included by plugin
creators in their projects' metadata directories.
Filename-Embedded Metadata
==========================
To allow introspection of installed projects and runtime resolution of
inter-project dependencies, a certain amount of information is embedded
in egg filenames. At a minimum, this includes the project name, and
ideally will also include the project version number. Optionally, it
can also include the target Python version and required runtime
platform if platform-specific C code is included. The syntax of an
egg filename is as follows::
name ["-" version ["-py" pyver ["-" required_platform]]] "." ext
The "name" and "version" should be escaped using the ``to_filename()``
function provided by ``pkg_resources``, after first processing them with
``safe_name()`` and ``safe_version()`` respectively. These latter two
functions can also be used to later "unescape" these parts of the
filename. (For a detailed description of these transformations, please
see the "Parsing Utilities" section of the ``pkg_resources`` manual.)
The "pyver" string is the Python major version, as found in the first
3 characters of ``sys.version``. "required_platform" is essentially
a distutils ``get_platform()`` string, but with enhancements to properly
distinguish Mac OS versions. (See the ``get_build_platform()``
documentation in the "Platform Utilities" section of the
``pkg_resources`` manual for more details.)
Finally, the "ext" is either ``.egg`` or ``.egg-info``, as appropriate
for the egg's format.
Normally, an egg's filename should include at least the project name and
version, as this allows the runtime system to find desired project
versions without having to read the egg's PKG-INFO to determine its
version number.
Setuptools, however, only includes the version number in the filename
when an ``.egg`` file is built using the ``bdist_egg`` command, or when
an ``.egg-info`` directory is being installed by the
``install_egg_info`` command. When generating metadata for use with the
original source tree, it only includes the project name, so that the
directory will not have to be renamed each time the project's version
changes.
This is especially important when version numbers change frequently, and
the source metadata directory is kept under version control with the
rest of the project. (As would be the case when the project's source
includes project-defined metadata that is not generated from by
setuptools from data in the setup script.)
Egg Links
=========
In addition to the ``.egg`` and ``.egg-info`` formats, there is a third
egg-related extension that you may encounter on occasion: ``.egg-link``
files.
These files are not eggs, strictly speaking. They simply provide a way
to reference an egg that is not physically installed in the desired
location. They exist primarily as a cross-platform alternative to
symbolic links, to support "installing" code that is being developed in
a different location than the desired installation location. For
example, if a user is developing an application plugin in their home
directory, but the plugin needs to be "installed" in an application
plugin directory, running "setup.py develop -md /path/to/app/plugins"
will install an ``.egg-link`` file in ``/path/to/app/plugins``, that
tells the egg runtime system where to find the actual egg (the user's
project source directory and its ``.egg-info`` subdirectory).
``.egg-link`` files are named following the format for ``.egg`` and
``.egg-info`` names, but only the project name is included; no version,
Python version, or platform information is included. When the runtime
searches for available eggs, ``.egg-link`` files are opened and the
actual egg file/directory name is read from them.
Each ``.egg-link`` file should contain a single file or directory name,
with no newlines. This filename should be the base location of one or
more eggs. That is, the name must either end in ``.egg``, or else it
should be the parent directory of one or more ``.egg-info`` format eggs.
As of setuptools 0.6c6, the path may be specified as a platform-independent
(i.e. ``/``-separated) relative path from the directory containing the
``.egg-link`` file, and a second line may appear in the file, specifying a
platform-independent relative path from the egg's base directory to its
setup script directory. This allows installation tools such as EasyInstall
to find the project's setup directory and build eggs or perform other setup
commands on it.
-----------------
Standard Metadata
-----------------
In addition to the minimum required ``PKG-INFO`` metadata, projects can
include a variety of standard metadata files or directories, as
described below. Except as otherwise noted, these files and directories
are automatically generated by setuptools, based on information supplied
in the setup script or through analysis of the project's code and
resources.
Most of these files and directories are generated via "egg-info
writers" during execution of the setuptools ``egg_info`` command, and
are listed in the ``egg_info.writers`` entry point group defined by
setuptools' own ``setup.py`` file.
Project authors can register their own metadata writers as entry points
in this group (as described in the setuptools manual under "Adding new
EGG-INFO Files") to cause setuptools to generate project-specific
metadata files or directories during execution of the ``egg_info``
command. It is up to project authors to document these new metadata
formats, if they create any.
``.txt`` File Formats
=====================
Files described in this section that have ``.txt`` extensions have a
simple lexical format consisting of a sequence of text lines, each line
terminated by a linefeed character (regardless of platform). Leading
and trailing whitespace on each line is ignored, as are blank lines and
lines whose first nonblank character is a ``#`` (comment symbol). (This
is the parsing format defined by the ``yield_lines()`` function of
the ``pkg_resources`` module.)
All ``.txt`` files defined by this section follow this format, but some
are also "sectioned" files, meaning that their contents are divided into
sections, using square-bracketed section headers akin to Windows
``.ini`` format. Note that this does *not* imply that the lines within
the sections follow an ``.ini`` format, however. Please see an
individual metadata file's documentation for a description of what the
lines and section names mean in that particular file.
Sectioned files can be parsed using the ``split_sections()`` function;
see the "Parsing Utilities" section of the ``pkg_resources`` manual for
for details.
Dependency Metadata
===================
``requires.txt``
----------------
This is a "sectioned" text file. Each section is a sequence of
"requirements", as parsed by the ``parse_requirements()`` function;
please see the ``pkg_resources`` manual for the complete requirement
parsing syntax.
The first, unnamed section (i.e., before the first section header) in
this file is the project's core requirements, which must be installed
for the project to function. (Specified using the ``install_requires``
keyword to ``setup()``).
The remaining (named) sections describe the project's "extra"
requirements, as specified using the ``extras_require`` keyword to
``setup()``. The section name is the name of the optional feature, and
the section body lists that feature's dependencies.
Note that it is not normally necessary to inspect this file directly;
``pkg_resources.Distribution`` objects have a ``requires()`` method
that can be used to obtain ``Requirement`` objects describing the
project's core and optional dependencies.
``setup_requires.txt``
----------------------
Much like ``requires.txt`` except represents the requirements
specified by the ``setup_requires`` parameter to the Distribution.
``dependency_links.txt``
------------------------
A list of dependency URLs, one per line, as specified using the
``dependency_links`` keyword to ``setup()``. These may be direct
download URLs, or the URLs of web pages containing direct download
links, and will be used by EasyInstall to find dependencies, as though
the user had manually provided them via the ``--find-links`` command
line option. Please see the setuptools manual and EasyInstall manual
for more information on specifying this option, and for information on
how EasyInstall processes ``--find-links`` URLs.
``depends.txt`` -- Obsolete, do not create!
-------------------------------------------
This file follows an identical format to ``requires.txt``, but is
obsolete and should not be used. The earliest versions of setuptools
required users to manually create and maintain this file, so the runtime
still supports reading it, if it exists. The new filename was created
so that it could be automatically generated from ``setup()`` information
without overwriting an existing hand-created ``depends.txt``, if one
was already present in the project's source ``.egg-info`` directory.
``namespace_packages.txt`` -- Namespace Package Metadata
========================================================
A list of namespace package names, one per line, as supplied to the
``namespace_packages`` keyword to ``setup()``. Please see the manuals
for setuptools and ``pkg_resources`` for more information about
namespace packages.
``entry_points.txt`` -- "Entry Point"/Plugin Metadata
=====================================================
This is a "sectioned" text file, whose contents encode the
``entry_points`` keyword supplied to ``setup()``. All sections are
named, as the section names specify the entry point groups in which the
corresponding section's entry points are registered.
Each section is a sequence of "entry point" lines, each parseable using
the ``EntryPoint.parse`` classmethod; please see the ``pkg_resources``
manual for the complete entry point parsing syntax.
Note that it is not necessary to parse this file directly; the
``pkg_resources`` module provides a variety of APIs to locate and load
entry points automatically. Please see the setuptools and
``pkg_resources`` manuals for details on the nature and uses of entry
points.
The ``scripts`` Subdirectory
============================
This directory is currently only created for ``.egg`` files built by
the setuptools ``bdist_egg`` command. It will contain copies of all
of the project's "traditional" scripts (i.e., those specified using the
``scripts`` keyword to ``setup()``). This is so that they can be
reconstituted when an ``.egg`` file is installed.
The scripts are placed here using the distutils' standard
``install_scripts`` command, so any ``#!`` lines reflect the Python
installation where the egg was built. But instead of copying the
scripts to the local script installation directory, EasyInstall writes
short wrapper scripts that invoke the original scripts from inside the
egg, after ensuring that sys.path includes the egg and any eggs it
depends on. For more about `script wrappers`_, see the section below on
`Installation and Path Management Issues`_.
Zip Support Metadata
====================
``native_libs.txt``
-------------------
A list of C extensions and other dynamic link libraries contained in
the egg, one per line. Paths are ``/``-separated and relative to the
egg's base location.
This file is generated as part of ``bdist_egg`` processing, and as such
only appears in ``.egg`` files (and ``.egg`` directories created by
unpacking them). It is used to ensure that all libraries are extracted
from a zipped egg at the same time, in case there is any direct linkage
between them. Please see the `Zip File Issues`_ section below for more
information on library and resource extraction from ``.egg`` files.
``eager_resources.txt``
-----------------------
A list of resource files and/or directories, one per line, as specified
via the ``eager_resources`` keyword to ``setup()``. Paths are
``/``-separated and relative to the egg's base location.
Resource files or directories listed here will be extracted
simultaneously, if any of the named resources are extracted, or if any
native libraries listed in ``native_libs.txt`` are extracted. Please
see the setuptools manual for details on what this feature is used for
and how it works, as well as the `Zip File Issues`_ section below.
``zip-safe`` and ``not-zip-safe``
---------------------------------
These are zero-length files, and either one or the other should exist.
If ``zip-safe`` exists, it means that the project will work properly
when installed as an ``.egg`` zipfile, and conversely the existence of
``not-zip-safe`` means the project should not be installed as an
``.egg`` file. The ``zip_safe`` option to setuptools' ``setup()``
determines which file will be written. If the option isn't provided,
setuptools attempts to make its own assessment of whether the package
can work, based on code and content analysis.
If neither file is present at installation time, EasyInstall defaults
to assuming that the project should be unzipped. (Command-line options
to EasyInstall, however, take precedence even over an existing
``zip-safe`` or ``not-zip-safe`` file.)
Note that these flag files appear only in ``.egg`` files generated by
``bdist_egg``, and in ``.egg`` directories created by unpacking such an
``.egg`` file.
``top_level.txt`` -- Conflict Management Metadata
=================================================
This file is a list of the top-level module or package names provided
by the project, one Python identifier per line.
Subpackages are not included; a project containing both a ``foo.bar``
and a ``foo.baz`` would include only one line, ``foo``, in its
``top_level.txt``.
This data is used by ``pkg_resources`` at runtime to issue a warning if
an egg is added to ``sys.path`` when its contained packages may have
already been imported.
(It was also once used to detect conflicts with non-egg packages at
installation time, but in more recent versions, setuptools installs eggs
in such a way that they always override non-egg packages, thus
preventing a problem from arising.)
``SOURCES.txt`` -- Source Files Manifest
========================================
This file is roughly equivalent to the distutils' ``MANIFEST`` file.
The differences are as follows:
* The filenames always use ``/`` as a path separator, which must be
converted back to a platform-specific path whenever they are read.
* The file is automatically generated by setuptools whenever the
``egg_info`` or ``sdist`` commands are run, and it is *not*
user-editable.
Although this metadata is included with distributed eggs, it is not
actually used at runtime for any purpose. Its function is to ensure
that setuptools-built *source* distributions can correctly discover
what files are part of the project's source, even if the list had been
generated using revision control metadata on the original author's
system.
In other words, ``SOURCES.txt`` has little or no runtime value for being
included in distributed eggs, and it is possible that future versions of
the ``bdist_egg`` and ``install_egg_info`` commands will strip it before
installation or distribution. Therefore, do not rely on its being
available outside of an original source directory or source
distribution.
------------------------------
Other Technical Considerations
------------------------------
Zip File Issues
===============
Although zip files resemble directories, they are not fully
substitutable for them. Most platforms do not support loading dynamic
link libraries contained in zipfiles, so it is not possible to directly
import C extensions from ``.egg`` zipfiles. Similarly, there are many
existing libraries -- whether in Python or C -- that require actual
operating system filenames, and do not work with arbitrary "file-like"
objects or in-memory strings, and thus cannot operate directly on the
contents of zip files.
To address these issues, the ``pkg_resources`` module provides a
"resource API" to support obtaining either the contents of a resource,
or a true operating system filename for the resource. If the egg
containing the resource is a directory, the resource's real filename
is simply returned. However, if the egg is a zipfile, then the
resource is first extracted to a cache directory, and the filename
within the cache is returned.
The cache directory is determined by the ``pkg_resources`` API; please
see the ``set_cache_path()`` and ``get_default_cache()`` documentation
for details.
The Extraction Process
----------------------
Resources are extracted to a cache subdirectory whose name is based
on the enclosing ``.egg`` filename and the path to the resource. If
there is already a file of the correct name, size, and timestamp, its
filename is returned to the requester. Otherwise, the desired file is
extracted first to a temporary name generated using
``mkstemp(".$extract",target_dir)``, and then its timestamp is set to
match the one in the zip file, before renaming it to its final name.
(Some collision detection and resolution code is used to handle the
fact that Windows doesn't overwrite files when renaming.)
If a resource directory is requested, all of its contents are
recursively extracted in this fashion, to ensure that the directory
name can be used as if it were valid all along.
If the resource requested for extraction is listed in the
``native_libs.txt`` or ``eager_resources.txt`` metadata files, then
*all* resources listed in *either* file will be extracted before the
requested resource's filename is returned, thus ensuring that all
C extensions and data used by them will be simultaneously available.
Extension Import Wrappers
-------------------------
Since Python's built-in zip import feature does not support loading
C extension modules from zipfiles, the setuptools ``bdist_egg`` command
generates special import wrappers to make it work.
The wrappers are ``.py`` files (along with corresponding ``.pyc``
and/or ``.pyo`` files) that have the same module name as the
corresponding C extension. These wrappers are located in the same
package directory (or top-level directory) within the zipfile, so that
say, ``foomodule.so`` will get a corresponding ``foo.py``, while
``bar/baz.pyd`` will get a corresponding ``bar/baz.py``.
These wrapper files contain a short stanza of Python code that asks
``pkg_resources`` for the filename of the corresponding C extension,
then reloads the module using the obtained filename. This will cause
``pkg_resources`` to first ensure that all of the egg's C extensions
(and any accompanying "eager resources") are extracted to the cache
before attempting to link to the C library.
Note, by the way, that ``.egg`` directories will also contain these
wrapper files. However, Python's default import priority is such that
C extensions take precedence over same-named Python modules, so the
import wrappers are ignored unless the egg is a zipfile.
Installation and Path Management Issues
=======================================
Python's initial setup of ``sys.path`` is very dependent on the Python
version and installation platform, as well as how Python was started
(i.e., script vs. ``-c`` vs. ``-m`` vs. interactive interpreter).
In fact, Python also provides only two relatively robust ways to affect
``sys.path`` outside of direct manipulation in code: the ``PYTHONPATH``
environment variable, and ``.pth`` files.
However, with no cross-platform way to safely and persistently change
environment variables, this leaves ``.pth`` files as EasyInstall's only
real option for persistent configuration of ``sys.path``.
But ``.pth`` files are rather strictly limited in what they are allowed
to do normally. They add directories only to the *end* of ``sys.path``,
after any locally-installed ``site-packages`` directory, and they are
only processed *in* the ``site-packages`` directory to start with.
This is a double whammy for users who lack write access to that
directory, because they can't create a ``.pth`` file that Python will
read, and even if a sympathetic system administrator adds one for them
that calls ``site.addsitedir()`` to allow some other directory to
contain ``.pth`` files, they won't be able to install newer versions of
anything that's installed in the systemwide ``site-packages``, because
their paths will still be added *after* ``site-packages``.
So EasyInstall applies two workarounds to solve these problems.
The first is that EasyInstall leverages ``.pth`` files' "import" feature
to manipulate ``sys.path`` and ensure that anything EasyInstall adds
to a ``.pth`` file will always appear before both the standard library
and the local ``site-packages`` directories. Thus, it is always
possible for a user who can write a Python-read ``.pth`` file to ensure
that their packages come first in their own environment.
Second, when installing to a ``PYTHONPATH`` directory (as opposed to
a "site" directory like ``site-packages``) EasyInstall will also install
a special version of the ``site`` module. Because it's in a
``PYTHONPATH`` directory, this module will get control before the
standard library version of ``site`` does. It will record the state of
``sys.path`` before invoking the "real" ``site`` module, and then
afterwards it processes any ``.pth`` files found in ``PYTHONPATH``
directories, including all the fixups needed to ensure that eggs always
appear before the standard library in sys.path, but are in a relative
order to one another that is defined by their ``PYTHONPATH`` and
``.pth``-prescribed sequence.
The net result of these changes is that ``sys.path`` order will be
as follows at runtime:
1. The ``sys.argv[0]`` directory, or an empty string if no script
is being executed.
2. All eggs installed by EasyInstall in any ``.pth`` file in each
``PYTHONPATH`` directory, in order first by ``PYTHONPATH`` order,
then normal ``.pth`` processing order (which is to say alphabetical
by ``.pth`` filename, then by the order of listing within each
``.pth`` file).
3. All eggs installed by EasyInstall in any ``.pth`` file in each "site"
directory (such as ``site-packages``), following the same ordering
rules as for the ones on ``PYTHONPATH``.
4. The ``PYTHONPATH`` directories themselves, in their original order
5. Any paths from ``.pth`` files found on ``PYTHONPATH`` that were *not*
eggs installed by EasyInstall, again following the same relative
ordering rules.
6. The standard library and "site" directories, along with the contents
of any ``.pth`` files found in the "site" directories.
Notice that sections 1, 4, and 6 comprise the "normal" Python setup for
``sys.path``. Sections 2 and 3 are inserted to support eggs, and
section 5 emulates what the "normal" semantics of ``.pth`` files on
``PYTHONPATH`` would be if Python natively supported them.
For further discussion of the tradeoffs that went into this design, as
well as notes on the actual magic inserted into ``.pth`` files to make
them do these things, please see also the following messages to the
distutils-SIG mailing list:
* http://mail.python.org/pipermail/distutils-sig/2006-February/006026.html
* http://mail.python.org/pipermail/distutils-sig/2006-March/006123.html
Script Wrappers
---------------
EasyInstall never directly installs a project's original scripts to
a script installation directory. Instead, it writes short wrapper
scripts that first ensure that the project's dependencies are active
on sys.path, before invoking the original script. These wrappers
have a #! line that points to the version of Python that was used to
install them, and their second line is always a comment that indicates
the type of script wrapper, the project version required for the script
to run, and information identifying the script to be invoked.
The format of this marker line is::
"# EASY-INSTALL-" script_type ": " tuple_of_strings "\n"
The ``script_type`` is one of ``SCRIPT``, ``DEV-SCRIPT``, or
``ENTRY-SCRIPT``. The ``tuple_of_strings`` is a comma-separated
sequence of Python string constants. For ``SCRIPT`` and ``DEV-SCRIPT``
wrappers, there are two strings: the project version requirement, and
the script name (as a filename within the ``scripts`` metadata
directory). For ``ENTRY-SCRIPT`` wrappers, there are three:
the project version requirement, the entry point group name, and the
entry point name. (See the "Automatic Script Creation" section in the
setuptools manual for more information about entry point scripts.)
In each case, the project version requirement string will be a string
parseable with the ``pkg_resources`` modules' ``Requirement.parse()``
classmethod. The only difference between a ``SCRIPT`` wrapper and a
``DEV-SCRIPT`` is that a ``DEV-SCRIPT`` actually executes the original
source script in the project's source tree, and is created when the
"setup.py develop" command is run. A ``SCRIPT`` wrapper, on the other
hand, uses the "installed" script written to the ``EGG-INFO/scripts``
subdirectory of the corresponding ``.egg`` zipfile or directory.
(``.egg-info`` eggs do not have script wrappers associated with them,
except in the "setup.py develop" case.)
The purpose of including the marker line in generated script wrappers is
to facilitate introspection of installed scripts, and their relationship
to installed eggs. For example, an uninstallation tool could use this
data to identify what scripts can safely be removed, and/or identify
what scripts would stop working if a particular egg is uninstalled.
doc/alt-python27-setuptools/releases.txt 0000644 00000004102 15173017730 0014345 0 ustar 00 ===============
Release Process
===============
In order to allow for rapid, predictable releases, Setuptools uses a
mechanical technique for releases, enacted by Travis following a
successful build of a tagged release per
`PyPI deployment <https://docs.travis-ci.com/user/deployment/pypi>`_.
Prior to cutting a release, please check that the CHANGES.rst reflects
the summary of changes since the last release.
Ideally, these changelog entries would have been added
along with the changes, but it's always good to check.
Think about it from the
perspective of a user not involved with the development--what would
that person want to know about what has changed--or from the
perspective of your future self wanting to know when a particular
change landed.
To cut a release, install and run ``bump2version {part}`` where ``part``
is major, minor, or patch based on the scope of the changes in the
release. Then, push the commits to the master branch. If tests pass,
the release will be uploaded to PyPI (from the Python 3.6 tests).
Release Frequency
-----------------
Some have asked why Setuptools is released so frequently. Because Setuptools
uses a mechanical release process, it's very easy to make releases whenever the
code is stable (tests are passing). As a result, the philosophy is to release
early and often.
While some find the frequent releases somewhat surprising, they only empower
the user. Although releases are made frequently, users can choose the frequency
at which they use those releases. If instead Setuptools contributions were only
released in batches, the user would be constrained to only use Setuptools when
those official releases were made. With frequent releases, the user can govern
exactly how often he wishes to update.
Frequent releases also then obviate the need for dev or beta releases in most
cases. Because releases are made early and often, bugs are discovered and
corrected quickly, in many cases before other users have yet to encounter them.
Release Managers
----------------
Additionally, anyone with push access to the master branch has access to cut
releases.
doc/alt-python27-setuptools/development.txt 0000644 00000002702 15173017730 0015070 0 ustar 00 -------------------------
Development on Setuptools
-------------------------
Setuptools is maintained by the Python community under the Python Packaging
Authority (PyPA) and led by Jason R. Coombs.
This document describes the process by which Setuptools is developed.
This document assumes the reader has some passing familiarity with
*using* setuptools, the ``pkg_resources`` module, and EasyInstall. It
does not attempt to explain basic concepts like inter-project
dependencies, nor does it contain detailed lexical syntax for most
file formats. Neither does it explain concepts like "namespace
packages" or "resources" in any detail, as all of these subjects are
covered at length in the setuptools developer's guide and the
``pkg_resources`` reference manual.
Instead, this is **internal** documentation for how those concepts and
features are *implemented* in concrete terms. It is intended for people
who are working on the setuptools code base, who want to be able to
troubleshoot setuptools problems, want to write code that reads the file
formats involved, or want to otherwise tinker with setuptools-generated
files and directories.
Note, however, that these are all internal implementation details and
are therefore subject to change; stick to the published API if you don't
want to be responsible for keeping your code from breaking when
setuptools changes. You have been warned.
.. toctree::
:maxdepth: 1
developer-guide
formats
releases
doc/alt-python27-setuptools/index.txt 0000644 00000001031 15173017731 0013650 0 ustar 00 Welcome to Setuptools' documentation!
=====================================
Setuptools is a fully-featured, actively-maintained, and stable library
designed to facilitate packaging Python projects, where packaging includes:
- Python package and module definitions
- Distribution package metadata
- Test hooks
- Project installation
- Platform-specific details
- Python 3 support
Documentation content:
.. toctree::
:maxdepth: 2
setuptools
easy_install
pkg_resources
python3
development
roadmap
history
doc/alt-python27-setuptools/history.txt 0000644 00000003537 15173017732 0014260 0 ustar 00 :tocdepth: 2
.. _changes:
History
*******
.. include:: ../CHANGES (links).rst
Credits
*******
* The original design for the ``.egg`` format and the ``pkg_resources`` API was
co-created by Phillip Eby and Bob Ippolito. Bob also implemented the first
version of ``pkg_resources``, and supplied the OS X operating system version
compatibility algorithm.
* Ian Bicking implemented many early "creature comfort" features of
easy_install, including support for downloading via Sourceforge and
Subversion repositories. Ian's comments on the Web-SIG about WSGI
application deployment also inspired the concept of "entry points" in eggs,
and he has given talks at PyCon and elsewhere to inform and educate the
community about eggs and setuptools.
* Jim Fulton contributed time and effort to build automated tests of various
aspects of ``easy_install``, and supplied the doctests for the command-line
``.exe`` wrappers on Windows.
* Phillip J. Eby is the seminal author of setuptools, and
first proposed the idea of an importable binary distribution format for
Python application plug-ins.
* Significant parts of the implementation of setuptools were funded by the Open
Source Applications Foundation, to provide a plug-in infrastructure for the
Chandler PIM application. In addition, many OSAF staffers (such as Mike
"Code Bear" Taylor) contributed their time and stress as guinea pigs for the
use of eggs and setuptools, even before eggs were "cool". (Thanks, guys!)
* Tarek Ziadé is the principal author of the Distribute fork, which
re-invigorated the community on the project, encouraged renewed innovation,
and addressed many defects.
* Since the merge with Distribute, Jason R. Coombs is the
maintainer of setuptools. The project is maintained in coordination with
the Python Packaging Authority (PyPA) and the larger Python community.
doc/alt-python27-setuptools/python3.txt 0000644 00000007602 15173017733 0014161 0 ustar 00 =====================================================
Supporting both Python 2 and Python 3 with Setuptools
=====================================================
Starting with Distribute version 0.6.2 and Setuptools 0.7, the Setuptools
project supported Python 3. Installing and
using setuptools for Python 3 code works exactly the same as for Python 2
code.
Setuptools provides a facility to invoke 2to3 on the code as a part of the
build process, by setting the keyword parameter ``use_2to3`` to True, but
the Setuptools strongly recommends instead developing a unified codebase
using `six <https://pypi.python.org/pypi/six>`_,
`future <https://pypi.python.org/pypi/future>`_, or another compatibility
library.
Using 2to3
==========
Setuptools attempts to make the porting process easier by automatically
running
2to3 as a part of running tests. To do so, you need to configure the
setup.py so that you can run the unit tests with ``python setup.py test``.
See :ref:`test` for more information on this.
Once you have the tests running under Python 2, you can add the use_2to3
keyword parameters to setup(), and start running the tests under Python 3.
The test command will now first run the build command during which the code
will be converted with 2to3, and the tests will then be run from the build
directory, as opposed from the source directory as is normally done.
Setuptools will convert all Python files, and also all doctests in Python
files. However, if you have doctests located in separate text files, these
will not automatically be converted. By adding them to the
``convert_2to3_doctests`` keyword parameter Setuptools will convert them as
well.
By default, the conversion uses all fixers in the ``lib2to3.fixers`` package.
To use additional fixers, the parameter ``use_2to3_fixers`` can be set
to a list of names of packages containing fixers. To exclude fixers, the
parameter ``use_2to3_exclude_fixers`` can be set to fixer names to be
skipped.
An example setup.py might look something like this::
from setuptools import setup
setup(
name='your.module',
version='1.0',
description='This is your awesome module',
author='You',
author_email='your@email',
package_dir={'': 'src'},
packages=['your', 'you.module'],
test_suite='your.module.tests',
use_2to3=True,
convert_2to3_doctests=['src/your/module/README.txt'],
use_2to3_fixers=['your.fixers'],
use_2to3_exclude_fixers=['lib2to3.fixes.fix_import'],
)
Differential conversion
-----------------------
Note that a file will only be copied and converted during the build process
if the source file has been changed. If you add a file to the doctests
that should be converted, it will not be converted the next time you run
the tests, since it hasn't been modified. You need to remove it from the
build directory. Also if you run the build, install or test commands before
adding the use_2to3 parameter, you will have to remove the build directory
before you run the test command, as the files otherwise will seem updated,
and no conversion will happen.
In general, if code doesn't seem to be converted, deleting the build directory
and trying again is a good safeguard against the build directory getting
"out of sync" with the source directory.
Distributing Python 3 modules
=============================
You can distribute your modules with Python 3 support in different ways. A
normal source distribution will work, but can be slow in installing, as the
2to3 process will be run during the install. But you can also distribute
the module in binary format, such as a binary egg. That egg will contain the
already converted code, and hence no 2to3 conversion is needed during install.
Advanced features
=================
If you don't want to run the 2to3 conversion on the doctests in Python files,
you can turn that off by setting ``setuptools.use_2to3_on_doctests = False``.
doc/alt-python27-setuptools/roadmap.txt 0000644 00000000247 15173017733 0014176 0 ustar 00 =======
Roadmap
=======
Setuptools is primarily in maintenance mode. The project attempts to address
user issues, concerns, and feature requests in a timely fashion.
doc/alt-python27-devel/valgrind-python.supp 0000644 00000016441 15173017734 0014732 0 ustar 00 #
# This is a valgrind suppression file that should be used when using valgrind.
#
# Here's an example of running valgrind:
#
# cd python/dist/src
# valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \
# ./python -E -tt ./Lib/test/regrtest.py -u bsddb,network
#
# You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER
# to use the preferred suppressions with Py_ADDRESS_IN_RANGE.
#
# If you do not want to recompile Python, you can uncomment
# suppressions for PyObject_Free and PyObject_Realloc.
#
# See Misc/README.valgrind for more information.
# all tool names: Addrcheck,Memcheck,cachegrind,helgrind,massif
{
ADDRESS_IN_RANGE/Invalid read of size 4
Memcheck:Addr4
fun:Py_ADDRESS_IN_RANGE
}
{
ADDRESS_IN_RANGE/Invalid read of size 4
Memcheck:Value4
fun:Py_ADDRESS_IN_RANGE
}
{
ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64 aka amd64)
Memcheck:Value8
fun:Py_ADDRESS_IN_RANGE
}
{
ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
Memcheck:Cond
fun:Py_ADDRESS_IN_RANGE
}
#
# Leaks (including possible leaks)
# Hmmm, I wonder if this masks some real leaks. I think it does.
# Will need to fix that.
#
{
Suppress leaking the GIL. Happens once per process, see comment in ceval.c.
Memcheck:Leak
fun:malloc
fun:PyThread_allocate_lock
fun:PyEval_InitThreads
}
{
Suppress leaking the GIL after a fork.
Memcheck:Leak
fun:malloc
fun:PyThread_allocate_lock
fun:PyEval_ReInitThreads
}
{
Suppress leaking the autoTLSkey. This looks like it shouldn't leak though.
Memcheck:Leak
fun:malloc
fun:PyThread_create_key
fun:_PyGILState_Init
fun:Py_InitializeEx
fun:Py_Main
}
{
Hmmm, is this a real leak or like the GIL?
Memcheck:Leak
fun:malloc
fun:PyThread_ReInitTLS
}
{
Handle PyMalloc confusing valgrind (possibly leaked)
Memcheck:Leak
fun:realloc
fun:_PyObject_GC_Resize
fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
}
{
Handle PyMalloc confusing valgrind (possibly leaked)
Memcheck:Leak
fun:malloc
fun:_PyObject_GC_New
fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
}
{
Handle PyMalloc confusing valgrind (possibly leaked)
Memcheck:Leak
fun:malloc
fun:_PyObject_GC_NewVar
fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
}
{
bpo-37329: _PyWarnings_Init allocates memory at startup, but doesn't release it at exit
Memcheck:Leak
fun:malloc
...
fun:_PyWarnings_Init
}
#
# Non-python specific leaks
#
{
Handle pthread issue (possibly leaked)
Memcheck:Leak
fun:calloc
fun:allocate_dtv
fun:_dl_allocate_tls_storage
fun:_dl_allocate_tls
}
{
Handle pthread issue (possibly leaked)
Memcheck:Leak
fun:memalign
fun:_dl_allocate_tls_storage
fun:_dl_allocate_tls
}
###{
### ADDRESS_IN_RANGE/Invalid read of size 4
### Memcheck:Addr4
### fun:PyObject_Free
###}
###
###{
### ADDRESS_IN_RANGE/Invalid read of size 4
### Memcheck:Value4
### fun:PyObject_Free
###}
###
###{
### ADDRESS_IN_RANGE/Use of uninitialised value of size 8
### Memcheck:Addr8
### fun:PyObject_Free
###}
###
###{
### ADDRESS_IN_RANGE/Use of uninitialised value of size 8
### Memcheck:Value8
### fun:PyObject_Free
###}
###
###{
### ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
### Memcheck:Cond
### fun:PyObject_Free
###}
###{
### ADDRESS_IN_RANGE/Invalid read of size 4
### Memcheck:Addr4
### fun:PyObject_Realloc
###}
###
###{
### ADDRESS_IN_RANGE/Invalid read of size 4
### Memcheck:Value4
### fun:PyObject_Realloc
###}
###
###{
### ADDRESS_IN_RANGE/Use of uninitialised value of size 8
### Memcheck:Addr8
### fun:PyObject_Realloc
###}
###
###{
### ADDRESS_IN_RANGE/Use of uninitialised value of size 8
### Memcheck:Value8
### fun:PyObject_Realloc
###}
###
###{
### ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
### Memcheck:Cond
### fun:PyObject_Realloc
###}
###
### All the suppressions below are for errors that occur within libraries
### that Python uses. The problems to not appear to be related to Python's
### use of the libraries.
###
{
Generic ubuntu ld problems
Memcheck:Addr8
obj:/lib/ld-2.4.so
obj:/lib/ld-2.4.so
obj:/lib/ld-2.4.so
obj:/lib/ld-2.4.so
}
{
Generic gentoo ld problems
Memcheck:Cond
obj:/lib/ld-2.3.4.so
obj:/lib/ld-2.3.4.so
obj:/lib/ld-2.3.4.so
obj:/lib/ld-2.3.4.so
}
{
DBM problems, see test_dbm
Memcheck:Param
write(buf)
fun:write
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
fun:dbm_close
}
{
DBM problems, see test_dbm
Memcheck:Value8
fun:memmove
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
fun:dbm_store
fun:dbm_ass_sub
}
{
DBM problems, see test_dbm
Memcheck:Cond
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
fun:dbm_store
fun:dbm_ass_sub
}
{
DBM problems, see test_dbm
Memcheck:Cond
fun:memmove
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
fun:dbm_store
fun:dbm_ass_sub
}
{
GDBM problems, see test_gdbm
Memcheck:Param
write(buf)
fun:write
fun:gdbm_open
}
{
ZLIB problems, see test_gzip
Memcheck:Cond
obj:/lib/libz.so.1.2.3
obj:/lib/libz.so.1.2.3
fun:deflate
}
{
Avoid problems w/readline doing a putenv and leaking on exit
Memcheck:Leak
fun:malloc
fun:xmalloc
fun:sh_set_lines_and_columns
fun:_rl_get_screen_size
fun:_rl_init_terminal_io
obj:/lib/libreadline.so.4.3
fun:rl_initialize
}
###
### These occur from somewhere within the SSL, when running
### test_socket_sll. They are too general to leave on by default.
###
###{
### somewhere in SSL stuff
### Memcheck:Cond
### fun:memset
###}
###{
### somewhere in SSL stuff
### Memcheck:Value4
### fun:memset
###}
###
###{
### somewhere in SSL stuff
### Memcheck:Cond
### fun:MD5_Update
###}
###
###{
### somewhere in SSL stuff
### Memcheck:Value4
### fun:MD5_Update
###}
#
# All of these problems come from using test_socket_ssl
#
{
from test_socket_ssl
Memcheck:Cond
fun:BN_bin2bn
}
{
from test_socket_ssl
Memcheck:Cond
fun:BN_num_bits_word
}
{
from test_socket_ssl
Memcheck:Value4
fun:BN_num_bits_word
}
{
from test_socket_ssl
Memcheck:Cond
fun:BN_mod_exp_mont_word
}
{
from test_socket_ssl
Memcheck:Cond
fun:BN_mod_exp_mont
}
{
from test_socket_ssl
Memcheck:Param
write(buf)
fun:write
obj:/usr/lib/libcrypto.so.0.9.7
}
{
from test_socket_ssl
Memcheck:Cond
fun:RSA_verify
}
{
from test_socket_ssl
Memcheck:Value4
fun:RSA_verify
}
{
from test_socket_ssl
Memcheck:Value4
fun:DES_set_key_unchecked
}
{
from test_socket_ssl
Memcheck:Value4
fun:DES_encrypt2
}
{
from test_socket_ssl
Memcheck:Cond
obj:/usr/lib/libssl.so.0.9.7
}
{
from test_socket_ssl
Memcheck:Value4
obj:/usr/lib/libssl.so.0.9.7
}
{
from test_socket_ssl
Memcheck:Cond
fun:BUF_MEM_grow_clean
}
{
from test_socket_ssl
Memcheck:Cond
fun:memcpy
fun:ssl3_read_bytes
}
{
from test_socket_ssl
Memcheck:Cond
fun:SHA1_Update
}
{
from test_socket_ssl
Memcheck:Value4
fun:SHA1_Update
}
doc/alt-python27-devel/gdbinit 0000644 00000011325 15173017734 0012233 0 ustar 00 # If you use the GNU debugger gdb to debug the Python C runtime, you
# might find some of the following commands useful. Copy this to your
# ~/.gdbinit file and it'll get loaded into gdb automatically when you
# start it up. Then, at the gdb prompt you can do things like:
#
# (gdb) pyo apyobjectptr
# <module 'foobar' (built-in)>
# refcounts: 1
# address : 84a7a2c
# $1 = void
# (gdb)
#
# NOTE: If you have gdb 7 or later, it supports debugging of Python directly
# with embedded macros that you may find superior to what is in here.
# See Tools/gdb/libpython.py and http://bugs.python.org/issue8032.
# Prints a representation of the object to stderr, along with the
# number of reference counts it current has and the hex address the
# object is allocated at. The argument must be a PyObject*
define pyo
# side effect of calling _PyObject_Dump is to dump the object's
# info - assigning just prevents gdb from printing the
# NULL return value
set $_unused_void = _PyObject_Dump($arg0)
end
# Prints a representation of the object to stderr, along with the
# number of reference counts it current has and the hex address the
# object is allocated at. The argument must be a PyGC_Head*
define pyg
print _PyGC_Dump($arg0)
end
# print the local variables of the current frame
define pylocals
set $_i = 0
while $_i < f->f_code->co_nlocals
if f->f_localsplus + $_i != 0
set $_names = co->co_varnames
set $_name = PyString_AsString(PyTuple_GetItem($_names, $_i))
printf "%s:\n", $_name
pyo f->f_localsplus[$_i]
end
set $_i = $_i + 1
end
end
# A rewrite of the Python interpreter's line number calculator in GDB's
# command language
define lineno
set $__continue = 1
set $__co = f->f_code
set $__lasti = f->f_lasti
set $__sz = ((PyStringObject *)$__co->co_lnotab)->ob_size/2
set $__p = (unsigned char *)((PyStringObject *)$__co->co_lnotab)->ob_sval
set $__li = $__co->co_firstlineno
set $__ad = 0
while ($__sz-1 >= 0 && $__continue)
set $__sz = $__sz - 1
set $__ad = $__ad + *$__p
set $__p = $__p + 1
if ($__ad > $__lasti)
set $__continue = 0
else
set $__li = $__li + *$__p
set $__p = $__p + 1
end
end
printf "%d", $__li
end
# print the current frame - verbose
define pyframev
pyframe
pylocals
end
define pyframe
set $__fn = (char *)((PyStringObject *)co->co_filename)->ob_sval
set $__n = (char *)((PyStringObject *)co->co_name)->ob_sval
printf "%s (", $__fn
lineno
printf "): %s\n", $__n
### Uncomment these lines when using from within Emacs/XEmacs so it will
### automatically track/display the current Python source line
# printf "%c%c%s:", 032, 032, $__fn
# lineno
# printf ":1\n"
end
### Use these at your own risk. It appears that a bug in gdb causes it
### to crash in certain circumstances.
#define up
# up-silently 1
# printframe
#end
#define down
# down-silently 1
# printframe
#end
define printframe
if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx
pyframe
else
frame
end
end
# Here's a somewhat fragile way to print the entire Python stack from gdb.
# It's fragile because the tests for the value of $pc depend on the layout
# of specific functions in the C source code.
# Explanation of while and if tests: We want to pop up the stack until we
# land in Py_Main (this is probably an incorrect assumption in an embedded
# interpreter, but the test can be extended by an interested party). If
# Py_Main <= $pc <= Py_GetArgcArv is true, $pc is in Py_Main(), so the while
# tests succeeds as long as it's not true. In a similar fashion the if
# statement tests to see if we are in PyEval_EvalFrameEx().
# Note: The name of the main interpreter function and the function which
# follow it has changed over time. This version of pystack works with this
# version of Python. If you try using it with older or newer versions of
# the interpreter you may will have to change the functions you compare with
# $pc.
# print the entire Python call stack
define pystack
while $pc < Py_Main || $pc > Py_GetArgcArgv
if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx
pyframe
end
up-silently 1
end
select-frame 0
end
# print the entire Python call stack - verbose mode
define pystackv
while $pc < Py_Main || $pc > Py_GetArgcArgv
if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx
pyframev
end
up-silently 1
end
select-frame 0
end
# generally useful macro to print a Unicode string
def pu
set $uni = $arg0
set $i = 0
while (*$uni && $i++<100)
if (*$uni < 0x80)
print *(char*)$uni++
else
print /x *(short*)$uni++
end
end
end
doc/alt-python27-devel/README.valgrind 0000644 00000010462 15173017735 0013357 0 ustar 00 This document describes some caveats about the use of Valgrind with
Python. Valgrind is used periodically by Python developers to try
to ensure there are no memory leaks or invalid memory reads/writes.
If you don't want to read about the details of using Valgrind, there
are still two things you must do to suppress the warnings. First,
you must use a suppressions file. One is supplied in
Misc/valgrind-python.supp. Second, you must do one of the following:
* Uncomment Py_USING_MEMORY_DEBUGGER in Objects/obmalloc.c,
then rebuild Python
* Uncomment the lines in Misc/valgrind-python.supp that
suppress the warnings for PyObject_Free and PyObject_Realloc
If you want to use Valgrind more effectively and catch even more
memory leaks, you will need to configure python --without-pymalloc.
PyMalloc allocates a few blocks in big chunks and most object
allocations don't call malloc, they use chunks doled about by PyMalloc
from the big blocks. This means Valgrind can't detect
many allocations (and frees), except for those that are forwarded
to the system malloc. Note: configuring python --without-pymalloc
makes Python run much slower, especially when running under Valgrind.
You may need to run the tests in batches under Valgrind to keep
the memory usage down to allow the tests to complete. It seems to take
about 5 times longer to run --without-pymalloc.
Apr 15, 2006:
test_ctypes causes Valgrind 3.1.1 to fail (crash).
test_socket_ssl should be skipped when running valgrind.
The reason is that it purposely uses uninitialized memory.
This causes many spurious warnings, so it's easier to just skip it.
Details:
--------
Python uses its own small-object allocation scheme on top of malloc,
called PyMalloc.
Valgrind may show some unexpected results when PyMalloc is used.
Starting with Python 2.3, PyMalloc is used by default. You can disable
PyMalloc when configuring python by adding the --without-pymalloc option.
If you disable PyMalloc, most of the information in this document and
the supplied suppressions file will not be useful. As discussed above,
disabling PyMalloc can catch more problems.
If you use valgrind on a default build of Python, you will see
many errors like:
==6399== Use of uninitialised value of size 4
==6399== at 0x4A9BDE7E: PyObject_Free (obmalloc.c:711)
==6399== by 0x4A9B8198: dictresize (dictobject.c:477)
These are expected and not a problem. Tim Peters explains
the situation:
PyMalloc needs to know whether an arbitrary address is one
that's managed by it, or is managed by the system malloc.
The current scheme allows this to be determined in constant
time, regardless of how many memory areas are under pymalloc's
control.
The memory pymalloc manages itself is in one or more "arenas",
each a large contiguous memory area obtained from malloc.
The base address of each arena is saved by pymalloc
in a vector. Each arena is carved into "pools", and a field at
the start of each pool contains the index of that pool's arena's
base address in that vector.
Given an arbitrary address, pymalloc computes the pool base
address corresponding to it, then looks at "the index" stored
near there. If the index read up is out of bounds for the
vector of arena base addresses pymalloc maintains, then
pymalloc knows for certain that this address is not under
pymalloc's control. Otherwise the index is in bounds, and
pymalloc compares
the arena base address stored at that index in the vector
to
the arbitrary address pymalloc is investigating
pymalloc controls this arbitrary address if and only if it lies
in the arena the address's pool's index claims it lies in.
It doesn't matter whether the memory pymalloc reads up ("the
index") is initialized. If it's not initialized, then
whatever trash gets read up will lead pymalloc to conclude
(correctly) that the address isn't controlled by it, either
because the index is out of bounds, or the index is in bounds
but the arena it represents doesn't contain the address.
This determination has to be made on every call to one of
pymalloc's free/realloc entry points, so its speed is critical
(Python allocates and frees dynamic memory at a ferocious rate
-- everything in Python, from integers to "stack frames",
lives in the heap).
doc/alt-python27/README 0000644 00000154060 15173017736 0010461 0 ustar 00 This is Python version 2.7.18
=============================
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation. All
rights reserved.
Copyright (c) 2000 BeOpen.com.
All rights reserved.
Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All rights reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum.
All rights reserved.
License information
-------------------
See the file "LICENSE" for information on the history of this
software, terms & conditions for usage, and a DISCLAIMER OF ALL
WARRANTIES.
This Python distribution contains no GNU General Public Licensed
(GPLed) code so it may be used in proprietary projects just like prior
Python distributions. There are interfaces to some GNU code but these
are entirely optional.
All trademarks referenced herein are property of their respective
holders.
What's new in this release?
---------------------------
See the file "Misc/NEWS".
If you don't read instructions
------------------------------
Congratulations on getting this far. :-)
To start building right away (on UNIX): type "./configure" in the
current directory and when it finishes, type "make". This creates an
executable "./python"; to install in /usr/local, first do "su root"
and then "make install".
The section `Build instructions' below is still recommended reading.
What is Python anyway?
----------------------
Python is an interpreted, interactive object-oriented programming
language suitable (amongst other uses) for distributed application
development, scripting, numeric computing and system testing. Python
is often compared to Tcl, Perl, Java, JavaScript, Visual Basic or
Scheme. To find out more about what Python can do for you, point your
browser to http://www.python.org/.
How do I learn Python?
----------------------
The official tutorial is still a good place to start; see
http://docs.python.org/ for online and downloadable versions, as well
as a list of other introductions, and reference documentation.
There's a quickly growing set of books on Python. See
http://wiki.python.org/moin/PythonBooks for a list.
Documentation
-------------
All documentation is provided online in a variety of formats. In
order of importance for new users: Tutorial, Library Reference,
Language Reference, Extending & Embedding, and the Python/C API. The
Library Reference is especially of immense value since much of
Python's power is described there, including the built-in data types
and functions!
All documentation is also available online at the Python web site
(http://docs.python.org/, see below). It is available online for occasional
reference, or can be downloaded in many formats for faster access. The
documentation is downloadable in HTML, PostScript, PDF, LaTeX, and
reStructuredText (2.6+) formats; the LaTeX and reStructuredText versions are
primarily for documentation authors, translators, and people with special
formatting requirements.
If you would like to contribute to the development of Python, relevant
documentation is available at:
http://docs.python.org/devguide/
For information about building Python's documentation, refer to Doc/README.txt.
Web sites
---------
New Python releases and related technologies are published at
http://www.python.org/. Come visit us!
Newsgroups and Mailing Lists
----------------------------
Read comp.lang.python, a high-volume discussion newsgroup about
Python, or comp.lang.python.announce, a low-volume moderated newsgroup
for Python-related announcements. These are also accessible as
mailing lists: see http://www.python.org/community/lists/ for an
overview of these and many other Python-related mailing lists.
Archives are accessible via the Google Groups Usenet archive; see
http://groups.google.com/. The mailing lists are also archived, see
http://www.python.org/community/lists/ for details.
Bug reports
-----------
To report or search for bugs, please use the Python Bug
Tracker at http://bugs.python.org/.
Patches and contributions
-------------------------
To submit a patch or other contribution, please use the Python Patch
Manager at http://bugs.python.org/. Guidelines
for patch submission may be found at http://www.python.org/dev/patches/.
If you have a proposal to change Python, you may want to send an email to the
comp.lang.python or python-ideas mailing lists for inital feedback. A Python
Enhancement Proposal (PEP) may be submitted if your idea gains ground. All
current PEPs, as well as guidelines for submitting a new PEP, are listed at
http://www.python.org/dev/peps/.
Questions
---------
For help, if you can't find it in the manuals or on the web site, it's
best to post to the comp.lang.python or the Python mailing list (see
above). If you specifically don't want to involve the newsgroup or
mailing list, send questions to help@python.org (a group of volunteers
who answer questions as they can). The newsgroup is the most
efficient way to ask public questions.
Build instructions
==================
Before you can build Python, you must first configure it.
Fortunately, the configuration and build process has been automated
for Unix and Linux installations, so all you usually have to do is
type a few commands and sit back. There are some platforms where
things are not quite as smooth; see the platform specific notes below.
If you want to build for multiple platforms sharing the same source
tree, see the section on VPATH below.
Start by running the script "./configure", which determines your
system configuration and creates the Makefile. (It takes a minute or
two -- please be patient!) You may want to pass options to the
configure script -- see the section below on configuration options and
variables. When it's done, you are ready to run make.
To build Python, you normally type "make" in the toplevel directory.
If you have changed the configuration, the Makefile may have to be
rebuilt. In this case, you may have to run make again to correctly
build your desired target. The interpreter executable is built in the
top level directory.
To get an optimized build of Python, "configure --enable-optimizations" before
you run make. This sets the default make targets up to enable Profile Guided
Optimization (PGO) and may be used to auto-enable Link Time Optimization (LTO)
on some platforms. For more details, see the sections bellow.
Once you have built a Python interpreter, see the subsections below on
testing and installation. If you run into trouble, see the next
section.
Previous versions of Python used a manual configuration process that
involved editing the file Modules/Setup. While this file still exists
and manual configuration is still supported, it is rarely needed any
more: almost all modules are automatically built as appropriate under
guidance of the setup.py script, which is run by Make after the
interpreter has been built.
Profile Guided Optimization
---------------------------
PGO takes advantage of recent versions of the GCC or Clang compilers.
If ran, "make profile-opt" will do several steps.
First, the entire Python directory is cleaned of temporary files that
may have resulted in a previous compilation.
Then, an instrumented version of the interpreter is built, using suitable
compiler flags for each flavour. Note that this is just an intermediary
step and the binary resulted after this step is not good for real life
workloads, as it has profiling instructions embedded inside.
After this instrumented version of the interpreter is built, the Makefile
will automatically run a training workload. This is necessary in order to
profile the interpreter execution. Note also that any output, both stdout
and stderr, that may appear at this step is suppressed.
Finally, the last step is to rebuild the interpreter, using the information
collected in the previous one. The end result will be a Python binary
that is optimized and suitable for distribution or production installation.
Link Time Optimization
----------------------
Enabled via configure's --with-lto flag. LTO takes advantages of recent
compiler toolchains ability to optimize across the otherwise arbitrary .o file
boundary when building final executables or shared libraries for additional
performance gains.
Troubleshooting
---------------
See also the platform specific notes in the next section.
If you run into other trouble, see the FAQ
(http://www.python.org/doc/faq/) for hints on what can go wrong, and
how to fix it.
If you rerun the configure script with different options, remove all
object files by running "make clean" before rebuilding. Believe it or
not, "make clean" sometimes helps to clean up other inexplicable
problems as well. Try it before sending in a bug report!
If the configure script fails or doesn't seem to find things that
should be there, inspect the config.log file.
If you get a warning for every file about the -Olimit option being no
longer supported, you can ignore it. There's no foolproof way to know
whether this option is needed; all we can do is test whether it is
accepted without error. On some systems, e.g. older SGI compilers, it
is essential for performance (specifically when compiling ceval.c,
which has more basic blocks than the default limit of 1000). If the
warning bothers you, edit the Makefile to remove "-Olimit 1500" from
the OPT variable.
If you get failures in test_long, or sys.maxint gets set to -1, you
are probably experiencing compiler bugs, usually related to
optimization. This is a common problem with some versions of gcc, and
some vendor-supplied compilers, which can sometimes be worked around
by turning off optimization. Consider switching to stable versions
(gcc 2.95.2, gcc 3.x, or contact your vendor.)
From Python 2.0 onward, all Python C code is ANSI C. Compiling using
old K&R-C-only compilers is no longer possible. ANSI C compilers are
available for all modern systems, either in the form of updated
compilers from the vendor, or one of the free compilers (gcc).
If "make install" fails mysteriously during the "compiling the library"
step, make sure that you don't have any of the PYTHONPATH or PYTHONHOME
environment variables set, as they may interfere with the newly built
executable which is compiling the library.
Unsupported systems
-------------------
A number of systems are not supported in Python 2.7 anymore. Some
support code is still present, but will be removed in later versions.
If you still need to use current Python versions on these systems,
please send a message to python-dev@python.org indicating that you
volunteer to support this system. For a more detailed discussion
regarding no-longer-supported and resupporting platforms, as well
as a list of platforms that became or will be unsupported, see PEP 11.
More specifically, the following systems are not supported any
longer:
- SunOS 4
- DYNIX
- dgux
- Minix
- NeXT
- Irix 4 and --with-sgi-dl
- Linux 1
- Systems defining __d6_pthread_create (configure.ac)
- Systems defining PY_PTHREAD_D4, PY_PTHREAD_D6,
or PY_PTHREAD_D7 in thread_pthread.h
- Systems using --with-dl-dld
- Systems using --without-universal-newlines
- MacOS 9
- Systems using --with-wctype-functions
- Win9x, WinME
Platform specific notes
-----------------------
(Some of these may no longer apply. If you find you can build Python
on these platforms without the special directions mentioned here,
submit a documentation bug report to SourceForge (see Bug Reports
above) so we can remove them!)
Unix platforms: If your vendor still ships (and you still use) Berkeley DB
1.85 you will need to edit Modules/Setup to build the bsddb185
module and add a line to sitecustomize.py which makes it the
default. In Modules/Setup a line like
bsddb185 bsddbmodule.c
should work. (You may need to add -I, -L or -l flags to direct the
compiler and linker to your include files and libraries.)
XXX I think this next bit is out of date:
64-bit platforms: The modules audioop, and imageop don't work.
The setup.py script disables them on 64-bit installations.
Don't try to enable them in the Modules/Setup file. They
contain code that is quite wordsize sensitive. (If you have a
fix, let us know!)
Solaris: When using Sun's C compiler with threads, at least on Solaris
2.5.1, you need to add the "-mt" compiler option (the simplest
way is probably to specify the compiler with this option as
the "CC" environment variable when running the configure
script).
When using GCC on Solaris, beware of binutils 2.13 or GCC
versions built using it. This mistakenly enables the
-zcombreloc option which creates broken shared libraries on
Solaris. binutils 2.12 works, and the binutils maintainers
are aware of the problem. Binutils 2.13.1 only partially
fixed things. It appears that 2.13.2 solves the problem
completely. This problem is known to occur with Solaris 2.7
and 2.8, but may also affect earlier and later versions of the
OS.
When the dynamic loader complains about errors finding shared
libraries, such as
ld.so.1: ./python: fatal: libstdc++.so.5: open failed:
No such file or directory
you need to first make sure that the library is available on
your system. Then, you need to instruct the dynamic loader how
to find it. You can choose any of the following strategies:
1. When compiling Python, set LD_RUN_PATH to the directories
containing missing libraries.
2. When running Python, set LD_LIBRARY_PATH to these directories.
3. Use crle(8) to extend the search path of the loader.
4. Modify the installed GCC specs file, adding -R options into the
*link: section.
The complex object fails to compile on Solaris 10 with gcc 3.4 (at
least up to 3.4.3). To work around it, define Py_HUGE_VAL as
HUGE_VAL(), e.g.:
make CPPFLAGS='-D"Py_HUGE_VAL=HUGE_VAL()" -I. -I$(srcdir)/Include'
./python setup.py CPPFLAGS='-D"Py_HUGE_VAL=HUGE_VAL()"'
Linux: A problem with threads and fork() was tracked down to a bug in
the pthreads code in glibc version 2.0.5; glibc version 2.0.7
solves the problem. This causes the popen2 test to fail;
problem and solution reported by Pablo Bleyer.
Red Hat Linux: Red Hat 9 built Python2.2 in UCS-4 mode and hacked
Tcl to support it. To compile Python2.3 with Tkinter, you will
need to pass --enable-unicode=ucs4 flag to ./configure.
There's an executable /usr/bin/python which is Python
1.5.2 on most older Red Hat installations; several key Red Hat tools
require this version. Python 2.1.x may be installed as
/usr/bin/python2. The Makefile installs Python as
/usr/local/bin/python, which may or may not take precedence
over /usr/bin/python, depending on how you have set up $PATH.
FreeBSD 3.x and probably platforms with NCurses that use libmytinfo or
similar: When using cursesmodule, the linking is not done in
the correct order with the defaults. Remove "-ltermcap" from
the readline entry in Setup, and use as curses entry: "curses
cursesmodule.c -lmytinfo -lncurses -ltermcap" - "mytinfo" (so
called on FreeBSD) should be the name of the auxiliary library
required on your platform. Normally, it would be linked
automatically, but not necessarily in the correct order.
BSDI: BSDI versions before 4.1 have known problems with threads,
which can cause strange errors in a number of modules (for
instance, the 'test_signal' test script will hang forever.)
Turning off threads (with --with-threads=no) or upgrading to
BSDI 4.1 solves this problem.
DEC Unix: Run configure with --with-dec-threads, or with
--with-threads=no if no threads are desired (threads are on by
default). When using GCC, it is possible to get an internal
compiler error if optimization is used. This was reported for
GCC 2.7.2.3 on selectmodule.c. Manually compile the affected
file without optimization to solve the problem.
DEC Ultrix: compile with GCC to avoid bugs in the native compiler,
and pass SHELL=/bin/sh5 to Make when installing.
AIX: A complete overhaul of the shared library support is now in
place. See Misc/AIX-NOTES for some notes on how it's done.
(The optimizer bug reported at this place in previous releases
has been worked around by a minimal code change.) If you get
errors about pthread_* functions, during compile or during
testing, try setting CC to a thread-safe (reentrant) compiler,
like "cc_r". For full C++ module support, set CC="xlC_r" (or
CC="xlC" without thread support).
AIX 5.3: To build a 64-bit version with IBM's compiler, I used the
following:
export PATH=/usr/bin:/usr/vacpp/bin
./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64" \
--disable-ipv6 AR="ar -X64"
make
HP-UX: When using threading, you may have to add -D_REENTRANT to the
OPT variable in the top-level Makefile; reported by Pat Knight,
this seems to make a difference (at least for HP-UX 10.20)
even though pyconfig.h defines it. This seems unnecessary when
using HP/UX 11 and later - threading seems to work "out of the
box".
HP-UX ia64: When building on the ia64 (Itanium) platform using HP's
compiler, some experience has shown that the compiler's
optimiser produces a completely broken version of python
(see http://bugs.python.org/814976). To work around this,
edit the Makefile and remove -O from the OPT line.
To build a 64-bit executable on an Itanium 2 system using HP's
compiler, use these environment variables:
CC=cc
CXX=aCC
BASECFLAGS="+DD64"
LDFLAGS="+DD64 -lxnet"
and call configure as:
./configure --without-gcc
then *unset* the environment variables again before running
make. (At least one of these flags causes the build to fail
if it remains set.) You still have to edit the Makefile and
remove -O from the OPT line.
HP PA-RISC 2.0: A recent bug report (http://bugs.python.org/546117)
suggests that the C compiler in this 64-bit system has bugs
in the optimizer that break Python. Compiling without
optimization solves the problems.
SCO: The following apply to SCO 3 only; Python builds out of the box
on SCO 5 (or so we've heard).
1) Everything works much better if you add -U__STDC__ to the
defs. This is because all the SCO header files are broken.
Anything that isn't mentioned in the C standard is
conditionally excluded when __STDC__ is defined.
2) Due to the U.S. export restrictions, SCO broke the crypt
stuff out into a separate library, libcrypt_i.a so the LIBS
needed be set to:
LIBS=' -lsocket -lcrypt_i'
UnixWare: There are known bugs in the math library of the system, as well as
problems in the handling of threads (calling fork in one
thread may interrupt system calls in others). Therefore, test_math and
tests involving threads will fail until those problems are fixed.
QNX: Chris Herborth (chrish@qnx.com) writes:
configure works best if you use GNU bash; a port is available on
ftp.qnx.com in /usr/free. I used the following process to build,
test and install Python 1.5.x under QNX:
1) CONFIG_SHELL=/usr/local/bin/bash CC=cc RANLIB=: \
./configure --verbose --without-gcc --with-libm=""
2) edit Modules/Setup to activate everything that makes sense for
your system... tested here at QNX with the following modules:
array, audioop, binascii, cPickle, cStringIO, cmath,
crypt, curses, errno, fcntl, gdbm, grp, imageop,
_locale, math, md5, new, operator, parser, pcre,
posix, pwd, readline, regex, reop,
select, signal, socket, soundex, strop, struct,
syslog, termios, time, timing, zlib, audioop, imageop
3) make SHELL=/usr/local/bin/bash
or, if you feel the need for speed:
make SHELL=/usr/local/bin/bash OPT="-5 -Oil+nrt"
4) make SHELL=/usr/local/bin/bash test
Using GNU readline 2.2 seems to behave strangely, but I
think that's a problem with my readline 2.2 port. :-\
5) make SHELL=/usr/local/bin/bash install
If you get SIGSEGVs while running Python (I haven't yet, but
I've only run small programs and the test cases), you're
probably running out of stack; the default 32k could be a
little tight. To increase the stack size, edit the Makefile
to read: LDFLAGS = -N 48k
BeOS: See Misc/BeOS-NOTES for notes about compiling/installing
Python on BeOS R3 or later. Note that only the PowerPC
platform is supported for R3; both PowerPC and x86 are
supported for R4.
Cray T3E: Mark Hadfield (m.hadfield@niwa.co.nz) writes:
Python can be built satisfactorily on a Cray T3E but based on
my experience with the NIWA T3E (2002-05-22, version 2.2.1)
there are a few bugs and gotchas. For more information see a
thread on comp.lang.python in May 2002 entitled "Building
Python on Cray T3E".
1) Use Cray's cc and not gcc. The latter was reported not to
work by Konrad Hinsen. It may work now, but it may not.
2) To set sys.platform to something sensible, pass the
following environment variable to the configure script:
MACHDEP=unicosmk
2) Run configure with option "--enable-unicode=ucs4".
3) The Cray T3E does not support dynamic linking, so extension
modules have to be built by adding (or uncommenting) lines
in Modules/Setup. The minimum set of modules is
posix, new, _sre, unicodedata
On NIWA's vanilla T3E system the following have also been
included successfully:
_codecs, _locale, _socket, _symtable, _testcapi, _weakref
array, binascii, cmath, cPickle, crypt, cStringIO, dbm
errno, fcntl, grp, math, md5, operator, parser, pcre, pwd
regex, rotor, select, struct, strop, syslog, termios
time, timing, xreadlines
4) Once the python executable and library have been built, make
will execute setup.py, which will attempt to build remaining
extensions and link them dynamically. Each of these attempts
will fail but should not halt the make process. This is
normal.
5) Running "make test" uses a lot of resources and causes
problems on our system. You might want to try running tests
singly or in small groups.
SGI: SGI's standard "make" utility (/bin/make or /usr/bin/make)
does not check whether a command actually changed the file it
is supposed to build. This means that whenever you say "make"
it will redo the link step. The remedy is to use SGI's much
smarter "smake" utility (/usr/sbin/smake), or GNU make. If
you set the first line of the Makefile to #!/usr/sbin/smake
smake will be invoked by make (likewise for GNU make).
WARNING: There are bugs in the optimizer of some versions of
SGI's compilers that can cause bus errors or other strange
behavior, especially on numerical operations. To avoid this,
try building with "make OPT=".
OS/2: If you are running Warp3 or Warp4 and have IBM's VisualAge C/C++
compiler installed, just change into the pc\os2vacpp directory
and type NMAKE. Threading and sockets are supported by default
in the resulting binaries of PYTHON15.DLL and PYTHON.EXE.
Reliant UNIX: The thread support does not compile on Reliant UNIX, and
there is a (minor) problem in the configure script for that
platform as well. This should be resolved in time for a
future release.
macOS: Building a complete Python installation requires the use of various
additional third-party libraries, depending on your build platform and
configure options. Not all standard library modules are buildable or
useable on all platforms. Refer to the "Install Dependencies" section
section of the "Developer Guide" for current detailed information on
dependencies for macOS:
https://devguide.python.org/setup/#install-dependencies
On macOS, there are additional configure and build options related
to macOS framework and universal builds. Refer to Mac/README.rst.
The tests will crash on both 10.1 and 10.2 with SEGV in
test_re and test_sre due to the small default stack size. If
you set the stack size to 2048 before doing a "make test" the
failure can be avoided. If you're using the tcsh or csh shells,
use "limit stacksize 2048" and for the bash shell (the default
as of macOS 10.3), use "ulimit -s 2048".
On naked Darwin you may want to add the configure option
"--disable-toolbox-glue" to disable the glue code for the Carbon
interface modules. The modules themselves are currently only built
if you add the --enable-framework option, see below.
On a clean macOS /usr/local does not exist. Do a
"sudo mkdir -m 775 /usr/local"
before you do a make install. It is probably not a good idea to
do "sudo make install" which installs everything as superuser,
as this may later cause problems when installing distutils-based
additions.
Some people have reported problems building Python after using "fink"
to install additional unix software. Disabling fink (remove all
references to /sw from your .profile or .login) should solve this.
Cygwin: With recent (relative to the time of writing, 2001-12-19)
Cygwin installations, there are problems with the interaction
of dynamic linking and fork(). This manifests itself in build
failures during the execution of setup.py.
There are two workarounds that both enable Python (albeit
without threading support) to build and pass all tests on
NT/2000 (and most likely XP as well, though reports of testing
on XP would be appreciated).
The workarounds:
(a) the band-aid fix is to link the _socket module statically
rather than dynamically (which is the default).
To do this, run "./configure --with-threads=no" including any
other options you need (--prefix, etc.). Then in Modules/Setup
uncomment the lines:
#SSL=/usr/local/ssl
#_socket socketmodule.c \
# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
# -L$(SSL)/lib -lssl -lcrypto
and remove "local/" from the SSL variable. Finally, just run
"make"!
(b) The "proper" fix is to rebase the Cygwin DLLs to prevent
base address conflicts. Details on how to do this can be
found in the following mail:
http://sources.redhat.com/ml/cygwin/2001-12/msg00894.html
It is hoped that a version of this solution will be
incorporated into the Cygwin distribution fairly soon.
Two additional problems:
(1) Threading support should still be disabled due to a known
bug in Cygwin pthreads that causes test_threadedtempfile to
hang.
(2) The _curses module does not build. This is a known
Cygwin ncurses problem that should be resolved the next time
that this package is released.
On older versions of Cygwin, test_poll may hang and test_strftime
may fail.
The situation on 9X/Me is not accurately known at present.
Some time ago, there were reports that the following
regression tests failed:
test_pwd
test_select (hang)
test_socket
Due to the test_select hang on 9X/Me, one should run the
regression test using the following:
make TESTOPTS='-l -x test_select' test
News regarding these platforms with more recent Cygwin
versions would be appreciated!
Windows: When executing Python scripts on the command line using file type
associations (i.e. starting "script.py" instead of "python script.py"),
redirects may not work unless you set a specific registry key. See
the Knowledge Base article <http://support.microsoft.com/kb/321788>.
Configuring the bsddb and dbm modules
-------------------------------------
Beginning with Python version 2.3, the PyBsddb package
<http://pybsddb.sf.net/> was adopted into Python as the bsddb package,
exposing a set of package-level functions which provide
backwards-compatible behavior. Only versions 3.3 through 4.4 of
Sleepycat's libraries provide the necessary API, so older versions
aren't supported through this interface. The old bsddb module has
been retained as bsddb185, though it is not built by default. Users
wishing to use it will have to tweak Modules/Setup to build it. The
dbm module will still be built against the Sleepycat libraries if
other preferred alternatives (ndbm, gdbm) are not found.
Building the sqlite3 module
---------------------------
To build the sqlite3 module, you'll need the sqlite3 or libsqlite3
packages installed, including the header files. Many modern operating
systems distribute the headers in a separate package to the library -
often it will be the same name as the main package, but with a -dev or
-devel suffix.
The version of pysqlite2 that's including in Python needs sqlite3 3.0.8
or later. setup.py attempts to check that it can find a correct version.
Configuring threads
-------------------
As of Python 2.0, threads are enabled by default. If you wish to
compile without threads, or if your thread support is broken, pass the
--with-threads=no switch to configure. Unfortunately, on some
platforms, additional compiler and/or linker options are required for
threads to work properly. Below is a table of those options,
collected by Bill Janssen. We would love to automate this process
more, but the information below is not enough to write a patch for the
configure.ac file, so manual intervention is required. If you patch
the configure.ac file and are confident that the patch works, please
send in the patch. (Don't bother patching the configure script itself
-- it is regenerated each time the configure.ac file changes.)
Compiler switches for threads
.............................
The definition of _REENTRANT should be configured automatically, if
that does not work on your system, or if _REENTRANT is defined
incorrectly, please report that as a bug.
OS/Compiler/threads Switches for use with threads
(POSIX is draft 10, DCE is draft 4) compile & link
SunOS 5.{1-5}/{gcc,SunPro cc}/solaris -mt
SunOS 5.5/{gcc,SunPro cc}/POSIX (nothing)
DEC OSF/1 3.x/cc/DCE -threads
(butenhof@zko.dec.com)
Digital UNIX 4.x/cc/DCE -threads
(butenhof@zko.dec.com)
Digital UNIX 4.x/cc/POSIX -pthread
(butenhof@zko.dec.com)
AIX 4.1.4/cc_r/d7 (nothing)
(buhrt@iquest.net)
AIX 4.1.4/cc_r4/DCE (nothing)
(buhrt@iquest.net)
IRIX 6.2/cc/POSIX (nothing)
(robertl@cwi.nl)
Linker (ld) libraries and flags for threads
...........................................
OS/threads Libraries/switches for use with threads
SunOS 5.{1-5}/solaris -lthread
SunOS 5.5/POSIX -lpthread
DEC OSF/1 3.x/DCE -lpthreads -lmach -lc_r -lc
(butenhof@zko.dec.com)
Digital UNIX 4.x/DCE -lpthreads -lpthread -lmach -lexc -lc
(butenhof@zko.dec.com)
Digital UNIX 4.x/POSIX -lpthread -lmach -lexc -lc
(butenhof@zko.dec.com)
AIX 4.1.4/{draft7,DCE} (nothing)
(buhrt@iquest.net)
IRIX 6.2/POSIX -lpthread
(jph@emilia.engr.sgi.com)
Building a shared libpython
---------------------------
Starting with Python 2.3, the majority of the interpreter can be built
into a shared library, which can then be used by the interpreter
executable, and by applications embedding Python. To enable this feature,
configure with --enable-shared.
If you enable this feature, the same object files will be used to create
a static library. In particular, the static library will contain object
files using position-independent code (PIC) on platforms where PIC flags
are needed for the shared library.
Configuring additional built-in modules
---------------------------------------
Starting with Python 2.1, the setup.py script at the top of the source
distribution attempts to detect which modules can be built and
automatically compiles them. Autodetection doesn't always work, so
you can still customize the configuration by editing the Modules/Setup
file; but this should be considered a last resort. The rest of this
section only applies if you decide to edit the Modules/Setup file.
You also need this to enable static linking of certain modules (which
is needed to enable profiling on some systems).
This file is initially copied from Setup.dist by the configure script;
if it does not exist yet, create it by copying Modules/Setup.dist
yourself (configure will never overwrite it). Never edit Setup.dist
-- always edit Setup or Setup.local (see below). Read the comments in
the file for information on what kind of edits are allowed. When you
have edited Setup in the Modules directory, the interpreter will
automatically be rebuilt the next time you run make (in the toplevel
directory).
Many useful modules can be built on any Unix system, but some optional
modules can't be reliably autodetected. Often the quickest way to
determine whether a particular module works or not is to see if it
will build: enable it in Setup, then if you get compilation or link
errors, disable it -- you're either missing support or need to adjust
the compilation and linking parameters for that module.
On SGI IRIX, there are modules that interface to many SGI specific
system libraries, e.g. the GL library and the audio hardware. These
modules will not be built by the setup.py script.
In addition to the file Setup, you can also edit the file Setup.local.
(the makesetup script processes both). You may find it more
convenient to edit Setup.local and leave Setup alone. Then, when
installing a new Python version, you can copy your old Setup.local
file.
Setting the optimization/debugging options
------------------------------------------
If you want or need to change the optimization/debugging options for
the C compiler, assign to the OPT variable on the toplevel make
command; e.g. "make OPT=-g" will build a debugging version of Python
on most platforms. The default is OPT=-O; a value for OPT in the
environment when the configure script is run overrides this default
(likewise for CC; and the initial value for LIBS is used as the base
set of libraries to link with).
When compiling with GCC, the default value of OPT will also include
the -Wall and -Wstrict-prototypes options.
Additional debugging code to help debug memory management problems can
be enabled by using the --with-pydebug option to the configure script.
For flags that change binary compatibility, use the EXTRA_CFLAGS
variable.
Profiling
---------
If you want C profiling turned on, the easiest way is to run configure
with the CC environment variable to the necessary compiler
invocation. For example, on Linux, this works for profiling using
gprof(1):
CC="gcc -pg" ./configure
Note that on Linux, gprof apparently does not work for shared
libraries. The Makefile/Setup mechanism can be used to compile and
link most extension modules statically.
Coverage checking
-----------------
For C coverage checking using gcov, run "make coverage". This will
build a Python binary with profiling activated, and a ".gcno" and
".gcda" file for every source file compiled with that option. With
the built binary, now run the code whose coverage you want to check.
Then, you can see coverage statistics for each individual source file
by running gcov, e.g.
gcov -o Modules zlibmodule
This will create a "zlibmodule.c.gcov" file in the current directory
containing coverage info for that source file.
This works only for source files statically compiled into the
executable; use the Makefile/Setup mechanism to compile and link
extension modules you want to coverage-check statically.
Testing
-------
To test the interpreter, type "make test" in the top-level directory.
This runs the test set twice (once with no compiled files, once with
the compiled files left by the previous test run). The test set
produces some output. You can generally ignore the messages about
skipped tests due to optional features which can't be imported.
If a message is printed about a failed test or a traceback or core
dump is produced, something is wrong. On some Linux systems (those
that are not yet using glibc 6), test_strftime fails due to a
non-standard implementation of strftime() in the C library. Please
ignore this, or upgrade to glibc version 6.
By default, tests are prevented from overusing resources like disk space and
memory. To enable these tests, run "make testall".
IMPORTANT: If the tests fail and you decide to mail a bug report,
*don't* include the output of "make test". It is useless. Run the
failing test manually, as follows:
./python Lib/test/regrtest.py -v test_whatever
(substituting the top of the source tree for '.' if you built in a
different directory). This runs the test in verbose mode.
Installing
----------
To install the Python binary, library modules, shared library modules
(see below), include files, configuration files, and the manual page,
just type
make install
This will install all platform-independent files in subdirectories of
the directory given with the --prefix option to configure or to the
`prefix' Make variable (default /usr/local). All binary and other
platform-specific files will be installed in subdirectories if the
directory given by --exec-prefix or the `exec_prefix' Make variable
(defaults to the --prefix directory) is given.
If DESTDIR is set, it will be taken as the root directory of the
installation, and files will be installed into $(DESTDIR)$(prefix),
$(DESTDIR)$(exec_prefix), etc.
All subdirectories created will have Python's version number in their
name, e.g. the library modules are installed in
"/usr/local/lib/python<version>/" by default, where <version> is the
<major>.<minor> release number (e.g. "2.1"). The Python binary is
installed as "python<version>" and a hard link named "python" is
created. The only file not installed with a version number in its
name is the manual page, installed as "/usr/local/man/man1/python.1"
by default.
If you want to install multiple versions of Python see the section below
entitled "Installing multiple versions".
The only thing you may have to install manually is the Python mode for
Emacs found in Misc/python-mode.el. (But then again, more recent
versions of Emacs may already have it.) Follow the instructions that
came with Emacs for installation of site-specific files.
Installing multiple versions
----------------------------
On Unix and Mac systems if you intend to install multiple versions of Python
using the same installation prefix (--prefix argument to the configure
script) you must take care that your primary python executable is not
overwritten by the installation of a different version. All files and
directories installed using "make altinstall" contain the major and minor
version and can thus live side-by-side. "make install" also creates
${prefix}/bin/python which refers to ${prefix}/bin/pythonX.Y. If you intend
to install multiple versions using the same prefix you must decide which
version (if any) is your "primary" version. Install that version using
"make install". Install all other versions using "make altinstall".
For example, if you want to install Python 2.5, 2.6 and 3.0 with 2.6 being
the primary version, you would execute "make install" in your 2.6 build
directory and "make altinstall" in the others.
Configuration options and variables
-----------------------------------
Some special cases are handled by passing options to the configure
script.
WARNING: if you rerun the configure script with different options, you
must run "make clean" before rebuilding. Exceptions to this rule:
after changing --prefix or --exec-prefix, all you need to do is remove
Modules/getpath.o.
--with(out)-gcc: The configure script uses gcc (the GNU C compiler) if
it finds it. If you don't want this, or if this compiler is
installed but broken on your platform, pass the option
--without-gcc. You can also pass "CC=cc" (or whatever the
name of the proper C compiler is) in the environment, but the
advantage of using --without-gcc is that this option is
remembered by the config.status script for its --recheck
option.
--prefix, --exec-prefix: If you want to install the binaries and the
Python library somewhere else than in /usr/local/{bin,lib},
you can pass the option --prefix=DIRECTORY; the interpreter
binary will be installed as DIRECTORY/bin/python and the
library files as DIRECTORY/lib/python/*. If you pass
--exec-prefix=DIRECTORY (as well) this overrides the
installation prefix for architecture-dependent files (like the
interpreter binary). Note that --prefix=DIRECTORY also
affects the default module search path (sys.path), when
Modules/config.c is compiled. Passing make the option
prefix=DIRECTORY (and/or exec_prefix=DIRECTORY) overrides the
prefix set at configuration time; this may be more convenient
than re-running the configure script if you change your mind
about the install prefix.
--with-readline: This option is no longer supported. GNU
readline is automatically enabled by setup.py when present.
--with-threads: On most Unix systems, you can now use multiple
threads, and support for this is enabled by default. To
disable this, pass --with-threads=no. If the library required
for threads lives in a peculiar place, you can use
--with-thread=DIRECTORY. IMPORTANT: run "make clean" after
changing (either enabling or disabling) this option, or you
will get link errors! Note: for DEC Unix use
--with-dec-threads instead.
--with-sgi-dl: On SGI IRIX 4, dynamic loading of extension modules is
supported by the "dl" library by Jack Jansen, which is
ftp'able from ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z.
This is enabled (after you've ftp'ed and compiled the dl
library) by passing --with-sgi-dl=DIRECTORY where DIRECTORY
is the absolute pathname of the dl library. (Don't bother on
IRIX 5, it already has dynamic linking using SunOS style
shared libraries.) THIS OPTION IS UNSUPPORTED.
--with-dl-dld: Dynamic loading of modules is rumored to be supported
on some other systems: VAX (Ultrix), Sun3 (SunOS 3.4), Sequent
Symmetry (Dynix), and Atari ST. This is done using a
combination of the GNU dynamic loading package
(ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z) and an
emulation of the SGI dl library mentioned above (the emulation
can be found at
ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z). To
enable this, ftp and compile both libraries, then call
configure, passing it the option
--with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY where DL_DIRECTORY is
the absolute pathname of the dl emulation library and
DLD_DIRECTORY is the absolute pathname of the GNU dld library.
(Don't bother on SunOS 4 or 5, they already have dynamic
linking using shared libraries.) THIS OPTION IS UNSUPPORTED.
--with-libm, --with-libc: It is possible to specify alternative
versions for the Math library (default -lm) and the C library
(default the empty string) using the options
--with-libm=STRING and --with-libc=STRING, respectively. For
example, if your system requires that you pass -lc_s to the C
compiler to use the shared C library, you can pass
--with-libc=-lc_s. These libraries are passed after all other
libraries, the C library last.
--with-libs='libs': Add 'libs' to the LIBS that the python interpreter
is linked against.
--with-cxx-main=<compiler>: If you plan to use C++ extension modules,
then -- on some platforms -- you need to compile python's main()
function with the C++ compiler. With this option, make will use
<compiler> to compile main() *and* to link the python executable.
It is likely that the resulting executable depends on the C++
runtime library of <compiler>. (The default is --without-cxx-main.)
There are platforms that do not require you to build Python
with a C++ compiler in order to use C++ extension modules.
E.g., x86 Linux with ELF shared binaries and GCC 3.x, 4.x is such
a platform. We recommend that you configure Python
--without-cxx-main on those platforms because a mismatch
between the C++ compiler version used to build Python and to
build a C++ extension module is likely to cause a crash at
runtime.
The Python installation also stores the variable CXX that
determines, e.g., the C++ compiler distutils calls by default
to build C++ extensions. If you set CXX on the configure command
line to any string of non-zero length, then configure won't
change CXX. If you do not preset CXX but pass
--with-cxx-main=<compiler>, then configure sets CXX=<compiler>.
In all other cases, configure looks for a C++ compiler by
some common names (c++, g++, gcc, CC, cxx, cc++, cl) and sets
CXX to the first compiler it finds. If it does not find any
C++ compiler, then it sets CXX="".
Similarly, if you want to change the command used to link the
python executable, then set LINKCC on the configure command line.
--with-pydebug: Enable additional debugging code to help track down
memory management problems. This allows printing a list of all
live objects when the interpreter terminates.
--with(out)-universal-newlines: enable reading of text files with
foreign newline convention (default: enabled). In other words,
any of \r, \n or \r\n is acceptable as end-of-line character.
If enabled import and execfile will automatically accept any newline
in files. Python code can open a file with open(file, 'U') to
read it in universal newline mode. THIS OPTION IS UNSUPPORTED.
--with-tsc: Profile using the Pentium timestamping counter (TSC).
--with-system-ffi: Build the _ctypes extension module using an ffi
library installed on the system.
--with-dbmliborder=db1:db2:...: Specify the order that backends for the
dbm extension are checked. Valid value is a colon separated string
with the backend names `ndbm', `gdbm' and `bdb'.
Building for multiple architectures (using the VPATH feature)
-------------------------------------------------------------
If your file system is shared between multiple architectures, it
usually is not necessary to make copies of the sources for each
architecture you want to support. If the make program supports the
VPATH feature, you can create an empty build directory for each
architecture, and in each directory run the configure script (on the
appropriate machine with the appropriate options). This creates the
necessary subdirectories and the Makefiles therein. The Makefiles
contain a line VPATH=... which points to a directory containing the
actual sources. (On SGI systems, use "smake -J1" instead of "make" if
you use VPATH -- don't try gnumake.)
For example, the following is all you need to build a minimal Python
in /usr/tmp/python (assuming ~guido/src/python is the toplevel
directory and you want to build in /usr/tmp/python):
$ mkdir /usr/tmp/python
$ cd /usr/tmp/python
$ ~guido/src/python/configure
[...]
$ make
[...]
$
Note that configure copies the original Setup file to the build
directory if it finds no Setup file there. This means that you can
edit the Setup file for each architecture independently. For this
reason, subsequent changes to the original Setup file are not tracked
automatically, as they might overwrite local changes. To force a copy
of a changed original Setup file, delete the target Setup file. (The
makesetup script supports multiple input files, so if you want to be
fancy you can change the rules to create an empty Setup.local if it
doesn't exist and run it with arguments $(srcdir)/Setup Setup.local;
however this assumes that you only need to add modules.)
Also note that you can't use a workspace for VPATH and non VPATH builds. The
object files left behind by one version confuses the other.
Building on non-UNIX systems
----------------------------
For Windows (2000/NT/ME/98/95), assuming you have MS VC++ 7.1, the
project files are in PCbuild, the workspace is pcbuild.dsw. See
PCbuild\readme.txt for detailed instructions.
For other non-Unix Windows compilers, in particular MS VC++ 6.0 and
for OS/2, enter the directory "PC" and read the file "readme.txt".
For the Mac, a separate source distribution will be made available,
for use with the CodeWarrior compiler. If you are interested in Mac
development, join the PythonMac Special Interest Group
(http://www.python.org/sigs/pythonmac-sig/, or send email to
pythonmac-sig-request@python.org).
Of course, there are also binary distributions available for these
platforms -- see http://www.python.org/.
To port Python to a new non-UNIX system, you will have to fake the
effect of running the configure script manually (for Mac and PC, this
has already been done for you). A good start is to copy the file
pyconfig.h.in to pyconfig.h and edit the latter to reflect the actual
configuration of your system. Most symbols must simply be defined as
1 only if the corresponding feature is present and can be left alone
otherwise; however the *_t type symbols must be defined as some
variant of int if they need to be defined at all.
For all platforms, it's important that the build arrange to define the
preprocessor symbol NDEBUG on the compiler command line in a release
build of Python (else assert() calls remain in the code, hurting
release-build performance). The Unix, Windows and Mac builds already
do this.
Miscellaneous issues
====================
Emacs mode
----------
There's an excellent Emacs editing mode for Python code; see the file
Misc/python-mode.el. Originally written by the famous Tim Peters, it is now
maintained by the equally famous Barry Warsaw. The latest version, along with
various other contributed Python-related Emacs goodies, is online at
http://launchpad.net/python-mode/.
Tkinter
-------
The setup.py script automatically configures this when it detects a
usable Tcl/Tk installation. This requires Tcl/Tk version 8.0 or
higher.
For more Tkinter information, see the Tkinter Resource page:
http://www.python.org/topics/tkinter/
There are demos in the Demo/tkinter directory.
Note that there's a Python module called "Tkinter" (capital T) which
lives in Lib/lib-tk/Tkinter.py, and a C module called "_tkinter"
(lower case t and leading underscore) which lives in
Modules/_tkinter.c. Demos and normal Tk applications import only the
Python Tkinter module -- only the latter imports the C _tkinter
module. In order to find the C _tkinter module, it must be compiled
and linked into the Python interpreter -- the setup.py script does
this. In order to find the Python Tkinter module, sys.path must be
set correctly -- normal installation takes care of this.
Distribution structure
----------------------
Most subdirectories have their own README files. Most files have
comments.
Demo/ Demonstration scripts, modules and programs
Doc/ Documentation sources (reStructuredText)
Grammar/ Input for the parser generator
Include/ Public header files
LICENSE Licensing information
Lib/ Python library modules
Mac/ Macintosh specific resources
Makefile.pre.in Source from which config.status creates the Makefile.pre
Misc/ Miscellaneous useful files
Modules/ Implementation of most built-in modules
Objects/ Implementation of most built-in object types
PC/ Files specific to PC ports (DOS, Windows, OS/2)
PCbuild/ Build directory for Microsoft Visual C++
Parser/ The parser and tokenizer and their input handling
Python/ The byte-compiler and interpreter
README The file you're reading now
RISCOS/ Files specific to RISC OS port
Tools/ Some useful programs written in Python
pyconfig.h.in Source from which pyconfig.h is created (GNU autoheader output)
configure Configuration shell script (GNU autoconf output)
configure.ac Configuration specification (input for GNU autoconf)
install-sh Shell script used to install files
setup.py Python script used to build extension modules
The following files will (may) be created in the toplevel directory by
the configuration and build processes:
Makefile Build rules
Makefile.pre Build rules before running Modules/makesetup
buildno Keeps track of the build number
config.cache Cache of configuration variables
pyconfig.h Configuration header
config.log Log from last configure run
config.status Status from last run of the configure script
getbuildinfo.o Object file from Modules/getbuildinfo.c
libpython<version>.a The library archive
python The executable interpreter
reflog.txt Output from running the regression suite with the -R flag
tags, TAGS Tags files for vi and Emacs
That's all, folks!
------------------
--Guido van Rossum (home page: http://www.python.org/~guido/)
doc/alt-python27-raven/PKG-INFO 0000644 00000002564 15173017736 0012010 0 ustar 00 Metadata-Version: 1.1
Name: raven
Version: 6.3.0
Summary: Raven is a client for Sentry (https://getsentry.com)
Home-page: https://github.com/getsentry/raven-python
Author: Sentry
Author-email: hello@getsentry.com
License: BSD
Description:
Raven
=====
Raven is a Python client for `Sentry <http://getsentry.com/>`_. It provides
full out-of-the-box support for many of the popular frameworks, including
`Django <djangoproject.com>`_, `Flask <http://flask.pocoo.org/>`_, and `Pylons
<http://www.pylonsproject.org/>`_. Raven also includes drop-in support for any
`WSGI <https://wsgi.readthedocs.io/>`_-compatible web application.
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development
doc/alt-python27-raven/LICENSE 0000644 00000002764 15173017737 0011723 0 ustar 00 Copyright (c) 2015 Functional Software, Inc and individual contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the Raven nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
doc/alt-python27-raven/README.rst 0000644 00000006674 15173017737 0012411 0 ustar 00 .. raw:: html
<p align="center">
.. image:: docs/_static/logo.png
:target: https://sentry.io
:align: center
:width: 116
:alt: Sentry website
.. raw:: html
</p>
Raven - Sentry for Python
=========================
.. image:: https://img.shields.io/pypi/v/raven.svg
:target: https://pypi.python.org/pypi/raven
:alt: PyPi page link -- version
.. image:: https://travis-ci.org/getsentry/raven-python.svg?branch=master
:target: https://travis-ci.org/getsentry/raven-python
.. image:: https://img.shields.io/pypi/l/raven.svg
:target: https://pypi.python.org/pypi/raven
:alt: PyPi page link -- MIT licence
.. image:: https://img.shields.io/pypi/pyversions/raven.svg
:target: https://pypi.python.org/pypi/raven
:alt: PyPi page link -- Python versions
.. image:: https://codeclimate.com/github/getsentry/raven-python/badges/gpa.svg
:target: https://codeclimate.com/github/codeclimate/codeclimate
:alt: Code Climate
Raven is the official Python client for `Sentry`_, officially supports
Python 2.6–2.7 & 3.3–3.7, and runs on PyPy and Google App Engine.
It tracks errors and exceptions that happen during the
execution of your application and provides instant notification with detailed
information needed to prioritize, identify, reproduce and fix each issue.
It provides full out-of-the-box support for many of the popular python frameworks, including
Django, and Flask. Raven also includes drop-in support for any WSGI-compatible
web application.
Your application doesn't live on the web? No problem! Raven is easy to use in
any Python application.
For more information, see our `Python Documentation`_ for framework integrations and other goodies.
Features
--------
- Automatically report (un)handled exceptions and errors
- Send customized diagnostic data
- Process and sanitize data before sending it over the network
Quickstart
----------
It's really easy to get started with Raven. After you complete setting up a project in Sentry,
you’ll be given a value which we call a DSN, or Data Source Name. You will need it to configure the client.
Install the latest package with *pip* and configure the client::
pip install raven --upgrade
Create a client and capture an example exception:
.. sourcecode:: python
from raven import Client
client = Client('___DSN___')
try:
1 / 0
except ZeroDivisionError:
client.captureException()
Raven Python is more than that however. Checkout our `Python Documentation`_.
Contributing
------------
Raven is under active development and contributions are more than welcome!
There are many ways to contribute:
* Join in on discussions on our `Mailing List`_ or in our `IRC Channel`_.
* Report bugs on our `Issue Tracker`_.
* Submit a pull request!
Resources
---------
* `Sentry`_
* `Python Documentation`_
* `Issue Tracker`_
* `Code`_ on Github
* `Mailing List`_
* `IRC Channel`_ (irc.freenode.net, #sentry)
* `Travis CI`_
.. _Sentry: https://getsentry.com/
.. _Python Documentation: https://docs.getsentry.com/hosted/clients/python/
.. _SDKs for other platforms: https://docs.sentry.io/#platforms
.. _Issue Tracker: https://github.com/getsentry/raven-python/issues
.. _Code: https://github.com/getsentry/raven-python
.. _Mailing List: https://groups.google.com/group/getsentry
.. _IRC Channel: irc://irc.freenode.net/sentry
.. _Travis CI: http://travis-ci.org/getsentry/raven-python
Not using Python? Check out our `SDKs for other platforms`_.
doc/alt-python27-pip/README.rst 0000644 00000004606 15173017740 0012051 0 ustar 00 pip - The Python Package Installer
==================================
.. image:: https://img.shields.io/pypi/v/pip.svg
:target: https://pypi.org/project/pip/
.. image:: https://readthedocs.org/projects/pip/badge/?version=latest
:target: https://pip.pypa.io/en/latest
pip is the `package installer`_ for Python. You can use pip to install packages from the `Python Package Index`_ and other indexes.
Please take a look at our documentation for how to install and use pip:
* `Installation`_
* `Usage`_
We release updates regularly, with a new version every 3 months. Find more details in our documentation:
* `Release notes`_
* `Release process`_
In 2020, we're working on improvements to the heart of pip. Please `learn more and take our survey`_ to help us do it right.
If you find bugs, need help, or want to talk to the developers, please use our mailing lists or chat rooms:
* `Issue tracking`_
* `Discourse channel`_
* `User IRC`_
If you want to get involved head over to GitHub to get the source code, look at our development documentation and feel free to jump on the developer mailing lists and chat rooms:
* `GitHub page`_
* `Development documentation`_
* `Development mailing list`_
* `Development IRC`_
Code of Conduct
---------------
Everyone interacting in the pip project's codebases, issue trackers, chat
rooms, and mailing lists is expected to follow the `PyPA Code of Conduct`_.
.. _package installer: https://packaging.python.org/guides/tool-recommendations/
.. _Python Package Index: https://pypi.org
.. _Installation: https://pip.pypa.io/en/stable/installing.html
.. _Usage: https://pip.pypa.io/en/stable/
.. _Release notes: https://pip.pypa.io/en/stable/news.html
.. _Release process: https://pip.pypa.io/en/latest/development/release-process/
.. _GitHub page: https://github.com/pypa/pip
.. _Development documentation: https://pip.pypa.io/en/latest/development
.. _learn more and take our survey: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html
.. _Issue tracking: https://github.com/pypa/pip/issues
.. _Discourse channel: https://discuss.python.org/c/packaging
.. _Development mailing list: https://mail.python.org/mailman3/lists/distutils-sig.python.org/
.. _User IRC: https://webchat.freenode.net/?channels=%23pypa
.. _Development IRC: https://webchat.freenode.net/?channels=%23pypa-dev
.. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/
doc/alt-python27-libs/README 0000644 00000154060 15173017741 0011404 0 ustar 00 This is Python version 2.7.18
=============================
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation. All
rights reserved.
Copyright (c) 2000 BeOpen.com.
All rights reserved.
Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All rights reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum.
All rights reserved.
License information
-------------------
See the file "LICENSE" for information on the history of this
software, terms & conditions for usage, and a DISCLAIMER OF ALL
WARRANTIES.
This Python distribution contains no GNU General Public Licensed
(GPLed) code so it may be used in proprietary projects just like prior
Python distributions. There are interfaces to some GNU code but these
are entirely optional.
All trademarks referenced herein are property of their respective
holders.
What's new in this release?
---------------------------
See the file "Misc/NEWS".
If you don't read instructions
------------------------------
Congratulations on getting this far. :-)
To start building right away (on UNIX): type "./configure" in the
current directory and when it finishes, type "make". This creates an
executable "./python"; to install in /usr/local, first do "su root"
and then "make install".
The section `Build instructions' below is still recommended reading.
What is Python anyway?
----------------------
Python is an interpreted, interactive object-oriented programming
language suitable (amongst other uses) for distributed application
development, scripting, numeric computing and system testing. Python
is often compared to Tcl, Perl, Java, JavaScript, Visual Basic or
Scheme. To find out more about what Python can do for you, point your
browser to http://www.python.org/.
How do I learn Python?
----------------------
The official tutorial is still a good place to start; see
http://docs.python.org/ for online and downloadable versions, as well
as a list of other introductions, and reference documentation.
There's a quickly growing set of books on Python. See
http://wiki.python.org/moin/PythonBooks for a list.
Documentation
-------------
All documentation is provided online in a variety of formats. In
order of importance for new users: Tutorial, Library Reference,
Language Reference, Extending & Embedding, and the Python/C API. The
Library Reference is especially of immense value since much of
Python's power is described there, including the built-in data types
and functions!
All documentation is also available online at the Python web site
(http://docs.python.org/, see below). It is available online for occasional
reference, or can be downloaded in many formats for faster access. The
documentation is downloadable in HTML, PostScript, PDF, LaTeX, and
reStructuredText (2.6+) formats; the LaTeX and reStructuredText versions are
primarily for documentation authors, translators, and people with special
formatting requirements.
If you would like to contribute to the development of Python, relevant
documentation is available at:
http://docs.python.org/devguide/
For information about building Python's documentation, refer to Doc/README.txt.
Web sites
---------
New Python releases and related technologies are published at
http://www.python.org/. Come visit us!
Newsgroups and Mailing Lists
----------------------------
Read comp.lang.python, a high-volume discussion newsgroup about
Python, or comp.lang.python.announce, a low-volume moderated newsgroup
for Python-related announcements. These are also accessible as
mailing lists: see http://www.python.org/community/lists/ for an
overview of these and many other Python-related mailing lists.
Archives are accessible via the Google Groups Usenet archive; see
http://groups.google.com/. The mailing lists are also archived, see
http://www.python.org/community/lists/ for details.
Bug reports
-----------
To report or search for bugs, please use the Python Bug
Tracker at http://bugs.python.org/.
Patches and contributions
-------------------------
To submit a patch or other contribution, please use the Python Patch
Manager at http://bugs.python.org/. Guidelines
for patch submission may be found at http://www.python.org/dev/patches/.
If you have a proposal to change Python, you may want to send an email to the
comp.lang.python or python-ideas mailing lists for inital feedback. A Python
Enhancement Proposal (PEP) may be submitted if your idea gains ground. All
current PEPs, as well as guidelines for submitting a new PEP, are listed at
http://www.python.org/dev/peps/.
Questions
---------
For help, if you can't find it in the manuals or on the web site, it's
best to post to the comp.lang.python or the Python mailing list (see
above). If you specifically don't want to involve the newsgroup or
mailing list, send questions to help@python.org (a group of volunteers
who answer questions as they can). The newsgroup is the most
efficient way to ask public questions.
Build instructions
==================
Before you can build Python, you must first configure it.
Fortunately, the configuration and build process has been automated
for Unix and Linux installations, so all you usually have to do is
type a few commands and sit back. There are some platforms where
things are not quite as smooth; see the platform specific notes below.
If you want to build for multiple platforms sharing the same source
tree, see the section on VPATH below.
Start by running the script "./configure", which determines your
system configuration and creates the Makefile. (It takes a minute or
two -- please be patient!) You may want to pass options to the
configure script -- see the section below on configuration options and
variables. When it's done, you are ready to run make.
To build Python, you normally type "make" in the toplevel directory.
If you have changed the configuration, the Makefile may have to be
rebuilt. In this case, you may have to run make again to correctly
build your desired target. The interpreter executable is built in the
top level directory.
To get an optimized build of Python, "configure --enable-optimizations" before
you run make. This sets the default make targets up to enable Profile Guided
Optimization (PGO) and may be used to auto-enable Link Time Optimization (LTO)
on some platforms. For more details, see the sections bellow.
Once you have built a Python interpreter, see the subsections below on
testing and installation. If you run into trouble, see the next
section.
Previous versions of Python used a manual configuration process that
involved editing the file Modules/Setup. While this file still exists
and manual configuration is still supported, it is rarely needed any
more: almost all modules are automatically built as appropriate under
guidance of the setup.py script, which is run by Make after the
interpreter has been built.
Profile Guided Optimization
---------------------------
PGO takes advantage of recent versions of the GCC or Clang compilers.
If ran, "make profile-opt" will do several steps.
First, the entire Python directory is cleaned of temporary files that
may have resulted in a previous compilation.
Then, an instrumented version of the interpreter is built, using suitable
compiler flags for each flavour. Note that this is just an intermediary
step and the binary resulted after this step is not good for real life
workloads, as it has profiling instructions embedded inside.
After this instrumented version of the interpreter is built, the Makefile
will automatically run a training workload. This is necessary in order to
profile the interpreter execution. Note also that any output, both stdout
and stderr, that may appear at this step is suppressed.
Finally, the last step is to rebuild the interpreter, using the information
collected in the previous one. The end result will be a Python binary
that is optimized and suitable for distribution or production installation.
Link Time Optimization
----------------------
Enabled via configure's --with-lto flag. LTO takes advantages of recent
compiler toolchains ability to optimize across the otherwise arbitrary .o file
boundary when building final executables or shared libraries for additional
performance gains.
Troubleshooting
---------------
See also the platform specific notes in the next section.
If you run into other trouble, see the FAQ
(http://www.python.org/doc/faq/) for hints on what can go wrong, and
how to fix it.
If you rerun the configure script with different options, remove all
object files by running "make clean" before rebuilding. Believe it or
not, "make clean" sometimes helps to clean up other inexplicable
problems as well. Try it before sending in a bug report!
If the configure script fails or doesn't seem to find things that
should be there, inspect the config.log file.
If you get a warning for every file about the -Olimit option being no
longer supported, you can ignore it. There's no foolproof way to know
whether this option is needed; all we can do is test whether it is
accepted without error. On some systems, e.g. older SGI compilers, it
is essential for performance (specifically when compiling ceval.c,
which has more basic blocks than the default limit of 1000). If the
warning bothers you, edit the Makefile to remove "-Olimit 1500" from
the OPT variable.
If you get failures in test_long, or sys.maxint gets set to -1, you
are probably experiencing compiler bugs, usually related to
optimization. This is a common problem with some versions of gcc, and
some vendor-supplied compilers, which can sometimes be worked around
by turning off optimization. Consider switching to stable versions
(gcc 2.95.2, gcc 3.x, or contact your vendor.)
From Python 2.0 onward, all Python C code is ANSI C. Compiling using
old K&R-C-only compilers is no longer possible. ANSI C compilers are
available for all modern systems, either in the form of updated
compilers from the vendor, or one of the free compilers (gcc).
If "make install" fails mysteriously during the "compiling the library"
step, make sure that you don't have any of the PYTHONPATH or PYTHONHOME
environment variables set, as they may interfere with the newly built
executable which is compiling the library.
Unsupported systems
-------------------
A number of systems are not supported in Python 2.7 anymore. Some
support code is still present, but will be removed in later versions.
If you still need to use current Python versions on these systems,
please send a message to python-dev@python.org indicating that you
volunteer to support this system. For a more detailed discussion
regarding no-longer-supported and resupporting platforms, as well
as a list of platforms that became or will be unsupported, see PEP 11.
More specifically, the following systems are not supported any
longer:
- SunOS 4
- DYNIX
- dgux
- Minix
- NeXT
- Irix 4 and --with-sgi-dl
- Linux 1
- Systems defining __d6_pthread_create (configure.ac)
- Systems defining PY_PTHREAD_D4, PY_PTHREAD_D6,
or PY_PTHREAD_D7 in thread_pthread.h
- Systems using --with-dl-dld
- Systems using --without-universal-newlines
- MacOS 9
- Systems using --with-wctype-functions
- Win9x, WinME
Platform specific notes
-----------------------
(Some of these may no longer apply. If you find you can build Python
on these platforms without the special directions mentioned here,
submit a documentation bug report to SourceForge (see Bug Reports
above) so we can remove them!)
Unix platforms: If your vendor still ships (and you still use) Berkeley DB
1.85 you will need to edit Modules/Setup to build the bsddb185
module and add a line to sitecustomize.py which makes it the
default. In Modules/Setup a line like
bsddb185 bsddbmodule.c
should work. (You may need to add -I, -L or -l flags to direct the
compiler and linker to your include files and libraries.)
XXX I think this next bit is out of date:
64-bit platforms: The modules audioop, and imageop don't work.
The setup.py script disables them on 64-bit installations.
Don't try to enable them in the Modules/Setup file. They
contain code that is quite wordsize sensitive. (If you have a
fix, let us know!)
Solaris: When using Sun's C compiler with threads, at least on Solaris
2.5.1, you need to add the "-mt" compiler option (the simplest
way is probably to specify the compiler with this option as
the "CC" environment variable when running the configure
script).
When using GCC on Solaris, beware of binutils 2.13 or GCC
versions built using it. This mistakenly enables the
-zcombreloc option which creates broken shared libraries on
Solaris. binutils 2.12 works, and the binutils maintainers
are aware of the problem. Binutils 2.13.1 only partially
fixed things. It appears that 2.13.2 solves the problem
completely. This problem is known to occur with Solaris 2.7
and 2.8, but may also affect earlier and later versions of the
OS.
When the dynamic loader complains about errors finding shared
libraries, such as
ld.so.1: ./python: fatal: libstdc++.so.5: open failed:
No such file or directory
you need to first make sure that the library is available on
your system. Then, you need to instruct the dynamic loader how
to find it. You can choose any of the following strategies:
1. When compiling Python, set LD_RUN_PATH to the directories
containing missing libraries.
2. When running Python, set LD_LIBRARY_PATH to these directories.
3. Use crle(8) to extend the search path of the loader.
4. Modify the installed GCC specs file, adding -R options into the
*link: section.
The complex object fails to compile on Solaris 10 with gcc 3.4 (at
least up to 3.4.3). To work around it, define Py_HUGE_VAL as
HUGE_VAL(), e.g.:
make CPPFLAGS='-D"Py_HUGE_VAL=HUGE_VAL()" -I. -I$(srcdir)/Include'
./python setup.py CPPFLAGS='-D"Py_HUGE_VAL=HUGE_VAL()"'
Linux: A problem with threads and fork() was tracked down to a bug in
the pthreads code in glibc version 2.0.5; glibc version 2.0.7
solves the problem. This causes the popen2 test to fail;
problem and solution reported by Pablo Bleyer.
Red Hat Linux: Red Hat 9 built Python2.2 in UCS-4 mode and hacked
Tcl to support it. To compile Python2.3 with Tkinter, you will
need to pass --enable-unicode=ucs4 flag to ./configure.
There's an executable /usr/bin/python which is Python
1.5.2 on most older Red Hat installations; several key Red Hat tools
require this version. Python 2.1.x may be installed as
/usr/bin/python2. The Makefile installs Python as
/usr/local/bin/python, which may or may not take precedence
over /usr/bin/python, depending on how you have set up $PATH.
FreeBSD 3.x and probably platforms with NCurses that use libmytinfo or
similar: When using cursesmodule, the linking is not done in
the correct order with the defaults. Remove "-ltermcap" from
the readline entry in Setup, and use as curses entry: "curses
cursesmodule.c -lmytinfo -lncurses -ltermcap" - "mytinfo" (so
called on FreeBSD) should be the name of the auxiliary library
required on your platform. Normally, it would be linked
automatically, but not necessarily in the correct order.
BSDI: BSDI versions before 4.1 have known problems with threads,
which can cause strange errors in a number of modules (for
instance, the 'test_signal' test script will hang forever.)
Turning off threads (with --with-threads=no) or upgrading to
BSDI 4.1 solves this problem.
DEC Unix: Run configure with --with-dec-threads, or with
--with-threads=no if no threads are desired (threads are on by
default). When using GCC, it is possible to get an internal
compiler error if optimization is used. This was reported for
GCC 2.7.2.3 on selectmodule.c. Manually compile the affected
file without optimization to solve the problem.
DEC Ultrix: compile with GCC to avoid bugs in the native compiler,
and pass SHELL=/bin/sh5 to Make when installing.
AIX: A complete overhaul of the shared library support is now in
place. See Misc/AIX-NOTES for some notes on how it's done.
(The optimizer bug reported at this place in previous releases
has been worked around by a minimal code change.) If you get
errors about pthread_* functions, during compile or during
testing, try setting CC to a thread-safe (reentrant) compiler,
like "cc_r". For full C++ module support, set CC="xlC_r" (or
CC="xlC" without thread support).
AIX 5.3: To build a 64-bit version with IBM's compiler, I used the
following:
export PATH=/usr/bin:/usr/vacpp/bin
./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64" \
--disable-ipv6 AR="ar -X64"
make
HP-UX: When using threading, you may have to add -D_REENTRANT to the
OPT variable in the top-level Makefile; reported by Pat Knight,
this seems to make a difference (at least for HP-UX 10.20)
even though pyconfig.h defines it. This seems unnecessary when
using HP/UX 11 and later - threading seems to work "out of the
box".
HP-UX ia64: When building on the ia64 (Itanium) platform using HP's
compiler, some experience has shown that the compiler's
optimiser produces a completely broken version of python
(see http://bugs.python.org/814976). To work around this,
edit the Makefile and remove -O from the OPT line.
To build a 64-bit executable on an Itanium 2 system using HP's
compiler, use these environment variables:
CC=cc
CXX=aCC
BASECFLAGS="+DD64"
LDFLAGS="+DD64 -lxnet"
and call configure as:
./configure --without-gcc
then *unset* the environment variables again before running
make. (At least one of these flags causes the build to fail
if it remains set.) You still have to edit the Makefile and
remove -O from the OPT line.
HP PA-RISC 2.0: A recent bug report (http://bugs.python.org/546117)
suggests that the C compiler in this 64-bit system has bugs
in the optimizer that break Python. Compiling without
optimization solves the problems.
SCO: The following apply to SCO 3 only; Python builds out of the box
on SCO 5 (or so we've heard).
1) Everything works much better if you add -U__STDC__ to the
defs. This is because all the SCO header files are broken.
Anything that isn't mentioned in the C standard is
conditionally excluded when __STDC__ is defined.
2) Due to the U.S. export restrictions, SCO broke the crypt
stuff out into a separate library, libcrypt_i.a so the LIBS
needed be set to:
LIBS=' -lsocket -lcrypt_i'
UnixWare: There are known bugs in the math library of the system, as well as
problems in the handling of threads (calling fork in one
thread may interrupt system calls in others). Therefore, test_math and
tests involving threads will fail until those problems are fixed.
QNX: Chris Herborth (chrish@qnx.com) writes:
configure works best if you use GNU bash; a port is available on
ftp.qnx.com in /usr/free. I used the following process to build,
test and install Python 1.5.x under QNX:
1) CONFIG_SHELL=/usr/local/bin/bash CC=cc RANLIB=: \
./configure --verbose --without-gcc --with-libm=""
2) edit Modules/Setup to activate everything that makes sense for
your system... tested here at QNX with the following modules:
array, audioop, binascii, cPickle, cStringIO, cmath,
crypt, curses, errno, fcntl, gdbm, grp, imageop,
_locale, math, md5, new, operator, parser, pcre,
posix, pwd, readline, regex, reop,
select, signal, socket, soundex, strop, struct,
syslog, termios, time, timing, zlib, audioop, imageop
3) make SHELL=/usr/local/bin/bash
or, if you feel the need for speed:
make SHELL=/usr/local/bin/bash OPT="-5 -Oil+nrt"
4) make SHELL=/usr/local/bin/bash test
Using GNU readline 2.2 seems to behave strangely, but I
think that's a problem with my readline 2.2 port. :-\
5) make SHELL=/usr/local/bin/bash install
If you get SIGSEGVs while running Python (I haven't yet, but
I've only run small programs and the test cases), you're
probably running out of stack; the default 32k could be a
little tight. To increase the stack size, edit the Makefile
to read: LDFLAGS = -N 48k
BeOS: See Misc/BeOS-NOTES for notes about compiling/installing
Python on BeOS R3 or later. Note that only the PowerPC
platform is supported for R3; both PowerPC and x86 are
supported for R4.
Cray T3E: Mark Hadfield (m.hadfield@niwa.co.nz) writes:
Python can be built satisfactorily on a Cray T3E but based on
my experience with the NIWA T3E (2002-05-22, version 2.2.1)
there are a few bugs and gotchas. For more information see a
thread on comp.lang.python in May 2002 entitled "Building
Python on Cray T3E".
1) Use Cray's cc and not gcc. The latter was reported not to
work by Konrad Hinsen. It may work now, but it may not.
2) To set sys.platform to something sensible, pass the
following environment variable to the configure script:
MACHDEP=unicosmk
2) Run configure with option "--enable-unicode=ucs4".
3) The Cray T3E does not support dynamic linking, so extension
modules have to be built by adding (or uncommenting) lines
in Modules/Setup. The minimum set of modules is
posix, new, _sre, unicodedata
On NIWA's vanilla T3E system the following have also been
included successfully:
_codecs, _locale, _socket, _symtable, _testcapi, _weakref
array, binascii, cmath, cPickle, crypt, cStringIO, dbm
errno, fcntl, grp, math, md5, operator, parser, pcre, pwd
regex, rotor, select, struct, strop, syslog, termios
time, timing, xreadlines
4) Once the python executable and library have been built, make
will execute setup.py, which will attempt to build remaining
extensions and link them dynamically. Each of these attempts
will fail but should not halt the make process. This is
normal.
5) Running "make test" uses a lot of resources and causes
problems on our system. You might want to try running tests
singly or in small groups.
SGI: SGI's standard "make" utility (/bin/make or /usr/bin/make)
does not check whether a command actually changed the file it
is supposed to build. This means that whenever you say "make"
it will redo the link step. The remedy is to use SGI's much
smarter "smake" utility (/usr/sbin/smake), or GNU make. If
you set the first line of the Makefile to #!/usr/sbin/smake
smake will be invoked by make (likewise for GNU make).
WARNING: There are bugs in the optimizer of some versions of
SGI's compilers that can cause bus errors or other strange
behavior, especially on numerical operations. To avoid this,
try building with "make OPT=".
OS/2: If you are running Warp3 or Warp4 and have IBM's VisualAge C/C++
compiler installed, just change into the pc\os2vacpp directory
and type NMAKE. Threading and sockets are supported by default
in the resulting binaries of PYTHON15.DLL and PYTHON.EXE.
Reliant UNIX: The thread support does not compile on Reliant UNIX, and
there is a (minor) problem in the configure script for that
platform as well. This should be resolved in time for a
future release.
macOS: Building a complete Python installation requires the use of various
additional third-party libraries, depending on your build platform and
configure options. Not all standard library modules are buildable or
useable on all platforms. Refer to the "Install Dependencies" section
section of the "Developer Guide" for current detailed information on
dependencies for macOS:
https://devguide.python.org/setup/#install-dependencies
On macOS, there are additional configure and build options related
to macOS framework and universal builds. Refer to Mac/README.rst.
The tests will crash on both 10.1 and 10.2 with SEGV in
test_re and test_sre due to the small default stack size. If
you set the stack size to 2048 before doing a "make test" the
failure can be avoided. If you're using the tcsh or csh shells,
use "limit stacksize 2048" and for the bash shell (the default
as of macOS 10.3), use "ulimit -s 2048".
On naked Darwin you may want to add the configure option
"--disable-toolbox-glue" to disable the glue code for the Carbon
interface modules. The modules themselves are currently only built
if you add the --enable-framework option, see below.
On a clean macOS /usr/local does not exist. Do a
"sudo mkdir -m 775 /usr/local"
before you do a make install. It is probably not a good idea to
do "sudo make install" which installs everything as superuser,
as this may later cause problems when installing distutils-based
additions.
Some people have reported problems building Python after using "fink"
to install additional unix software. Disabling fink (remove all
references to /sw from your .profile or .login) should solve this.
Cygwin: With recent (relative to the time of writing, 2001-12-19)
Cygwin installations, there are problems with the interaction
of dynamic linking and fork(). This manifests itself in build
failures during the execution of setup.py.
There are two workarounds that both enable Python (albeit
without threading support) to build and pass all tests on
NT/2000 (and most likely XP as well, though reports of testing
on XP would be appreciated).
The workarounds:
(a) the band-aid fix is to link the _socket module statically
rather than dynamically (which is the default).
To do this, run "./configure --with-threads=no" including any
other options you need (--prefix, etc.). Then in Modules/Setup
uncomment the lines:
#SSL=/usr/local/ssl
#_socket socketmodule.c \
# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
# -L$(SSL)/lib -lssl -lcrypto
and remove "local/" from the SSL variable. Finally, just run
"make"!
(b) The "proper" fix is to rebase the Cygwin DLLs to prevent
base address conflicts. Details on how to do this can be
found in the following mail:
http://sources.redhat.com/ml/cygwin/2001-12/msg00894.html
It is hoped that a version of this solution will be
incorporated into the Cygwin distribution fairly soon.
Two additional problems:
(1) Threading support should still be disabled due to a known
bug in Cygwin pthreads that causes test_threadedtempfile to
hang.
(2) The _curses module does not build. This is a known
Cygwin ncurses problem that should be resolved the next time
that this package is released.
On older versions of Cygwin, test_poll may hang and test_strftime
may fail.
The situation on 9X/Me is not accurately known at present.
Some time ago, there were reports that the following
regression tests failed:
test_pwd
test_select (hang)
test_socket
Due to the test_select hang on 9X/Me, one should run the
regression test using the following:
make TESTOPTS='-l -x test_select' test
News regarding these platforms with more recent Cygwin
versions would be appreciated!
Windows: When executing Python scripts on the command line using file type
associations (i.e. starting "script.py" instead of "python script.py"),
redirects may not work unless you set a specific registry key. See
the Knowledge Base article <http://support.microsoft.com/kb/321788>.
Configuring the bsddb and dbm modules
-------------------------------------
Beginning with Python version 2.3, the PyBsddb package
<http://pybsddb.sf.net/> was adopted into Python as the bsddb package,
exposing a set of package-level functions which provide
backwards-compatible behavior. Only versions 3.3 through 4.4 of
Sleepycat's libraries provide the necessary API, so older versions
aren't supported through this interface. The old bsddb module has
been retained as bsddb185, though it is not built by default. Users
wishing to use it will have to tweak Modules/Setup to build it. The
dbm module will still be built against the Sleepycat libraries if
other preferred alternatives (ndbm, gdbm) are not found.
Building the sqlite3 module
---------------------------
To build the sqlite3 module, you'll need the sqlite3 or libsqlite3
packages installed, including the header files. Many modern operating
systems distribute the headers in a separate package to the library -
often it will be the same name as the main package, but with a -dev or
-devel suffix.
The version of pysqlite2 that's including in Python needs sqlite3 3.0.8
or later. setup.py attempts to check that it can find a correct version.
Configuring threads
-------------------
As of Python 2.0, threads are enabled by default. If you wish to
compile without threads, or if your thread support is broken, pass the
--with-threads=no switch to configure. Unfortunately, on some
platforms, additional compiler and/or linker options are required for
threads to work properly. Below is a table of those options,
collected by Bill Janssen. We would love to automate this process
more, but the information below is not enough to write a patch for the
configure.ac file, so manual intervention is required. If you patch
the configure.ac file and are confident that the patch works, please
send in the patch. (Don't bother patching the configure script itself
-- it is regenerated each time the configure.ac file changes.)
Compiler switches for threads
.............................
The definition of _REENTRANT should be configured automatically, if
that does not work on your system, or if _REENTRANT is defined
incorrectly, please report that as a bug.
OS/Compiler/threads Switches for use with threads
(POSIX is draft 10, DCE is draft 4) compile & link
SunOS 5.{1-5}/{gcc,SunPro cc}/solaris -mt
SunOS 5.5/{gcc,SunPro cc}/POSIX (nothing)
DEC OSF/1 3.x/cc/DCE -threads
(butenhof@zko.dec.com)
Digital UNIX 4.x/cc/DCE -threads
(butenhof@zko.dec.com)
Digital UNIX 4.x/cc/POSIX -pthread
(butenhof@zko.dec.com)
AIX 4.1.4/cc_r/d7 (nothing)
(buhrt@iquest.net)
AIX 4.1.4/cc_r4/DCE (nothing)
(buhrt@iquest.net)
IRIX 6.2/cc/POSIX (nothing)
(robertl@cwi.nl)
Linker (ld) libraries and flags for threads
...........................................
OS/threads Libraries/switches for use with threads
SunOS 5.{1-5}/solaris -lthread
SunOS 5.5/POSIX -lpthread
DEC OSF/1 3.x/DCE -lpthreads -lmach -lc_r -lc
(butenhof@zko.dec.com)
Digital UNIX 4.x/DCE -lpthreads -lpthread -lmach -lexc -lc
(butenhof@zko.dec.com)
Digital UNIX 4.x/POSIX -lpthread -lmach -lexc -lc
(butenhof@zko.dec.com)
AIX 4.1.4/{draft7,DCE} (nothing)
(buhrt@iquest.net)
IRIX 6.2/POSIX -lpthread
(jph@emilia.engr.sgi.com)
Building a shared libpython
---------------------------
Starting with Python 2.3, the majority of the interpreter can be built
into a shared library, which can then be used by the interpreter
executable, and by applications embedding Python. To enable this feature,
configure with --enable-shared.
If you enable this feature, the same object files will be used to create
a static library. In particular, the static library will contain object
files using position-independent code (PIC) on platforms where PIC flags
are needed for the shared library.
Configuring additional built-in modules
---------------------------------------
Starting with Python 2.1, the setup.py script at the top of the source
distribution attempts to detect which modules can be built and
automatically compiles them. Autodetection doesn't always work, so
you can still customize the configuration by editing the Modules/Setup
file; but this should be considered a last resort. The rest of this
section only applies if you decide to edit the Modules/Setup file.
You also need this to enable static linking of certain modules (which
is needed to enable profiling on some systems).
This file is initially copied from Setup.dist by the configure script;
if it does not exist yet, create it by copying Modules/Setup.dist
yourself (configure will never overwrite it). Never edit Setup.dist
-- always edit Setup or Setup.local (see below). Read the comments in
the file for information on what kind of edits are allowed. When you
have edited Setup in the Modules directory, the interpreter will
automatically be rebuilt the next time you run make (in the toplevel
directory).
Many useful modules can be built on any Unix system, but some optional
modules can't be reliably autodetected. Often the quickest way to
determine whether a particular module works or not is to see if it
will build: enable it in Setup, then if you get compilation or link
errors, disable it -- you're either missing support or need to adjust
the compilation and linking parameters for that module.
On SGI IRIX, there are modules that interface to many SGI specific
system libraries, e.g. the GL library and the audio hardware. These
modules will not be built by the setup.py script.
In addition to the file Setup, you can also edit the file Setup.local.
(the makesetup script processes both). You may find it more
convenient to edit Setup.local and leave Setup alone. Then, when
installing a new Python version, you can copy your old Setup.local
file.
Setting the optimization/debugging options
------------------------------------------
If you want or need to change the optimization/debugging options for
the C compiler, assign to the OPT variable on the toplevel make
command; e.g. "make OPT=-g" will build a debugging version of Python
on most platforms. The default is OPT=-O; a value for OPT in the
environment when the configure script is run overrides this default
(likewise for CC; and the initial value for LIBS is used as the base
set of libraries to link with).
When compiling with GCC, the default value of OPT will also include
the -Wall and -Wstrict-prototypes options.
Additional debugging code to help debug memory management problems can
be enabled by using the --with-pydebug option to the configure script.
For flags that change binary compatibility, use the EXTRA_CFLAGS
variable.
Profiling
---------
If you want C profiling turned on, the easiest way is to run configure
with the CC environment variable to the necessary compiler
invocation. For example, on Linux, this works for profiling using
gprof(1):
CC="gcc -pg" ./configure
Note that on Linux, gprof apparently does not work for shared
libraries. The Makefile/Setup mechanism can be used to compile and
link most extension modules statically.
Coverage checking
-----------------
For C coverage checking using gcov, run "make coverage". This will
build a Python binary with profiling activated, and a ".gcno" and
".gcda" file for every source file compiled with that option. With
the built binary, now run the code whose coverage you want to check.
Then, you can see coverage statistics for each individual source file
by running gcov, e.g.
gcov -o Modules zlibmodule
This will create a "zlibmodule.c.gcov" file in the current directory
containing coverage info for that source file.
This works only for source files statically compiled into the
executable; use the Makefile/Setup mechanism to compile and link
extension modules you want to coverage-check statically.
Testing
-------
To test the interpreter, type "make test" in the top-level directory.
This runs the test set twice (once with no compiled files, once with
the compiled files left by the previous test run). The test set
produces some output. You can generally ignore the messages about
skipped tests due to optional features which can't be imported.
If a message is printed about a failed test or a traceback or core
dump is produced, something is wrong. On some Linux systems (those
that are not yet using glibc 6), test_strftime fails due to a
non-standard implementation of strftime() in the C library. Please
ignore this, or upgrade to glibc version 6.
By default, tests are prevented from overusing resources like disk space and
memory. To enable these tests, run "make testall".
IMPORTANT: If the tests fail and you decide to mail a bug report,
*don't* include the output of "make test". It is useless. Run the
failing test manually, as follows:
./python Lib/test/regrtest.py -v test_whatever
(substituting the top of the source tree for '.' if you built in a
different directory). This runs the test in verbose mode.
Installing
----------
To install the Python binary, library modules, shared library modules
(see below), include files, configuration files, and the manual page,
just type
make install
This will install all platform-independent files in subdirectories of
the directory given with the --prefix option to configure or to the
`prefix' Make variable (default /usr/local). All binary and other
platform-specific files will be installed in subdirectories if the
directory given by --exec-prefix or the `exec_prefix' Make variable
(defaults to the --prefix directory) is given.
If DESTDIR is set, it will be taken as the root directory of the
installation, and files will be installed into $(DESTDIR)$(prefix),
$(DESTDIR)$(exec_prefix), etc.
All subdirectories created will have Python's version number in their
name, e.g. the library modules are installed in
"/usr/local/lib/python<version>/" by default, where <version> is the
<major>.<minor> release number (e.g. "2.1"). The Python binary is
installed as "python<version>" and a hard link named "python" is
created. The only file not installed with a version number in its
name is the manual page, installed as "/usr/local/man/man1/python.1"
by default.
If you want to install multiple versions of Python see the section below
entitled "Installing multiple versions".
The only thing you may have to install manually is the Python mode for
Emacs found in Misc/python-mode.el. (But then again, more recent
versions of Emacs may already have it.) Follow the instructions that
came with Emacs for installation of site-specific files.
Installing multiple versions
----------------------------
On Unix and Mac systems if you intend to install multiple versions of Python
using the same installation prefix (--prefix argument to the configure
script) you must take care that your primary python executable is not
overwritten by the installation of a different version. All files and
directories installed using "make altinstall" contain the major and minor
version and can thus live side-by-side. "make install" also creates
${prefix}/bin/python which refers to ${prefix}/bin/pythonX.Y. If you intend
to install multiple versions using the same prefix you must decide which
version (if any) is your "primary" version. Install that version using
"make install". Install all other versions using "make altinstall".
For example, if you want to install Python 2.5, 2.6 and 3.0 with 2.6 being
the primary version, you would execute "make install" in your 2.6 build
directory and "make altinstall" in the others.
Configuration options and variables
-----------------------------------
Some special cases are handled by passing options to the configure
script.
WARNING: if you rerun the configure script with different options, you
must run "make clean" before rebuilding. Exceptions to this rule:
after changing --prefix or --exec-prefix, all you need to do is remove
Modules/getpath.o.
--with(out)-gcc: The configure script uses gcc (the GNU C compiler) if
it finds it. If you don't want this, or if this compiler is
installed but broken on your platform, pass the option
--without-gcc. You can also pass "CC=cc" (or whatever the
name of the proper C compiler is) in the environment, but the
advantage of using --without-gcc is that this option is
remembered by the config.status script for its --recheck
option.
--prefix, --exec-prefix: If you want to install the binaries and the
Python library somewhere else than in /usr/local/{bin,lib},
you can pass the option --prefix=DIRECTORY; the interpreter
binary will be installed as DIRECTORY/bin/python and the
library files as DIRECTORY/lib/python/*. If you pass
--exec-prefix=DIRECTORY (as well) this overrides the
installation prefix for architecture-dependent files (like the
interpreter binary). Note that --prefix=DIRECTORY also
affects the default module search path (sys.path), when
Modules/config.c is compiled. Passing make the option
prefix=DIRECTORY (and/or exec_prefix=DIRECTORY) overrides the
prefix set at configuration time; this may be more convenient
than re-running the configure script if you change your mind
about the install prefix.
--with-readline: This option is no longer supported. GNU
readline is automatically enabled by setup.py when present.
--with-threads: On most Unix systems, you can now use multiple
threads, and support for this is enabled by default. To
disable this, pass --with-threads=no. If the library required
for threads lives in a peculiar place, you can use
--with-thread=DIRECTORY. IMPORTANT: run "make clean" after
changing (either enabling or disabling) this option, or you
will get link errors! Note: for DEC Unix use
--with-dec-threads instead.
--with-sgi-dl: On SGI IRIX 4, dynamic loading of extension modules is
supported by the "dl" library by Jack Jansen, which is
ftp'able from ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z.
This is enabled (after you've ftp'ed and compiled the dl
library) by passing --with-sgi-dl=DIRECTORY where DIRECTORY
is the absolute pathname of the dl library. (Don't bother on
IRIX 5, it already has dynamic linking using SunOS style
shared libraries.) THIS OPTION IS UNSUPPORTED.
--with-dl-dld: Dynamic loading of modules is rumored to be supported
on some other systems: VAX (Ultrix), Sun3 (SunOS 3.4), Sequent
Symmetry (Dynix), and Atari ST. This is done using a
combination of the GNU dynamic loading package
(ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z) and an
emulation of the SGI dl library mentioned above (the emulation
can be found at
ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z). To
enable this, ftp and compile both libraries, then call
configure, passing it the option
--with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY where DL_DIRECTORY is
the absolute pathname of the dl emulation library and
DLD_DIRECTORY is the absolute pathname of the GNU dld library.
(Don't bother on SunOS 4 or 5, they already have dynamic
linking using shared libraries.) THIS OPTION IS UNSUPPORTED.
--with-libm, --with-libc: It is possible to specify alternative
versions for the Math library (default -lm) and the C library
(default the empty string) using the options
--with-libm=STRING and --with-libc=STRING, respectively. For
example, if your system requires that you pass -lc_s to the C
compiler to use the shared C library, you can pass
--with-libc=-lc_s. These libraries are passed after all other
libraries, the C library last.
--with-libs='libs': Add 'libs' to the LIBS that the python interpreter
is linked against.
--with-cxx-main=<compiler>: If you plan to use C++ extension modules,
then -- on some platforms -- you need to compile python's main()
function with the C++ compiler. With this option, make will use
<compiler> to compile main() *and* to link the python executable.
It is likely that the resulting executable depends on the C++
runtime library of <compiler>. (The default is --without-cxx-main.)
There are platforms that do not require you to build Python
with a C++ compiler in order to use C++ extension modules.
E.g., x86 Linux with ELF shared binaries and GCC 3.x, 4.x is such
a platform. We recommend that you configure Python
--without-cxx-main on those platforms because a mismatch
between the C++ compiler version used to build Python and to
build a C++ extension module is likely to cause a crash at
runtime.
The Python installation also stores the variable CXX that
determines, e.g., the C++ compiler distutils calls by default
to build C++ extensions. If you set CXX on the configure command
line to any string of non-zero length, then configure won't
change CXX. If you do not preset CXX but pass
--with-cxx-main=<compiler>, then configure sets CXX=<compiler>.
In all other cases, configure looks for a C++ compiler by
some common names (c++, g++, gcc, CC, cxx, cc++, cl) and sets
CXX to the first compiler it finds. If it does not find any
C++ compiler, then it sets CXX="".
Similarly, if you want to change the command used to link the
python executable, then set LINKCC on the configure command line.
--with-pydebug: Enable additional debugging code to help track down
memory management problems. This allows printing a list of all
live objects when the interpreter terminates.
--with(out)-universal-newlines: enable reading of text files with
foreign newline convention (default: enabled). In other words,
any of \r, \n or \r\n is acceptable as end-of-line character.
If enabled import and execfile will automatically accept any newline
in files. Python code can open a file with open(file, 'U') to
read it in universal newline mode. THIS OPTION IS UNSUPPORTED.
--with-tsc: Profile using the Pentium timestamping counter (TSC).
--with-system-ffi: Build the _ctypes extension module using an ffi
library installed on the system.
--with-dbmliborder=db1:db2:...: Specify the order that backends for the
dbm extension are checked. Valid value is a colon separated string
with the backend names `ndbm', `gdbm' and `bdb'.
Building for multiple architectures (using the VPATH feature)
-------------------------------------------------------------
If your file system is shared between multiple architectures, it
usually is not necessary to make copies of the sources for each
architecture you want to support. If the make program supports the
VPATH feature, you can create an empty build directory for each
architecture, and in each directory run the configure script (on the
appropriate machine with the appropriate options). This creates the
necessary subdirectories and the Makefiles therein. The Makefiles
contain a line VPATH=... which points to a directory containing the
actual sources. (On SGI systems, use "smake -J1" instead of "make" if
you use VPATH -- don't try gnumake.)
For example, the following is all you need to build a minimal Python
in /usr/tmp/python (assuming ~guido/src/python is the toplevel
directory and you want to build in /usr/tmp/python):
$ mkdir /usr/tmp/python
$ cd /usr/tmp/python
$ ~guido/src/python/configure
[...]
$ make
[...]
$
Note that configure copies the original Setup file to the build
directory if it finds no Setup file there. This means that you can
edit the Setup file for each architecture independently. For this
reason, subsequent changes to the original Setup file are not tracked
automatically, as they might overwrite local changes. To force a copy
of a changed original Setup file, delete the target Setup file. (The
makesetup script supports multiple input files, so if you want to be
fancy you can change the rules to create an empty Setup.local if it
doesn't exist and run it with arguments $(srcdir)/Setup Setup.local;
however this assumes that you only need to add modules.)
Also note that you can't use a workspace for VPATH and non VPATH builds. The
object files left behind by one version confuses the other.
Building on non-UNIX systems
----------------------------
For Windows (2000/NT/ME/98/95), assuming you have MS VC++ 7.1, the
project files are in PCbuild, the workspace is pcbuild.dsw. See
PCbuild\readme.txt for detailed instructions.
For other non-Unix Windows compilers, in particular MS VC++ 6.0 and
for OS/2, enter the directory "PC" and read the file "readme.txt".
For the Mac, a separate source distribution will be made available,
for use with the CodeWarrior compiler. If you are interested in Mac
development, join the PythonMac Special Interest Group
(http://www.python.org/sigs/pythonmac-sig/, or send email to
pythonmac-sig-request@python.org).
Of course, there are also binary distributions available for these
platforms -- see http://www.python.org/.
To port Python to a new non-UNIX system, you will have to fake the
effect of running the configure script manually (for Mac and PC, this
has already been done for you). A good start is to copy the file
pyconfig.h.in to pyconfig.h and edit the latter to reflect the actual
configuration of your system. Most symbols must simply be defined as
1 only if the corresponding feature is present and can be left alone
otherwise; however the *_t type symbols must be defined as some
variant of int if they need to be defined at all.
For all platforms, it's important that the build arrange to define the
preprocessor symbol NDEBUG on the compiler command line in a release
build of Python (else assert() calls remain in the code, hurting
release-build performance). The Unix, Windows and Mac builds already
do this.
Miscellaneous issues
====================
Emacs mode
----------
There's an excellent Emacs editing mode for Python code; see the file
Misc/python-mode.el. Originally written by the famous Tim Peters, it is now
maintained by the equally famous Barry Warsaw. The latest version, along with
various other contributed Python-related Emacs goodies, is online at
http://launchpad.net/python-mode/.
Tkinter
-------
The setup.py script automatically configures this when it detects a
usable Tcl/Tk installation. This requires Tcl/Tk version 8.0 or
higher.
For more Tkinter information, see the Tkinter Resource page:
http://www.python.org/topics/tkinter/
There are demos in the Demo/tkinter directory.
Note that there's a Python module called "Tkinter" (capital T) which
lives in Lib/lib-tk/Tkinter.py, and a C module called "_tkinter"
(lower case t and leading underscore) which lives in
Modules/_tkinter.c. Demos and normal Tk applications import only the
Python Tkinter module -- only the latter imports the C _tkinter
module. In order to find the C _tkinter module, it must be compiled
and linked into the Python interpreter -- the setup.py script does
this. In order to find the Python Tkinter module, sys.path must be
set correctly -- normal installation takes care of this.
Distribution structure
----------------------
Most subdirectories have their own README files. Most files have
comments.
Demo/ Demonstration scripts, modules and programs
Doc/ Documentation sources (reStructuredText)
Grammar/ Input for the parser generator
Include/ Public header files
LICENSE Licensing information
Lib/ Python library modules
Mac/ Macintosh specific resources
Makefile.pre.in Source from which config.status creates the Makefile.pre
Misc/ Miscellaneous useful files
Modules/ Implementation of most built-in modules
Objects/ Implementation of most built-in object types
PC/ Files specific to PC ports (DOS, Windows, OS/2)
PCbuild/ Build directory for Microsoft Visual C++
Parser/ The parser and tokenizer and their input handling
Python/ The byte-compiler and interpreter
README The file you're reading now
RISCOS/ Files specific to RISC OS port
Tools/ Some useful programs written in Python
pyconfig.h.in Source from which pyconfig.h is created (GNU autoheader output)
configure Configuration shell script (GNU autoconf output)
configure.ac Configuration specification (input for GNU autoconf)
install-sh Shell script used to install files
setup.py Python script used to build extension modules
The following files will (may) be created in the toplevel directory by
the configuration and build processes:
Makefile Build rules
Makefile.pre Build rules before running Modules/makesetup
buildno Keeps track of the build number
config.cache Cache of configuration variables
pyconfig.h Configuration header
config.log Log from last configure run
config.status Status from last run of the configure script
getbuildinfo.o Object file from Modules/getbuildinfo.c
libpython<version>.a The library archive
python The executable interpreter
reflog.txt Output from running the regression suite with the -R flag
tags, TAGS Tags files for vi and Emacs
That's all, folks!
------------------
--Guido van Rossum (home page: http://www.python.org/~guido/)
licenses/alt-python27/LICENSE 0000644 00000030747 15173017741 0011647 0 ustar 00 A. HISTORY OF THE SOFTWARE
==========================
Python was created in the early 1990s by Guido van Rossum at Stichting
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
as a successor of a language called ABC. Guido remains Python's
principal author, although it includes many contributions from others.
In 1995, Guido continued his work on Python at the Corporation for
National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
in Reston, Virginia where he released several versions of the
software.
In May 2000, Guido and the Python core development team moved to
BeOpen.com to form the BeOpen PythonLabs team. In October of the same
year, the PythonLabs team moved to Digital Creations, which became
Zope Corporation. In 2001, the Python Software Foundation (PSF, see
https://www.python.org/psf/) was formed, a non-profit organization
created specifically to own Python-related Intellectual Property.
Zope Corporation was a sponsoring member of the PSF.
All Python releases are Open Source (see http://www.opensource.org for
the Open Source Definition). Historically, most, but not all, Python
releases have also been GPL-compatible; the table below summarizes
the various releases.
Release Derived Year Owner GPL-
from compatible? (1)
0.9.0 thru 1.2 1991-1995 CWI yes
1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
1.6 1.5.2 2000 CNRI no
2.0 1.6 2000 BeOpen.com no
1.6.1 1.6 2001 CNRI yes (2)
2.1 2.0+1.6.1 2001 PSF no
2.0.1 2.0+1.6.1 2001 PSF yes
2.1.1 2.1+2.0.1 2001 PSF yes
2.1.2 2.1.1 2002 PSF yes
2.1.3 2.1.2 2002 PSF yes
2.2 and above 2.1.1 2001-now PSF yes
Footnotes:
(1) GPL-compatible doesn't mean that we're distributing Python under
the GPL. All Python licenses, unlike the GPL, let you distribute
a modified version without making your changes open source. The
GPL-compatible licenses make it possible to combine Python with
other software that is released under the GPL; the others don't.
(2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
because its license has a choice of law clause. According to
CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
is "not incompatible" with the GPL.
Thanks to the many outside volunteers who have worked under Guido's
direction to make these releases possible.
B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
===============================================================
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.
2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation;
All Rights Reserved" are retained in Python alone or in any derivative version
prepared by Licensee.
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.
4. PSF is making Python available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.
8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
-------------------------------------------
BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
Individual or Organization ("Licensee") accessing and otherwise using
this software in source or binary form and its associated
documentation ("the Software").
2. Subject to the terms and conditions of this BeOpen Python License
Agreement, BeOpen hereby grants Licensee a non-exclusive,
royalty-free, world-wide license to reproduce, analyze, test, perform
and/or display publicly, prepare derivative works, distribute, and
otherwise use the Software alone or in any derivative version,
provided, however, that the BeOpen Python License is retained in the
Software, alone or in any derivative version prepared by Licensee.
3. BeOpen is making the Software available to Licensee on an "AS IS"
basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
5. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
6. This License Agreement shall be governed by and interpreted in all
respects by the law of the State of California, excluding conflict of
law provisions. Nothing in this License Agreement shall be deemed to
create any relationship of agency, partnership, or joint venture
between BeOpen and Licensee. This License Agreement does not grant
permission to use BeOpen trademarks or trade names in a trademark
sense to endorse or promote products or services of Licensee, or any
third party. As an exception, the "BeOpen Python" logos available at
http://www.pythonlabs.com/logos.html may be used according to the
permissions granted on that web page.
7. By copying, installing or otherwise using the software, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
---------------------------------------
1. This LICENSE AGREEMENT is between the Corporation for National
Research Initiatives, having an office at 1895 Preston White Drive,
Reston, VA 20191 ("CNRI"), and the Individual or Organization
("Licensee") accessing and otherwise using Python 1.6.1 software in
source or binary form and its associated documentation.
2. Subject to the terms and conditions of this License Agreement, CNRI
hereby grants Licensee a nonexclusive, royalty-free, world-wide
license to reproduce, analyze, test, perform and/or display publicly,
prepare derivative works, distribute, and otherwise use Python 1.6.1
alone or in any derivative version, provided, however, that CNRI's
License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
1995-2001 Corporation for National Research Initiatives; All Rights
Reserved" are retained in Python 1.6.1 alone or in any derivative
version prepared by Licensee. Alternately, in lieu of CNRI's License
Agreement, Licensee may substitute the following text (omitting the
quotes): "Python 1.6.1 is made available subject to the terms and
conditions in CNRI's License Agreement. This Agreement together with
Python 1.6.1 may be located on the Internet using the following
unique, persistent identifier (known as a handle): 1895.22/1013. This
Agreement may also be obtained from a proxy server on the Internet
using the following URL: http://hdl.handle.net/1895.22/1013".
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python 1.6.1 or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python 1.6.1.
4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. This License Agreement shall be governed by the federal
intellectual property law of the United States, including without
limitation the federal copyright law, and, to the extent such
U.S. federal law does not apply, by the law of the Commonwealth of
Virginia, excluding Virginia's conflict of law provisions.
Notwithstanding the foregoing, with regard to derivative works based
on Python 1.6.1 that incorporate non-separable material that was
previously distributed under the GNU General Public License (GPL), the
law of the Commonwealth of Virginia shall govern this License
Agreement only as to issues arising under or with respect to
Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
License Agreement shall be deemed to create any relationship of
agency, partnership, or joint venture between CNRI and Licensee. This
License Agreement does not grant permission to use CNRI trademarks or
trade name in a trademark sense to endorse or promote products or
services of Licensee, or any third party.
8. By clicking on the "ACCEPT" button where indicated, or by copying,
installing or otherwise using Python 1.6.1, Licensee agrees to be
bound by the terms and conditions of this License Agreement.
ACCEPT
CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
--------------------------------------------------
Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
The Netherlands. All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission.
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
licenses/alt-python27-pip/LICENSE.txt 0000644 00000002102 15173017742 0013234 0 ustar 00 Copyright (c) 2008-2019 The pip developers (see AUTHORS.txt file)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
licenses/alt-python27-libs/LICENSE 0000644 00000030747 15173017742 0012577 0 ustar 00 A. HISTORY OF THE SOFTWARE
==========================
Python was created in the early 1990s by Guido van Rossum at Stichting
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
as a successor of a language called ABC. Guido remains Python's
principal author, although it includes many contributions from others.
In 1995, Guido continued his work on Python at the Corporation for
National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
in Reston, Virginia where he released several versions of the
software.
In May 2000, Guido and the Python core development team moved to
BeOpen.com to form the BeOpen PythonLabs team. In October of the same
year, the PythonLabs team moved to Digital Creations, which became
Zope Corporation. In 2001, the Python Software Foundation (PSF, see
https://www.python.org/psf/) was formed, a non-profit organization
created specifically to own Python-related Intellectual Property.
Zope Corporation was a sponsoring member of the PSF.
All Python releases are Open Source (see http://www.opensource.org for
the Open Source Definition). Historically, most, but not all, Python
releases have also been GPL-compatible; the table below summarizes
the various releases.
Release Derived Year Owner GPL-
from compatible? (1)
0.9.0 thru 1.2 1991-1995 CWI yes
1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
1.6 1.5.2 2000 CNRI no
2.0 1.6 2000 BeOpen.com no
1.6.1 1.6 2001 CNRI yes (2)
2.1 2.0+1.6.1 2001 PSF no
2.0.1 2.0+1.6.1 2001 PSF yes
2.1.1 2.1+2.0.1 2001 PSF yes
2.1.2 2.1.1 2002 PSF yes
2.1.3 2.1.2 2002 PSF yes
2.2 and above 2.1.1 2001-now PSF yes
Footnotes:
(1) GPL-compatible doesn't mean that we're distributing Python under
the GPL. All Python licenses, unlike the GPL, let you distribute
a modified version without making your changes open source. The
GPL-compatible licenses make it possible to combine Python with
other software that is released under the GPL; the others don't.
(2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
because its license has a choice of law clause. According to
CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
is "not incompatible" with the GPL.
Thanks to the many outside volunteers who have worked under Guido's
direction to make these releases possible.
B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
===============================================================
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.
2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation;
All Rights Reserved" are retained in Python alone or in any derivative version
prepared by Licensee.
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.
4. PSF is making Python available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.
8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
-------------------------------------------
BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
Individual or Organization ("Licensee") accessing and otherwise using
this software in source or binary form and its associated
documentation ("the Software").
2. Subject to the terms and conditions of this BeOpen Python License
Agreement, BeOpen hereby grants Licensee a non-exclusive,
royalty-free, world-wide license to reproduce, analyze, test, perform
and/or display publicly, prepare derivative works, distribute, and
otherwise use the Software alone or in any derivative version,
provided, however, that the BeOpen Python License is retained in the
Software, alone or in any derivative version prepared by Licensee.
3. BeOpen is making the Software available to Licensee on an "AS IS"
basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
5. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
6. This License Agreement shall be governed by and interpreted in all
respects by the law of the State of California, excluding conflict of
law provisions. Nothing in this License Agreement shall be deemed to
create any relationship of agency, partnership, or joint venture
between BeOpen and Licensee. This License Agreement does not grant
permission to use BeOpen trademarks or trade names in a trademark
sense to endorse or promote products or services of Licensee, or any
third party. As an exception, the "BeOpen Python" logos available at
http://www.pythonlabs.com/logos.html may be used according to the
permissions granted on that web page.
7. By copying, installing or otherwise using the software, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
---------------------------------------
1. This LICENSE AGREEMENT is between the Corporation for National
Research Initiatives, having an office at 1895 Preston White Drive,
Reston, VA 20191 ("CNRI"), and the Individual or Organization
("Licensee") accessing and otherwise using Python 1.6.1 software in
source or binary form and its associated documentation.
2. Subject to the terms and conditions of this License Agreement, CNRI
hereby grants Licensee a nonexclusive, royalty-free, world-wide
license to reproduce, analyze, test, perform and/or display publicly,
prepare derivative works, distribute, and otherwise use Python 1.6.1
alone or in any derivative version, provided, however, that CNRI's
License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
1995-2001 Corporation for National Research Initiatives; All Rights
Reserved" are retained in Python 1.6.1 alone or in any derivative
version prepared by Licensee. Alternately, in lieu of CNRI's License
Agreement, Licensee may substitute the following text (omitting the
quotes): "Python 1.6.1 is made available subject to the terms and
conditions in CNRI's License Agreement. This Agreement together with
Python 1.6.1 may be located on the Internet using the following
unique, persistent identifier (known as a handle): 1895.22/1013. This
Agreement may also be obtained from a proxy server on the Internet
using the following URL: http://hdl.handle.net/1895.22/1013".
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python 1.6.1 or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python 1.6.1.
4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. This License Agreement shall be governed by the federal
intellectual property law of the United States, including without
limitation the federal copyright law, and, to the extent such
U.S. federal law does not apply, by the law of the Commonwealth of
Virginia, excluding Virginia's conflict of law provisions.
Notwithstanding the foregoing, with regard to derivative works based
on Python 1.6.1 that incorporate non-separable material that was
previously distributed under the GNU General Public License (GPL), the
law of the Commonwealth of Virginia shall govern this License
Agreement only as to issues arising under or with respect to
Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
License Agreement shall be deemed to create any relationship of
agency, partnership, or joint venture between CNRI and Licensee. This
License Agreement does not grant permission to use CNRI trademarks or
trade name in a trademark sense to endorse or promote products or
services of Licensee, or any third party.
8. By clicking on the "ACCEPT" button where indicated, or by copying,
installing or otherwise using Python 1.6.1, Licensee agrees to be
bound by the terms and conditions of this License Agreement.
ACCEPT
CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
--------------------------------------------------
Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
The Netherlands. All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission.
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
bash-completion/completions/pip2 0000644 00000000444 15173017742 0012772 0 ustar 00
# pip bash completion start
_pip2_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \
COMP_CWORD=$COMP_CWORD \
PIP_AUTO_COMPLETE=1 $1 2>/dev/null ) )
}
complete -o default -F _pip2_completion pip pip{,-}{2,2.7}}
# pip bash completion end
man/man1/xml2-config.1 0000644 00000002351 15173033512 0010363 0 ustar 00 .TH xml2-config 1 "3 April 2022" Version 1.2.0
.SH NAME
xml2-config - script to get information about the installed version of libxml2
.SH SYNOPSIS
.B xml2-config
[\-\-prefix\fI[=DIR]\fP] [\-\-libs] [\-\-cflags] [\-\-version] [\-\-help]
.SH DESCRIPTION
\fIxml2-config\fP is a tool that is used to determine the compile and
linker flags that should be used to compile and link programs that use
\fIlibxml2\fP.
.SH OPTIONS
\fIxml2-config\fP accepts the following options:
.TP 8
.B \-\-version
Print the currently installed version of \fIlibxml2\fP on the standard output.
.TP 8
.B \-\-libs
Print the linker flags that are necessary to link a \fIlibxml2\fP program.
Add \-\-dynamic after \-\-libs to print only shared library linking
information.
.TP 8
.B \-\-cflags
Print the compiler flags that are necessary to compile a \fIlibxml2\fP program.
.TP 8
.B \-\-prefix=PREFIX
If specified, use PREFIX instead of the installation prefix that
\fIlibxml2\fP was built with when computing the output for the
\-\-cflags and \-\-libs options. This option must be specified before
any \-\-libs or \-\-cflags options.
.SH AUTHOR
This manual page was written by Fredrik Hallenberg <hallon@lysator.liu.se>,
for the Debian GNU/linux system (but may be used by others).
man/man1/xmlcatalog.1 0000644 00000020521 15173033512 0010370 0 ustar 00 '\" t
.\" Title: xmlcatalog
.\" Author: John Fleck <jfleck@inkstain.net>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 08/17/2022
.\" Manual: xmlcatalog Manual
.\" Source: libxml2
.\" Language: English
.\"
.TH "XMLCATALOG" "1" "08/17/2022" "libxml2" "xmlcatalog Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
xmlcatalog \- Command line tool to parse and manipulate XML or SGML catalog files\&.
.SH "SYNOPSIS"
.HP \w'\fBxmlcatalog\fR\ 'u
\fBxmlcatalog\fR [\fB\-\-sgml\fR | \fB\-\-shell\fR | \fB\-\-create\fR | \fB\-\-del\ \fR\fB\fIVALUE(S)\fR\fR | [\ \fB\-\-add\ \fR\fB\fITYPE\fR\fR\fB\ \fR\fB\fIORIG\fR\fR\fB\ \fR\fB\fIREPLACE\fR\fR\fB\ \fR\ |\ \fB\-\-add\ \fR\fB\fIFILENAME\fR\fR] | \fB\-\-noout\fR | \fB\-\-no\-super\-update\fR | [\fB\-v\fR\ |\ \fB\-\-verbose\fR]] {\fICATALOGFILE\fR} {\fIENTITIES\fR...}
.SH "DESCRIPTION"
.PP
\fBxmlcatalog\fR
is a command line application allowing users to monitor and manipulate
XML
and
SGML
catalogs\&. It is included in
\fBlibxml\fR(3)\&.
.PP
Its functions can be invoked from a single command from the command line, or it can perform multiple functions in interactive mode\&. It can operate on both
XML
and
SGML
files\&.
.SH "OPTIONS"
.PP
\fBxmlcatalog\fR
accepts the following options (in alphabetical order):
.PP
\fB\-\-add \fR\fB\fITYPE\fR\fR\fB \fR\fB\fIORIG\fR\fR\fB \fR\fB\fIREPLACE\fR\fR\fB \fR
.RS 4
Add an entry to
CATALOGFILE\&.
\fITYPE\fR
indicates the type of entry\&. Possible types are:
\fIpublic\fR, \fIsystem\fR, \fIuri\fR, \fIrewriteSystem\fR, \fIrewriteURI\fR, \fIdelegatePublic\fR, \fIdelegateSystem\fR, \fIdelegateURI\fR, \fInextCatalog\fR\&.
\fIORIG\fR
is the original reference to be replaced, and
\fIREPLACE\fR
is the
URI
of the replacement entity to be used\&. The
\fB\-\-add\fR
option will not overwrite
CATALOGFILE, outputting to
stdout, unless
\fB\-\-noout\fR
is used\&. The
\fB\-\-add\fR
will always take three parameters even if some of the
XML
catalog constructs will have only a single argument\&.
.RE
.PP
\fB\-\-add \fR\fB\fIFILENAME\fR\fR
.RS 4
If the
\fB\-\-add\fR
option is used following the
\fB\-\-sgml\fR
option, only a single argument, a
\fIFILENAME\fR, is used\&. This is used to add the name of a catalog file to an
SGML
supercatalog, a file that contains references to other included
SGML
catalog files\&.
.RE
.PP
\fB\-\-create\fR
.RS 4
Create a new
XML
catalog\&. Outputs to
stdout, ignoring
\fIfilename\fR
unless
\fB\-\-noout\fR
is used, in which case it creates a new catalog file
\fIfilename\fR\&.
.RE
.PP
\fB\-\-del \fR\fB\fIVALUE(S)\fR\fR
.RS 4
Remove entries from
\fICATALOGFILE\fR
matching
\fIVALUE(S)\fR\&. The
\fB\-\-del\fR
option will not overwrite
\fICATALOGFILE\fR, outputting to
stdout, unless
\fB\-\-noout\fR
is used\&.
.RE
.PP
\fB\-\-noout\fR
.RS 4
Save output to the named file rather than outputting to
stdout\&.
.RE
.PP
\fB\-\-no\-super\-update\fR
.RS 4
Do not update the
SGML
super catalog\&.
.RE
.PP
\fB\-\-shell\fR
.RS 4
Run a shell allowing interactive queries on catalog file
\fICATALOGFILE\fR\&. For the set of available commands see
the section called \(lqSHELL COMMANDS\(rq\&.
.RE
.PP
\fB\-\-sgml\fR
.RS 4
Uses
SGML
super catalogs for
\fB\-\-add\fR
and
\fB\-\-del\fR
options\&.
.RE
.PP
\fB\-v\fR, \fB\-\-verbose\fR
.RS 4
Output debugging information\&.
.RE
.PP
Invoking
\fBxmlcatalog\fR
non\-interactively without a designated action (imposed with options like
\fB\-\-add\fR) will result in a lookup of the catalog entry for
\fIENTITIES\fR
in the catalog denoted with
\fICATALOGFILE\fR\&. The corresponding entries will be output to the command line\&. This mode of operation, together with
\fB\-\-shell\fR
mode and non\-modifying (i\&.e\&. without
\fB\-\-noout\fR) direct actions, allows for a special shortcut of the void
\fICATALOGFILE\fR
specification (possibly expressed as "" in the shell environment) appointing the default system catalog\&. That simplifies the handling when its exact location is irrelevant but the respective built\-in still needs to be consulted\&.
.SH "SHELL COMMANDS"
.PP
Invoking
\fBxmlcatalog\fR
with the
\fB\-\-shell \fR\fB\fICATALOGFILE\fR\fR
option opens a command line shell allowing interactive access to the catalog file identified by
\fICATALOGFILE\fR\&. Invoking the shell provides a command line prompt after which the following commands (described in alphabetical order) can be entered\&.
.PP
\fBadd \fR\fB\fITYPE\fR\fR\fB \fR\fB\fIORIG\fR\fR\fB \fR\fB\fIREPLACE\fR\fR\fB \fR
.RS 4
Add an entry to the catalog file\&.
\fITYPE\fR
indicates the type of entry\&. Possible types are:
\fIpublic\fR, \fIsystem\fR, \fIuri\fR, \fIrewriteSystem\fR, \fIrewriteURI\fR, \fIdelegatePublic\fR, \fIdelegateSystem\fR, \fIdelegateURI\fR, \fInextCatalog\fR\&.
\fIORIG\fR
is the original reference to be replaced, and
\fIREPLACE\fR
is the
URI
of the replacement entity to be used\&. The
\fB\-\-add\fR
option will not overwrite
CATALOGFILE, outputting to
stdout, unless
\fB\-\-noout\fR
is used\&. The
\fB\-\-add\fR
will always take three parameters even if some of the
XML
catalog constructs will have only a single argument\&.
.RE
.PP
\fBdebug\fR
.RS 4
Print debugging statements showing the steps
\fBxmlcatalog\fR
is executing\&.
.RE
.PP
\fBdel \fR\fB\fIVALUE(S)\fR\fR
.RS 4
Remove the catalog entry corresponding to
\fIVALUE(S)\fR\&.
.RE
.PP
\fBdump\fR
.RS 4
Print the current catalog\&.
.RE
.PP
\fBexit\fR
.RS 4
Quit the shell\&.
.RE
.PP
\fBpublic \fR\fB\fIPUBLIC\-ID\fR\fR
.RS 4
Execute a Formal Public Identifier lookup of the catalog entry for
\fIPUBLIC\-ID\fR\&. The corresponding entry will be output to the command line\&.
.RE
.PP
\fBquiet\fR
.RS 4
Stop printing debugging statements\&.
.RE
.PP
\fBsystem \fR\fB\fISYSTEM\-ID\fR\fR
.RS 4
Execute a Formal Public Identifier lookup of the catalog entry for
\fISYSTEM\-ID\fR\&. The corresponding entry will be output to the command line\&.
.RE
.SH "ENVIRONMENT"
.PP
\fBXML_CATALOG_FILES\fR
.RS 4
XML
catalog behavior can be changed by redirecting queries to the user\*(Aqs own set of catalogs\&. This can be done by setting the
\fBXML_CATALOG_FILES\fR
environment variable to a space\-separated list of catalogs\&. Use percent\-encoding to escape spaces or other characters\&. An empty variable should deactivate loading the default
/etc/xml/catalog
catalog\&.
.RE
.SH "DIAGNOSTICS"
.PP
\fBxmlcatalog\fR
return codes provide information that can be used when calling it from scripts\&.
.PP
\fB0\fR
.RS 4
No error
.RE
.PP
\fB1\fR
.RS 4
Failed to remove an entry from the catalog
.RE
.PP
\fB2\fR
.RS 4
Failed to save to the catalog, check file permissions
.RE
.PP
\fB3\fR
.RS 4
Failed to add an entry to the catalog
.RE
.PP
\fB4\fR
.RS 4
Failed to look up an entry in the catalog
.RE
.SH "SEE ALSO"
.PP
\fBlibxml\fR(3)
.PP
More information can be found at
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBlibxml\fR(3)
web page
\m[blue]\fB\%https://gitlab.gnome.org/GNOME/libxml2\fR\m[]
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBlibxml\fR(3)
catalog support web page at
\m[blue]\fB\%https://gitlab.gnome.org/GNOME/libxml2/-/wikis/Catalog-support\fR\m[]
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
James Clark\*(Aqs
SGML
catalog page
\m[blue]\fB\%http://www.jclark.com/sp/catalog.htm\fR\m[]
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
OASIS
XML
catalog specification
\m[blue]\fB\%http://www.oasis-open.org/committees/entity/spec.html\fR\m[]
.RE
.sp
.SH "AUTHOR"
.PP
\fBJohn Fleck\fR <\&jfleck@inkstain\&.net\&>
.RS 4
Author.
.RE
.SH "COPYRIGHT"
.br
Copyright \(co 2001, 2004
.br
man/man1/xmllint.1 0000644 00000032246 15173033512 0007733 0 ustar 00 '\" t
.\" Title: xmllint
.\" Author: John Fleck <jfleck@inkstain.net>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 08/17/2022
.\" Manual: xmllint Manual
.\" Source: libxml2
.\" Language: English
.\"
.TH "XMLLINT" "1" "08/17/2022" "libxml2" "xmllint Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
xmllint \- command line XML tool
.SH "SYNOPSIS"
.HP \w'\fBxmllint\fR\ 'u
\fBxmllint\fR [\fB\-\-version\fR | \fB\-\-debug\fR | \fB\-\-shell\fR | \fB\-\-xpath\ "\fR\fB\fIXPath_expression\fR\fR\fB"\fR | \fB\-\-debugent\fR | \fB\-\-copy\fR | \fB\-\-recover\fR | \fB\-\-noent\fR | \fB\-\-noout\fR | \fB\-\-nonet\fR | \fB\-\-path\ "\fR\fB\fIPATH(S)\fR\fR\fB"\fR | \fB\-\-load\-trace\fR | \fB\-\-htmlout\fR | \fB\-\-nowrap\fR | \fB\-\-valid\fR | \fB\-\-postvalid\fR | \fB\-\-dtdvalid\ \fR\fB\fIURL\fR\fR | \fB\-\-dtdvalidfpi\ \fR\fB\fIFPI\fR\fR | \fB\-\-timing\fR | \fB\-\-output\ \fR\fB\fIFILE\fR\fR | \fB\-\-repeat\fR | \fB\-\-insert\fR | \fB\-\-compress\fR | \fB\-\-html\fR | \fB\-\-xmlout\fR | \fB\-\-push\fR | \fB\-\-memory\fR | \fB\-\-maxmem\ \fR\fB\fINBBYTES\fR\fR | \fB\-\-nowarning\fR | \fB\-\-noblanks\fR | \fB\-\-nocdata\fR | \fB\-\-format\fR | \fB\-\-encode\ \fR\fB\fIENCODING\fR\fR | \fB\-\-dropdtd\fR | \fB\-\-nsclean\fR | \fB\-\-testIO\fR | \fB\-\-catalogs\fR | \fB\-\-nocatalogs\fR | \fB\-\-auto\fR | \fB\-\-xinclude\fR | \fB\-\-noxincludenode\fR | \fB\-\-loaddtd\fR | \fB\-\-dtdattr\fR | \fB\-\-stream\fR | \fB\-\-walker\fR | \fB\-\-pattern\ \fR\fB\fIPATTERNVALUE\fR\fR | \fB\-\-chkregister\fR | \fB\-\-relaxng\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-schema\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-c14n\fR] {\fIXML\-FILE(S)\fR... | \-}
.HP \w'\fBxmllint\fR\ 'u
\fBxmllint\fR \fB\-\-help\fR
.SH "DESCRIPTION"
.PP
The
\fBxmllint\fR
program parses one or more
XML
files, specified on the command line as
\fIXML\-FILE\fR
(or the standard input if the filename provided is
\fB\-\fR
)\&. It prints various types of output, depending upon the options selected\&. It is useful for detecting errors both in
XML
code and in the
XML
parser itself\&.
.PP
\fBxmllint\fR
is included in
\fBlibxml\fR(3)\&.
.SH "OPTIONS"
.PP
\fBxmllint\fR
accepts the following options (in alphabetical order):
.PP
\fB\-\-auto\fR
.RS 4
Generate a small document for testing purposes\&.
.RE
.PP
\fB\-\-catalogs\fR
.RS 4
Use the
SGML
catalog(s) from
\fBSGML_CATALOG_FILES\fR\&. Otherwise
XML
catalogs starting from
/etc/xml/catalog
are used by default\&.
.RE
.PP
\fB\-\-chkregister\fR
.RS 4
Turn on node registration\&. Useful for developers testing
\fBlibxml\fR(3)
node tracking code\&.
.RE
.PP
\fB\-\-compress\fR
.RS 4
Turn on
\fBgzip\fR(1)
compression of output\&.
.RE
.PP
\fB\-\-copy\fR
.RS 4
Test the internal copy implementation\&.
.RE
.PP
\fB\-\-c14n\fR
.RS 4
Use the W3C
XML
Canonicalisation (C14N) to serialize the result of parsing to
stdout\&. It keeps comments in the result\&.
.RE
.PP
\fB\-\-dtdvalid \fR\fB\fIURL\fR\fR
.RS 4
Use the
DTD
specified by an
\fIURL\fR
for validation\&.
.RE
.PP
\fB\-\-dtdvalidfpi \fR\fB\fIFPI\fR\fR
.RS 4
Use the
DTD
specified by a Formal Public Identifier
\fIFPI\fR
for validation, note that this will require a catalog exporting that Formal Public Identifier to work\&.
.RE
.PP
\fB\-\-debug\fR
.RS 4
Parse a file and output an annotated tree of the in\-memory version of the document\&.
.RE
.PP
\fB\-\-debugent\fR
.RS 4
Debug the entities defined in the document\&.
.RE
.PP
\fB\-\-dropdtd\fR
.RS 4
Remove
DTD
from output\&.
.RE
.PP
\fB\-\-dtdattr\fR
.RS 4
Fetch external
DTD
and populate the tree with inherited attributes\&.
.RE
.PP
\fB\-\-encode \fR\fB\fIENCODING\fR\fR
.RS 4
Output in the given encoding\&. Note that this works for full document not fragments or result from XPath queries\&.
.RE
.PP
\fB\-\-format\fR
.RS 4
Reformat and reindent the output\&. The
\fBXMLLINT_INDENT\fR
environment variable controls the indentation\&. The default value is two spaces " ")\&.
.RE
.PP
\fB\-\-help\fR
.RS 4
Print out a short usage summary for
\fBxmllint\fR\&.
.RE
.PP
\fB\-\-html\fR
.RS 4
Use the
HTML
parser\&.
.RE
.PP
\fB\-\-htmlout\fR
.RS 4
Output results as an
HTML
file\&. This causes
\fBxmllint\fR
to output the necessary
HTML
tags surrounding the result tree output so the results can be displayed/viewed in a browser\&.
.RE
.PP
\fB\-\-insert\fR
.RS 4
Test for valid insertions\&.
.RE
.PP
\fB\-\-loaddtd\fR
.RS 4
Fetch an external
DTD\&.
.RE
.PP
\fB\-\-load\-trace\fR
.RS 4
Display all the documents loaded during the processing to
stderr\&.
.RE
.PP
\fB\-\-maxmem \fR\fB\fINNBYTES\fR\fR
.RS 4
Test the parser memory support\&.
\fINNBYTES\fR
is the maximum number of bytes the library is allowed to allocate\&. This can also be used to make sure batch processing of
XML
files will not exhaust the virtual memory of the server running them\&.
.RE
.PP
\fB\-\-memory\fR
.RS 4
Parse from memory\&.
.RE
.PP
\fB\-\-noblanks\fR
.RS 4
Drop ignorable blank spaces\&.
.RE
.PP
\fB\-\-nocatalogs\fR
.RS 4
Do not use any catalogs\&.
.RE
.PP
\fB\-\-nocdata\fR
.RS 4
Substitute CDATA section by equivalent text nodes\&.
.RE
.PP
\fB\-\-noent\fR
.RS 4
Substitute entity values for entity references\&. By default,
\fBxmllint\fR
leaves entity references in place\&.
.RE
.PP
\fB\-\-nonet\fR
.RS 4
Do not use the Internet to fetch
DTDs or entities\&.
.RE
.PP
\fB\-\-noout\fR
.RS 4
Suppress output\&. By default,
\fBxmllint\fR
outputs the result tree\&.
.RE
.PP
\fB\-\-nowarning\fR
.RS 4
Do not emit warnings from the parser and/or validator\&.
.RE
.PP
\fB\-\-nowrap\fR
.RS 4
Do not output
HTML
doc wrapper\&.
.RE
.PP
\fB\-\-noxincludenode\fR
.RS 4
Do XInclude processing but do not generate XInclude start and end nodes\&.
.RE
.PP
\fB\-\-nsclean\fR
.RS 4
Remove redundant namespace declarations\&.
.RE
.PP
\fB\-\-output \fR\fB\fIFILE\fR\fR
.RS 4
Define a file path where
\fBxmllint\fR
will save the result of parsing\&. Usually the programs build a tree and save it on
stdout, with this option the result
XML
instance will be saved onto a file\&.
.RE
.PP
\fB\-\-path "\fR\fB\fIPATH(S)\fR\fR\fB"\fR
.RS 4
Use the (space\- or colon\-separated) list of filesystem paths specified by
\fIPATHS\fR
to load
DTDs or entities\&. Enclose space\-separated lists by quotation marks\&.
.RE
.PP
\fB\-\-pattern \fR\fB\fIPATTERNVALUE\fR\fR
.RS 4
Used to exercise the pattern recognition engine, which can be used with the reader interface to the parser\&. It allows to select some nodes in the document based on an XPath (subset) expression\&. Used for debugging\&.
.RE
.PP
\fB\-\-postvalid\fR
.RS 4
Validate after parsing has completed\&.
.RE
.PP
\fB\-\-push\fR
.RS 4
Use the push mode of the parser\&.
.RE
.PP
\fB\-\-recover\fR
.RS 4
Output any parsable portions of an invalid document\&.
.RE
.PP
\fB\-\-relaxng \fR\fB\fISCHEMA\fR\fR
.RS 4
Use RelaxNG file named
\fISCHEMA\fR
for validation\&.
.RE
.PP
\fB\-\-repeat\fR
.RS 4
Repeat 100 times, for timing or profiling\&.
.RE
.PP
\fB\-\-schema \fR\fB\fISCHEMA\fR\fR
.RS 4
Use a W3C
XML
Schema file named
\fISCHEMA\fR
for validation\&.
.RE
.PP
\fB\-\-shell\fR
.RS 4
Run a navigating shell\&. Details on available commands in shell mode are below (see
the section called \(lqSHELL COMMANDS\(rq)\&.
.RE
.PP
\fB\-\-xpath "\fR\fB\fIXPath_expression\fR\fR\fB"\fR
.RS 4
Run an XPath expression given as argument and print the result\&. In case of a nodeset result, each node in the node set is serialized in full in the output\&. In case of an empty node set the "XPath set is empty" result will be shown and an error exit code will be returned\&.
.RE
.PP
\fB\-\-stream\fR
.RS 4
Use streaming
API
\- useful when used in combination with
\fB\-\-relaxng\fR
or
\fB\-\-valid\fR
options for validation of files that are too large to be held in memory\&.
.RE
.PP
\fB\-\-testIO\fR
.RS 4
Test user input/output support\&.
.RE
.PP
\fB\-\-timing\fR
.RS 4
Output information about the time it takes
\fBxmllint\fR
to perform the various steps\&.
.RE
.PP
\fB\-\-valid\fR
.RS 4
Determine if the document is a valid instance of the included Document Type Definition (DTD)\&. A
DTD
to be validated against also can be specified at the command line using the
\fB\-\-dtdvalid\fR
option\&. By default,
\fBxmllint\fR
also checks to determine if the document is well\-formed\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Display the version of
\fBlibxml\fR(3)
used\&.
.RE
.PP
\fB\-\-walker\fR
.RS 4
Test the walker module, which is a reader interface but for a document tree, instead of using the reader
API
on an unparsed document it works on an existing in\-memory tree\&. Used for debugging\&.
.RE
.PP
\fB\-\-xinclude\fR
.RS 4
Do XInclude processing\&.
.RE
.PP
\fB\-\-xmlout\fR
.RS 4
Used in conjunction with
\fB\-\-html\fR\&. Usually when
HTML
is parsed the document is saved with the
HTML
serializer\&. But with this option the resulting document is saved with the
XML
serializer\&. This is primarily used to generate
XHTML
from
HTML
input\&.
.RE
.SH "SHELL COMMANDS"
.PP
\fBxmllint\fR
offers an interactive shell mode invoked with the
\fB\-\-shell\fR
command\&. Available commands in shell mode include (in alphabetical order):
.PP
\fBbase\fR
.RS 4
Display
XML
base of the node\&.
.RE
.PP
\fBbye\fR
.RS 4
Leave the shell\&.
.RE
.PP
\fBcat \fR\fB\fINODE\fR\fR
.RS 4
Display the given node or the current one\&.
.RE
.PP
\fBcd \fR\fB\fIPATH\fR\fR
.RS 4
Change the current node to the given path (if unique) or root if no argument is given\&.
.RE
.PP
\fBdir \fR\fB\fIPATH\fR\fR
.RS 4
Dumps information about the node (namespace, attributes, content)\&.
.RE
.PP
\fBdu \fR\fB\fIPATH\fR\fR
.RS 4
Show the structure of the subtree under the given path or the current node\&.
.RE
.PP
\fBexit\fR
.RS 4
Leave the shell\&.
.RE
.PP
\fBhelp\fR
.RS 4
Show this help\&.
.RE
.PP
\fBfree\fR
.RS 4
Display memory usage\&.
.RE
.PP
\fBload \fR\fB\fIFILENAME\fR\fR
.RS 4
Load a new document with the given filename\&.
.RE
.PP
\fBls \fR\fB\fIPATH\fR\fR
.RS 4
List contents of the given path or the current directory\&.
.RE
.PP
\fBpwd\fR
.RS 4
Display the path to the current node\&.
.RE
.PP
\fBquit\fR
.RS 4
Leave the shell\&.
.RE
.PP
\fBsave \fR\fB\fIFILENAME\fR\fR
.RS 4
Save the current document to the given filename or to the original name\&.
.RE
.PP
\fBvalidate\fR
.RS 4
Check the document for errors\&.
.RE
.PP
\fBwrite \fR\fB\fIFILENAME\fR\fR
.RS 4
Write the current node to the given filename\&.
.RE
.SH "ENVIRONMENT"
.PP
\fBSGML_CATALOG_FILES\fR
.RS 4
SGML
catalog behavior can be changed by redirecting queries to the user\*(Aqs own set of catalogs\&. This can be done by setting the
\fBSGML_CATALOG_FILES\fR
environment variable to a list of catalogs\&. An empty one should deactivate loading the default
/etc/sgml/catalog
catalog\&.
.RE
.PP
\fBXML_CATALOG_FILES\fR
.RS 4
XML
catalog behavior can be changed by redirecting queries to the user\*(Aqs own set of catalogs\&. This can be done by setting the
\fBXML_CATALOG_FILES\fR
environment variable to a space\-separated list of catalogs\&. Use percent\-encoding to escape spaces or other characters\&. An empty variable should deactivate loading the default
/etc/xml/catalog
catalog\&.
.RE
.PP
\fBXML_DEBUG_CATALOG\fR
.RS 4
Setting the environment variable
\fBXML_DEBUG_CATALOG\fR
to
\fInon\-zero\fR
using the
\fBexport\fR
command outputs debugging information related to catalog operations\&.
.RE
.PP
\fBXMLLINT_INDENT\fR
.RS 4
Setting the environment variable
\fBXMLLINT_INDENT\fR
controls the indentation\&. The default value is two spaces " "\&.
.RE
.SH "DIAGNOSTICS"
.PP
\fBxmllint\fR
return codes provide information that can be used when calling it from scripts\&.
.PP
\fB0\fR
.RS 4
No error
.RE
.PP
\fB1\fR
.RS 4
Unclassified
.RE
.PP
\fB2\fR
.RS 4
Error in
DTD
.RE
.PP
\fB3\fR
.RS 4
Validation error
.RE
.PP
\fB4\fR
.RS 4
Validation error
.RE
.PP
\fB5\fR
.RS 4
Error in schema compilation
.RE
.PP
\fB6\fR
.RS 4
Error writing output
.RE
.PP
\fB7\fR
.RS 4
Error in pattern (generated when
\fB\-\-pattern\fR
option is used)
.RE
.PP
\fB8\fR
.RS 4
Error in Reader registration (generated when
\fB\-\-chkregister\fR
option is used)
.RE
.PP
\fB9\fR
.RS 4
Out of memory error
.RE
.PP
\fB10\fR
.RS 4
XPath evaluation error
.RE
.SH "SEE ALSO"
.PP
\fBlibxml\fR(3)
.PP
More information can be found at
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBlibxml\fR(3)
web page
\m[blue]\fB\%https://gitlab.gnome.org/GNOME/libxml2\fR\m[]
.RE
.sp
.SH "AUTHORS"
.PP
\fBJohn Fleck\fR <\&jfleck@inkstain\&.net\&>
.RS 4
Author.
.RE
.PP
\fBZiying Sherwin\fR <\&sherwin@nlm\&.nih\&.gov\&>
.RS 4
Author.
.RE
.PP
\fBHeiko Rupp\fR <\&hwr@pilhuhn\&.de\&>
.RS 4
Author.
.RE
.SH "COPYRIGHT"
.br
Copyright \(co 2001, 2004
.br
doc/alt-libxml2/TODO 0000644 00000026134 15173033512 0010136 0 ustar 00 124907 HTML parse buffer problem when parsing larse in-memory docs
124110 DTD validation && wrong namespace
123564 xmllint --html --format
TODO for the XML parser and stuff:
==================================
this tend to be outdated :-\ ...
DOCS:
=====
- use case of using XInclude to load for example a description.
order document + product base -(XSLT)-> quote with XIncludes
|
HTML output with description of parts <---(XSLT)--
TODO:
=====
- XInclude at the SAX level (libSRVG)
- fix the C code prototype to bring back doc/libxml-undocumented.txt
to a reasonable level
- Computation of base when HTTP redirect occurs, might affect HTTP
interfaces.
- Computation of base in XInclude. Relativization of URIs.
- listing all attributes in a node.
- Better checking of external parsed entities TAG 1234
- Go through erratas and do the cleanup.
http://www.w3.org/XML/xml-19980210-errata ... started ...
- jamesh suggestion: SAX like functions to save a document ie. call a
function to open a new element with given attributes, write character
data, close last element, etc
+ inversted SAX, initial patch in April 2002 archives.
- htmlParseDoc has parameter encoding which is not used.
Function htmlCreateDocParserCtxt ignore it.
- fix realloc() usage.
- Stricten the UTF8 conformance (Martin Duerst):
http://www.w3.org/2001/06/utf-8-test/.
The bad files are in http://www.w3.org/2001/06/utf-8-wrong/.
- xml:id normalized value
TODO:
=====
- move all string manipulation functions (xmlStrdup, xmlStrlen, etc.) to
global.c. Bjorn noted that the following files depends on parser.o solely
because of these string functions: entities.o, global.o, hash.o, tree.o,
xmlIO.o, and xpath.o.
- Optimization of tag strings allocation ?
- maintain coherency of namespace when doing cut'n paste operations
=> the functions are coded, but need testing
- function to rebuild the ID table
- functions to rebuild the DTD hash tables (after DTD changes).
EXTENSIONS:
===========
- Tools to produce man pages from the SGML docs.
- Add Xpointer recognition/API
- Add Xlink recognition/API
=> started adding an xlink.[ch] with a unified API for XML and HTML.
it's crap :-(
- Implement XSchemas
=> Really need to be done <grin/>
- datatype are complete, but structure support is very limited.
- extend the shell with:
- edit
- load/save
- mv (yum, yum, but it's harder because directories are ordered in
our case, mvup and mvdown would be required)
Done:
=====
- Add HTML validation using the XHTML DTD
- problem: do we want to keep and maintain the code for handling
DTD/System ID cache directly in libxml ?
=> not really done that way, but there are new APIs to check elements
or attributes. Otherwise XHTML validation directly ...
- XML Schemas datatypes except Base64 and BinHex
- Relax NG validation
- XmlTextReader streaming API + validation
- Add a DTD cache prefilled with xhtml DTDs and entities and a program to
manage them -> like the /usr/bin/install-catalog from SGML
right place seems $datadir/xmldtds
Maybe this is better left to user apps
=> use a catalog instead , and xhtml1-dtd package
- Add output to XHTML
=> XML serializer automatically recognize the DTd and apply the specific
rules.
- Fix output of <tst val="x
y"/>
- compliance to XML-Namespace checking, see section 6 of
http://www.w3.org/TR/REC-xml-names/
- Correct standalone checking/emitting (hard)
2.9 Standalone Document Declaration
- Implement OASIS XML Catalog support
http://www.oasis-open.org/committees/entity/
- Get OASIS testsuite to a more friendly result, check all the results
once stable. the check-xml-test-suite.py script does this
- Implement XSLT
=> libxslt
- Finish XPath
=> attributes addressing troubles
=> defaulted attributes handling
=> namespace axis ?
done as XSLT got debugged
- bug reported by Michael Meallin on validation problems
=> Actually means I need to add support (and warn) for non-deterministic
content model.
- Handle undefined namespaces in entity contents better ... at least
issue a warning
- DOM needs
int xmlPruneProp(xmlNodePtr node, xmlAtttrPtr attr);
=> done it's actually xmlRemoveProp xmlUnsetProp xmlUnsetNsProp
- HTML: handling of Script and style data elements, need special code in
the parser and saving functions (handling of < > " ' ...):
http://www.w3.org/TR/html4/types.html#type-script
Attributes are no problems since entities are accepted.
- DOM needs
xmlAttrPtr xmlNewDocProp(xmlDocPtr doc, const xmlChar *name, const xmlChar *value)
- problem when parsing hrefs with & with the HTML parser (IRC ac)
- If the internal encoding is not UTF8 saving to a given encoding doesn't
work => fix to force UTF8 encoding ...
done, added documentation too
- Add an ASCII I/O encoder (asciiToUTF8 and UTF8Toascii)
- Issue warning when using non-absolute namespaces URI.
- the html parser should add <head> and <body> if they don't exist
started, not finished.
Done, the automatic closing is added and 3 testcases were inserted
- Command to force the parser to stop parsing and ignore the rest of the file.
xmlStopParser() should allow this, mostly untested
- support for HTML empty attributes like <hr noshade>
- plugged iconv() in for support of a large set of encodings.
- xmlSwitchToEncoding() rewrite done
- URI checkings (no fragments) rfc2396.txt
- Added a clean mechanism for overload or added input methods:
xmlRegisterInputCallbacks()
- dynamically adapt the alloc entry point to use g_alloc()/g_free()
if the programmer wants it:
- use xmlMemSetup() to reset the routines used.
- Check attribute normalization especially xmlGetProp()
- Validity checking problems for NOTATIONS attributes
- Validity checking problems for ENTITY ENTITIES attributes
- Parsing of a well balanced chunk xmlParseBalancedChunkMemory()
- URI module: validation, base, etc ... see uri.[ch]
- turn tester into a generic program xmllint installed with libxml
- extend validity checks to go through entities content instead of
just labelling them PCDATA
- Save Dtds using the children list instead of dumping the tables,
order is preserved as well as comments and PIs
- Wrote a notice of changes requires to go from 1.x to 2.x
- make sure that all SAX callbacks are disabled if a WF error is detected
- checking/handling of newline normalization
http://localhost/www.xml.com/axml/target.html#sec-line-ends
- correct checking of '&' '%' on entities content.
- checking of PE/Nesting on entities declaration
- checking/handling of xml:space
- checking done.
- handling done, not well tested
- Language identification code, productions [33] to [38]
=> done, the check has been added and report WFness errors
- Conditional sections in DTDs [61] to [65]
=> should this crap be really implemented ???
=> Yep OASIS testsuite uses them
- Allow parsed entities defined in the internal subset to override
the ones defined in the external subset (DtD customization).
=> This mean that the entity content should be computed only at
use time, i.e. keep the orig string only at parse time and expand
only when referenced from the external subset :-(
Needed for complete use of most DTD from Eve Maler
- Add regression tests for all WFC errors
=> did some in test/WFC
=> added OASIS testsuite routines
http://xmlsoft.org/conf/result.html
- I18N: http://wap.trondheim.com/vaer/index.phtml is not XML and accepted
by the XML parser, UTF-8 should be checked when there is no "encoding"
declared !
- Support for UTF-8 and UTF-16 encoding
=> added some conversion routines provided by Martin Durst
patched them, got fixes from @@@
I plan to keep everything internally as UTF-8 (or ISO-Latin-X)
this is slightly more costly but more compact, and recent processors
efficiency is cache related. The key for good performances is keeping
the data set small, so will I.
=> the new progressive reading routines call the detection code
is enabled, tested the ISO->UTF-8 stuff
- External entities loading:
- allow override by client code
- make sure it is called for all external entities referenced
Done, client code should use xmlSetExternalEntityLoader() to set
the default loading routine. It will be called each time an external
entity entity resolution is triggered.
- maintain ID coherency when removing/changing attributes
The function used to deallocate attributes now check for it being an
ID and removes it from the table.
- push mode parsing i.e. non-blocking state based parser
done, both for XML and HTML parsers. Use xmlCreatePushParserCtxt()
and xmlParseChunk() and html counterparts.
The tester program now has a --push option to select that parser
front-end. Douplicated tests to use both and check results are similar.
- Most of XPath, still see some troubles and occasionnal memleaks.
- an XML shell, allowing to traverse/manipulate an XML document with
a shell like interface, and using XPath for the anming syntax
- use of readline and history added when available
- the shell interface has been cleanly separated and moved to debugXML.c
- HTML parser, should be fairly stable now
- API to search the lang of an attribute
- Collect IDs at parsing and maintain a table.
PBM: maintain the table coherency
PBM: how to detect ID types in absence of DtD !
- Use it for XPath ID support
- Add validity checking
Should be finished now !
- Add regression tests with entity substitutions
- External Parsed entities, either XML or external Subset [78] and [79]
parsing the xmllang DtD now works, so it should be sufficient for
most cases !
- progressive reading. The entity support is a first step toward
abstraction of an input stream. A large part of the context is still
located on the stack, moving to a state machine and putting everything
in the parsing context should provide an adequate solution.
=> Rather than progressive parsing, give more power to the SAX-like
interface. Currently the DOM-like representation is built but
=> it should be possible to define that only as a set of SAX callbacks
and remove the tree creation from the parser code.
DONE
- DOM support, instead of using a proprietary in memory
format for the document representation, the parser should
call a DOM API to actually build the resulting document.
Then the parser becomes independent of the in-memory
representation of the document. Even better using RPC's
the parser can actually build the document in another
program.
=> Work started, now the internal representation is by default
very near a direct DOM implementation. The DOM glue is implemented
as a separate module. See the GNOME gdome module.
- C++ support : John Ehresman <jehresma@dsg.harvard.edu>
- Updated code to follow more recent specs, added compatibility flag
- Better error handling, use a dedicated, overridable error
handling function.
- Support for CDATA.
- Keep track of line numbers for better error reporting.
- Support for PI (SAX one).
- Support for Comments (bad, should be in ASAP, they are parsed
but not stored), should be configurable.
- Improve the support of entities on save (+SAX).
doc/alt-libxml2/Copyright 0000644 00000002411 15173033512 0011331 0 ustar 00 Except where otherwise noted in the source code (e.g. the files hash.c,
list.c and the trio files, which are covered by a similar licence but
with different Copyright notices) all the files are:
Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is fur-
nished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
doc/alt-libxml2/NEWS 0000644 00000570210 15173033512 0010144 0 ustar 00 NEWS file for libxml2
v2.10.2: Aug 29 2022
### Improvements
- Remove set-but-unused variable in xmlXPathScanName
- Silence -Warray-bounds warning
### Build system
- build: require automake-1.16.3 or later (Xi Ruoyao)
- Remove generated files from distribution
### Test suite
- Don't create missing.xml when running testapi
v2.10.1: Aug 25 2022
### Regressions
- Fix xmlCtxtReadDoc with encoding
### Bug fixes
- Fix HTML parser with threads and --without-legacy
### Build system
- Fix build with Python 3.10
- cmake: Disable version script on macOS
- Remove Makefile rule to build testapi.c
### Documentation
- Switch back to HTML output for API documentation
- Port doc/examples/index.py to Python 3
- Fix order of exports in libxml2-api.xml
- Remove libxml2-refs.xml
v2.10.0: Aug 17 2022
### Security
- [CVE-2022-2309] Reset nsNr in xmlCtxtReset
- Reserve byte for NUL terminator and report errors consistently in xmlBuf and
xmlBuffer (David Kilzer)
- Fix missing NUL terminators in xmlBuf and xmlBuffer functions (David Kilzer)
- Fix integer overflow in xmlBufferDump() (David Kilzer)
- xmlBufAvail() should return length without including a byte for NUL
terminator (David Kilzer)
- Fix ownership of xmlNodePtr & xmlAttrPtr fields in xmlSetTreeDoc() (David
Kilzer)
- Use xmlNewDocText in xmlXIncludeCopyRange
- Fix use-after-free bugs when calling xmlTextReaderClose() before
xmlFreeTextReader() on post-validating parser (David Kilzer)
- Use UPDATE_COMPAT() consistently in buf.c (David Kilzer)
- fix: xmlXPathParserContext could be double-delete in OOM case. (jinsub ahn)
### Removals and deprecations
- Disable XPointer location support by default
- Remove outdated xml2Conf.sh
- Deprecate module init and cleanup functions
- Remove obsolete XML Software Autoupdate (XSA) file
- Remove DOCBparser
- Remove obsolete Python test framework
- Remove broken VxWorks support
- Remove broken Mac OS 9 support
- Remove broken bakefile support
- Remove broken Visual Studio 2010 support
- Remove broken Windows CE support
- Deprecate IDREF-related functions in valid.h
- Deprecate legacy functions
- Disable legacy support by default
- Deprecate all functions in nanoftp.h
- Disable FTP support by default
- Add XML_DEPRECATED macro
- Remove elfgcchack.h
### Regressions
- Skip incorrectly opened HTML comments
- Restore behavior of htmlDocContentDumpFormatOutput() (David Kilzer)
### Bug fixes
- Fix memory leak with invalid XSD
- Make XPath depth check work with recursive invocations
- Fix memory leak in xmlLoadEntityContent error path
- Avoid double-free if malloc fails in inputPush
- Properly fold whitespace around the QName value when validating an XSD
schema. (Damjan Jovanovic)
- Add whitespace folding for some atomic data types that it's missing on.
(Damjan Jovanovic)
- Don't add IDs containing unexpanded entity references
### Improvements
- Avoid calling xmlSetTreeDoc
- Simplify xmlFreeNode
- Don't reset nsDef when changing node content
- Fix unintended fall-through in xmlNodeAddContentLen
- Remove unused xmlBuf functions (David Kilzer)
- Implement xpath1() XPointer scheme
- Add configuration flag for XPointer locations support
- Fix compiler warnings in Python code
- Mark more static data as `const` (David Kilzer)
- Make xmlStaticCopyNode non-recursive
- Clean up encoding switching code
- Simplify recursive pthread mutex
- Use non-recursive mutex in dict.c
- Fix parser progress checks
- Avoid arithmetic on freed pointers
- Improve buffer allocation scheme
- Remove unneeded #includes
- Add support for some non-standard escapes in regular expressions. (Damjan
Jovanovic)
- htmlParseComment: handle abruptly-closed comments (Mike Dalessio)
- Add let variable tag support (Oliver Diehl)
- Add value-of tag support (Oliver Diehl)
- Remove useless call to xmlRelaxNGCleanupTypes
- Don't include ICU headers in public headers
- Update `xmlStrlen()` to use POSIX / ISO C `strlen()` (Mike Dalessio)
- Fix unused variable warnings with disabled features
- Only warn on invalid redeclarations of predefined entities
- Remove unneeded code in xmlreader.c
- Rework validation context flags
### Portability
- Use NAN/INFINITY if available to init XPath NaN/Inf (Sergey Kosukhin)
- Fix Python tests on macOS
- Fix xmlCleanupThreads on Windows
- Fix reinitialization of library on Windows
- Don't mix declarations and code in runtest.c
- Use portable python shebangs (David Seifert)
- Use critical sections as mutex on Windows
- Don't set HAVE_WIN32_THREADS in win32config.h
- Use stdint.h with newer MSVC
- Remove cruft from win32config.h
- Remove isinf/isnan emulation in win32config.h
- Always fopen files with "rb"
- Remove __DJGPP__ checks
- Remove useless __CYGWIN__ checks
### Build system
- Don't autogenerate doc/examples/Makefile.am
- cmake: Install libxml.m4 on UNIX-like platforms (Daniel E)
- cmake: Use symbol versioning on UNIX-like platforms (Daniel E)
- Port genUnicode.py to Python 3
- Port gentest.py to Python 3
- cmake: Fix build without thread support
- cmake: Install documentation in CMAKE_INSTALL_DOCDIR
- cmake: Remove non needed files in docs dir (Daniel E)
- configure: move XML_PRIVATE_LIBS after WIN32_EXTRA_LIBADD is set
(Christopher Degawa)
- Move local Autoconf macros into m4 directory
- Use XML_PRIVATE_LIBS in libxml2_la_LIBADD
- Update libxml-2.0-uninstalled.pc.in
- Remove LIBS from XML_PRIVATE_LIBS
- Add WIN32_EXTRA_LIBADD to XML_PRIVATE_LIBS
- Don't overlink executables
- cmake: Adjust paths for UNIX or UNIX-like target systems (Daniel Engberg)
- build: Make use of variables in libxml's pkg-config file (Daniel Engberg)
- Avoid obsolescent `test -a` constructs (David Seifert)
- Move AM_MAINTAINER_MODE to AM section
- configure.ac: make AM_SILENT_RULES([yes]) unconditional (David Seifert)
- Streamline documentation installation
- Don't try to recreate COPYING symlink
- Detect libm using libtool's macros (David Seifert)
- configure.ac: disable static libraries by default (David Seifert)
- python/Makefile.am: nest python docs in $(docdir) (David Seifert)
- python/Makefile.am: rely on global AM_INIT_AUTOMAKE (David Seifert)
- Makefile.am: install examples more idiomatically (David Seifert)
- configure.ac: remove useless AC_SUBST (David Seifert)
- Respect `--sysconfdir` in source files (David Seifert)
- Ignore configure backup file created by recent autoreconf too (Vadim Zeitlin)
- Only install *.html and *.c example files
- Remove --with-html-dir option
- Rework documentation build system
- Remove old website
- Use AM_PATH_PYTHON/PKG_CHECK_MODULES for python bindings (David Seifert)
- Update genChRanges.py
- Update build_glob.py
- Remove ICONV_CONST test
- Remove obsolete AC_HEADER checks
- Don't check for standard C89 library functions
- Don't check for standard C89 headers
- Remove special configuration for certain maintainers
### Test suite, CI
- Disable network in API tests
- testapi: remove leading slash from "/missing.xml" (Mike Gilbert)
- Build Autotools CI tests out of source tree (VPATH)
- Add --with-minimum build to CI tests
- Fix warnings when testing --with-minimum build
- cmake: Run all tests when threads are disabled
- Also build CI tests with -Werror
- Move doc/examples tests to new test suite
- Simplify 'make check' targets
- Fix schemas and relaxng tests
- Remove unused result files
- Allow missing result files in runtest
- Move regexp tests to runtest
- Move SVG tests to runtest.c
- Move testModule to new test suite
- Move testThreads to new test suite
- Remove major parts of old test suite
- Make testchar return an error on failure (Tony Tascioglu)
- Add CI job for static build
- python/tests: open() relative to test scripts (David Seifert)
- Port some test scripts to Python 3
### Documentation
- Improve documentation of tree manipulation API
- Update xml2-config man page
- Consolidate man pages
- Rename xmlcatalog_man.xml
- Make examples a standalone HTML page
- Fix documentation in entities.c
- Add note about optimization flags
v2.9.14: May 02 2022:
- Security:
[CVE-2022-29824] Integer overflow in xmlBuf and xmlBuffer
Fix potential double-free in xmlXPtrStringRangeFunction
Fix memory leak in xmlFindCharEncodingHandler
Normalize XPath strings in-place
Prevent integer-overflow in htmlSkipBlankChars() and xmlSkipBlankChars()
(David Kilzer)
Fix leak of xmlElementContent (David Kilzer)
- Bug fixes:
Fix parsing of subtracted regex character classes
Fix recursion check in xinclude.c
Reset last error in xmlCleanupGlobals
Fix certain combinations of regex range quantifiers
Fix range quantifier on subregex
- Improvements:
Fix recovery from invalid HTML start tags
- Build system, portability:
Define LFS macros before including system headers
Initialize XPath floating-point globals
configure: check for icu DEFS (James Hilliard)
configure.ac: produce tar.xz only (GNOME policy) (David Seifert)
CMakeLists.txt: Fix LIBXML_VERSION_NUMBER
Fix build with older Python versions
Fix --without-valid build
v2.9.13: Feb 19 2022:
- Security:
[CVE-2022-23308] Use-after-free of ID and IDREF attributes
(Thanks to Shinji Sato for the report)
Use-after-free in xmlXIncludeCopyRange (David Kilzer)
Fix Null-deref-in-xmlSchemaGetComponentTargetNs (huangduirong)
Fix memory leak in xmlXPathCompNodeTest
Fix null pointer deref in xmlStringGetNodeList
Fix several memory leaks found by Coverity (David King)
- Fixed regressions:
Fix regression in RelaxNG pattern matching
Properly handle nested documents in xmlFreeNode
Fix regression with PEs in external DTD
Fix random dropping of characters on dumping ASCII encoded XML (Mohammad Razavi)
Revert "Make schema validation fail with multiple top-level elements"
Fix regression when parsing invalid HTML tags in push mode
Fix regression parsing public IDs literals in HTML
Fix buffering in xmlOutputBufferWrite
Fix whitespace when serializing empty HTML documents
Fix XPath recursion limit
Fix regression in xmlNodeDumpOutputInternal
Work around lxml API abuse
- Bug fixes:
Fix xmlSetTreeDoc with entity references
Fix double counting of CRLF in comments
Make sure to grow input buffer in xmlParseMisc
Don't ignore xmllint options after "-"
Don't normalize namespace URIs in XPointer xmlns() scheme
Fix handling of XSD with empty namespace
Also register HTML document nodes
Make xmllint return an error if arguments are missing
Fix handling of ctxt->base in xmlXPtrEvalXPtrPart
Fix xmllint --maxmem
Fix htmlReadFd, which was using a mix of xml and html context functions (Finn Barber)
Move current position before possible calling of ctxt->sax->characters (Yulin Li)
Fix parse failure when 4-byte character in UTF-16 BE is split across a chunk (David Kilzer)
Patch to forbid epsilon-reduction of final states (Arne Becker)
Avoid segfault at exit when using custom memory functions (Mike Dalessio)
- Tests, code quality, fuzzing:
Remove .travis.yml
Make xmlFuzzReadString return a zero size in error case
Fix unused function warning in testapi.c
Update NewsML DTD in test suite
Add more checks for malloc failures in xmllint.c
Avoid potential integer overflow in xmlstring.c
Run CI tests with UBSan implicit-conversion checks
Fix casting of line numbers in SAX2.c
Fix integer conversion warnings in hash.c
Add explicit casts in runtest.c
Fix integer conversion warning in xmlIconvWrapper
Add suffix to unsigned constant in xmlmemory.c
Add explicit casts in testchar.c
Fix integer conversion warnings in xmlstring.c
Add explicit cast in xmlURIUnescapeString
Remove unused variable in xmlCharEncOutFunc (David King)
- Build system, portability:
Remove xmlwin32version.h
Fix fuzzer test with VPATH build
Support custom prefix when installing Python module
Remove Makefile.win
Remove CVS and SVN-related code
Port python 3.x module to Windows and improve distutils (Chun-wei Fan)
Correctly install the HTML examples into their subdirectory (Mattia Rizzolo)
Refactor the settings of $docdir (Mattia Rizzolo)
Remove unused configure checks (Ben Boeckel)
python/Makefile.am: use *_LIBADD, not *_LDFLAGS for LIBS (Sam James)
Fix check for libtool in autogen.sh
Use version in configure.ac for CMake (Timothy Lyanguzov)
Add CMake alias targets for embedded projects (Markus Rickert)
- Documentation:
Remove SVN keyword anchors
Rework README
Remove README.cvs-commits
Remove old ChangeLog
Update hyperlinks
Remove README.docs
Remove MAINTAINERS
Remove xmltutorial.pdf
Upload documentation to GitLab pages
Document how to escape XML_CATALOG_FILES
Fix libxml2.doap
Update URL for libxml++ C++ binding (Kjell Ahlstedt)
Generate devhelp2 index file (Emmanuele Bassi)
Mention XML_CATALOG_FILES is space-separated (Jan Tojnar)
Add documentaiton for xmllint exit code 10 (Rainer Canavan)
Fix some validation errors in the FAQ (David King)
Add instructions on how to use CMake to compile libxml (Markus Rickert)
v2.9.12: May 13 2021:
- Build system:
Add fuzz.h and seed/regexp to EXTRA_DIST
v2.9.11: May 13 2021:
- Security:
Patch for security issue CVE-2021-3541 (Daniel Veillard)
- Documentation:
Clarify xmlNewDocProp documentation (Nick Wellnhofer)
- Portability:
CMake: Only add postfixes if MSVC (Christopher Degawa),
Fix XPath NaN/Inf for older GCC versions (Nick Wellnhofer),
Use CMake PROJECT_VERSION (Markus Rickert),
Fix warnings in libxml.m4 with autoconf 2.70+. (Simon Josefsson),
Add CI for CMake on MSVC (Markus Rickert),
Update minimum required CMake version (Markus Rickert),
Add variables for configured options to CMake config files (Markus Rickert),
Check if variables exist when defining targets (Markus Rickert),
Check if target exists when reading target properties (Markus Rickert),
Add xmlcatalog target and definition to config files (Markus Rickert),
Remove include directories for link-only dependencies (Markus Rickert),
Fix ICU build in CMake (Markus Rickert),
Configure pkgconfig, xml2-config, and xml2Conf.sh file (Markus Rickert),
Update CMake config files (Markus Rickert),
Add xmlcatalog and xmllint to CMake export (Markus Rickert),
Simplify xmlexports.h (Nick Wellnhofer),
Require dependencies based on enabled CMake options (Markus Rickert),
Use NAMELINK_COMPONENT in CMake install (Markus Rickert),
Add CMake files to EXTRA_DIST (Markus Rickert),
Add missing compile definition for static builds to CMake (Markus Rickert),
Add CI for CMake on Linux and MinGW (Markus Rickert),
Fix variable name in win32/configure.js (Nick Wellnhofer),
Fix version parsing in win32/configure.js (Nick Wellnhofer),
Fix autotools warnings (Nick Wellnhofer),
Update config.h.cmake.in (Markus Rickert),
win32: allow passing *FLAGS on command line (Michael Stahl),
Configure file xmlwin32version.h.in on MSVC (Markus Rickert),
List headers individually (Markus Rickert),
Add CMake build files (Markus Rickert),
Parenthesize Py<type>_Check() in ifs (Miro Hrončok),
Minor fixes to configure.js (Nick Wellnhofer)
- Bug Fixes:
Fix null deref in legacy SAX1 parser (Nick Wellnhofer),
Fix handling of unexpected EOF in xmlParseContent (Nick Wellnhofer),
Fix line numbers in error messages for mismatched tags (Nick Wellnhofer),
Fix htmlTagLookup (Nick Wellnhofer),
Propagate error in xmlParseElementChildrenContentDeclPriv (Nick Wellnhofer),
Fix user-after-free with `xmllint --xinclude --dropdtd` (Nick Wellnhofer),
Fix dangling pointer with `xmllint --dropdtd` (Nick Wellnhofer),
Validate UTF8 in xmlEncodeEntities (Joel Hockey),
Fix use-after-free with `xmllint --html --push` (Nick Wellnhofer),
Allow FP division by zero in xmlXPathInit (Nick Wellnhofer),
Fix xmlGetNodePath with invalid node types (Nick Wellnhofer),
Fix exponential behavior with recursive entities (Nick Wellnhofer),
Fix quadratic behavior when looking up xml:* attributes (Nick Wellnhofer),
Fix slow parsing of HTML with encoding errors (Nick Wellnhofer),
Fix null deref introduced with previous commit (Nick Wellnhofer),
Check for invalid redeclarations of predefined entities (Nick Wellnhofer),
Add the copy of type from original xmlDoc in xmlCopyDoc() (SVGAnimate),
parser.c: shrink the input buffer when appropriate (Mike Dalessio),
Fix infinite loop in HTML parser introduced with recent commits (Nick Wellnhofer),
Fix quadratic runtime when parsing CDATA sections (Nick Wellnhofer),
Fix timeout when handling recursive entities (Nick Wellnhofer),
Fix memory leak in xmlParseElementMixedContentDecl (Nick Wellnhofer),
Fix null deref in xmlStringGetNodeList (Nick Wellnhofer),
use new htmlParseLookupCommentEnd to find comment ends (Mike Dalessio),
htmlParseComment: treat `--!>` as if it closed the comment (Mike Dalessio),
Fix integer overflow in xmlSchemaGetParticleTotalRangeMin (Nick Wellnhofer),
encoding: fix memleak in xmlRegisterCharEncodingHandler() (Xiaoming Ni),
xmlschemastypes.c: xmlSchemaGetFacetValueAsULong add, check "facet->val" (Xiaoming Ni),
Fix null pointer deref in xmlXPtrRangeInsideFunction (Nick Wellnhofer),
Fix quadratic runtime in HTML push parser with null bytes (Nick Wellnhofer),
Avoid quadratic checking of identity-constraints (Michael Matz),
Fix building with ICU 68. (Frederik Seiffert),
Convert python/libxml.c to PY_SSIZE_T_CLEAN (Victor Stinner),
Fix xmlURIEscape memory leaks. (Elliott Hughes),
Avoid call stack overflow with XML reader and recursive XIncludes (Nick Wellnhofer),
Fix caret in regexp character group (Nick Wellnhofer),
parser.c: xmlParseCharData peek behavior fixed wrt newlines (Mike Dalessio),
Fix memory leaks in XPointer string-range function (Nick Wellnhofer),
Fix use-after-free when XIncluding text from Reader (Nick Wellnhofer),
Fix SEGV in xmlSAXParseFileWithData (yanjinjq),
Fix null deref in XPointer expression error path (Nick Wellnhofer),
Don't call xmlXPathInit directly (Nick Wellnhofer),
Fix cleanup of attributes in XML reader (Nick Wellnhofer),
Fix double free in XML reader with XIncludes (Nick Wellnhofer),
Fix memory leak in xmlXIncludeAddNode error paths (Nick Wellnhofer),
Revert "Fix quadratic runtime in xi:fallback processing" (Nick Wellnhofer),
Fix error reporting with xi:fallback (Nick Wellnhofer),
Fix quadratic runtime in xi:fallback processing (Nick Wellnhofer),
Fix corner case with empty xi:fallback (Nick Wellnhofer),
Fix XInclude regression introduced with recent commit (Nick Wellnhofer),
Fix memory leak in runtest.c (Nick Wellnhofer),
Make "xmllint --push --recovery" work (Nick Wellnhofer),
Revert "Do not URI escape in server side includes" (Nick Wellnhofer),
Fix column number accounting in xmlParse*NameAndCompare (Nick Wellnhofer),
Stop counting nbChars in parser context (Nick Wellnhofer),
Fix out-of-bounds read with 'xmllint --htmlout' (Nick Wellnhofer),
Fix exponential runtime and memory in xi:fallback processing (Nick Wellnhofer),
Don't process siblings of root in xmlXIncludeProcess (Nick Wellnhofer),
Don't recurse into xi:include children in xmlXIncludeDoProcess (Nick Wellnhofer),
Fix memory leak in xmlXIncludeIncludeNode error paths (Nick Wellnhofer),
Check for custom free function in global destructor (Nick Wellnhofer),
Fix integer overflow when comparing schema dates (Nick Wellnhofer),
Fix exponential runtime in xmlFARecurseDeterminism (Nick Wellnhofer),
Don't try to handle namespaces when building HTML documents (Nick Wellnhofer),
Fix several quadratic runtime issues in HTML push parser (Nick Wellnhofer),
Fix quadratic runtime when push parsing HTML start tags (Nick Wellnhofer),
Reset XML parser input before reporting errors (David Kilzer),
Fix quadratic runtime when push parsing HTML entity refs (Nick Wellnhofer),
Fix HTML push parser lookahead (Nick Wellnhofer),
Make htmlCurrentChar always translate U+0000 (Nick Wellnhofer),
Fix UTF-8 decoder in HTML parser (Nick Wellnhofer),
Fix quadratic runtime when parsing HTML script content (Nick Wellnhofer),
Reset HTML parser input before reporting error (Nick Wellnhofer),
Fix more quadratic runtime issues in HTML push parser (Nick Wellnhofer),
Fix regression introduced with 477c7f6a (Nick Wellnhofer),
Fix quadratic runtime in HTML parser (Nick Wellnhofer),
Reset HTML parser input before reporting encoding error (Nick Wellnhofer),
Fix integer overflow in xmlFAParseQuantExact (Nick Wellnhofer),
Fix return value of xmlC14NDocDumpMemory (Nick Wellnhofer),
Don't follow next pointer on documents in xmlXPathRunStreamEval (Nick Wellnhofer),
Fix integer overflow in _xmlSchemaParseGYear (Nick Wellnhofer),
Fix integer overflow when parsing {min,max}Occurs (Nick Wellnhofer),
Fix another memory leak in xmlSchemaValAtomicType (Nick Wellnhofer),
Fix unsigned integer overflow in htmlParseTryOrFinish (Nick Wellnhofer),
Fix integer overflow in htmlParseCharRef (Nick Wellnhofer),
Fix undefined behavior in UTF16LEToUTF8 (Nick Wellnhofer),
Fix return value of xmlCharEncOutput (Nick Wellnhofer),
Never expand parameter entities in text declaration (Nick Wellnhofer),
Fix undefined behavior in xmlXPathTryStreamCompile (Nick Wellnhofer),
Fix use-after-free with validating reader (Nick Wellnhofer),
xmlParseBalancedChunkMemory must not be called with NULL doc (Nick Wellnhofer),
Revert "Fix memory leak in xmlParseBalancedChunkMemoryRecover" (Nick Wellnhofer),
Fix memory leak in xmlXIncludeLoadDoc error path (Nick Wellnhofer),
Make schema validation fail with multiple top-level elements (Nick Wellnhofer),
Call xmlCleanupParser on ELF destruction (Samuel Thibault),
Fix copying of entities in xmlParseReference (Nick Wellnhofer),
Fix memory leak in xmlSchemaValidateStream (Zhipeng Xie),
Fix xmlSchemaGetCanonValue formatting for date and dateTime (Kevin Puetz),
Fix memory leak when shared libxml.dll is unloaded (Kevin Puetz),
Fix potentially-uninitialized critical section in Win32 DLL builds (Kevin Puetz),
Fix integer overflow in xmlBufferResize (Nick Wellnhofer),
Check for overflow when allocating two-dimensional arrays (Nick Wellnhofer),
Remove useless comparisons (Nick Wellnhofer),
Fix overflow check in xmlNodeDump (Nick Wellnhofer),
Fix infinite loop in xmlStringLenDecodeEntities (Zhipeng Xie),
Fix freeing of nested documents (Nick Wellnhofer),
Fix more memory leaks in error paths of XPath parser (Nick Wellnhofer),
Fix memory leaks of encoding handlers in xmlsave.c (Nick Wellnhofer),
Fix xml2-config error code (Nick Wellnhofer),
Fix memory leak in error path of XPath expr parser (Nick Wellnhofer),
Fix overflow handling in xmlBufBackToBuffer (Nick Wellnhofer),
Null pointer handling in catalog.c (raniervf),
xml2-config.in: fix regressions introduced by commit 2f2bf4b2c (Dmitry V. Levin)
- Improvements:
Store per-element parser state in a struct (Nick Wellnhofer),
update for xsd:language type check (PaulHiggs),
Update INSTALL.libxml2 (Nick Wellnhofer),
Fix include order in c14n.h (Nick Wellnhofer),
Fix duplicate xmlStrEqual calls in htmlParseEndTag (Nick Wellnhofer),
Speed up htmlCheckAutoClose (Nick Wellnhofer),
Speed up htmlTagLookup (Nick Wellnhofer),
Stop checking attributes for UTF-8 validity (Nick Wellnhofer),
Reduce some fuzzer timeouts (Nick Wellnhofer),
Only run a few CI tests unless scheduled (Nick Wellnhofer),
Improve fuzzer stability (Nick Wellnhofer),
Check for feature flags in fuzzer tests (Nick Wellnhofer),
Another attempt at improving fuzzer stability (Nick Wellnhofer),
Revert "Improve HTML fuzzer stability" (Nick Wellnhofer),
Add charset names to fuzzing dictionaries (Nick Wellnhofer),
Improve HTML fuzzer stability (Nick Wellnhofer),
Add CI for MSVC x86 (Markus Rickert),
Add a flag to not output anything when xmllint succeeded (hhb),
Speed up HTML fuzzer (Nick Wellnhofer),
Remove unused encoding parameter of HTML output functions (Nick Wellnhofer),
Handle malloc failures in fuzzing code (Nick Wellnhofer),
add test coverage for incorrectly-closed comments (Mike Dalessio),
Enforce maximum length of fuzz input (Nick Wellnhofer),
Remove temporary members from struct _xmlXPathContext (Nick Wellnhofer),
Build the Python extension with PY_SSIZE_T_CLEAN (Victor Stinner),
Add CI test for Python 3 (Nick Wellnhofer),
Add fuzzing dictionaries to EXTRA_DIST (Nick Wellnhofer),
Add 'fuzz' subdirectory to DIST_SUBDIRS (Nick Wellnhofer),
Allow port numbers up to INT_MAX (Nick Wellnhofer),
Handle dumps of corrupted documents more gracefully (Nick Wellnhofer),
Limit size of free lists in XML reader when fuzzing (Nick Wellnhofer),
Hardcode maximum XPath recursion depth (Nick Wellnhofer),
Pass URL of main entity in XML fuzzer (Nick Wellnhofer),
Consolidate seed corpus generation (Nick Wellnhofer),
Test fuzz targets with dummy driver (Nick Wellnhofer),
Fix regression introduced with commit d88df4b (Nick Wellnhofer),
Fix regression introduced with commit 74dcc10b (Nick Wellnhofer),
Add TODO comment in xinclude.c (Nick Wellnhofer),
Stop using maxParserDepth in xpath.c (Nick Wellnhofer),
Remove dead code in xinclude.c (Nick Wellnhofer),
Don't add formatting newlines to XInclude nodes (Nick Wellnhofer),
Don't use SAX1 if all element handlers are NULL (Nick Wellnhofer),
Remove unneeded progress checks in HTML parser (Nick Wellnhofer),
Use strcmp when fuzzing (Nick Wellnhofer),
Fix XPath fuzzer (Nick Wellnhofer),
Fuzz XInclude engine (Nick Wellnhofer),
Add XPath and XPointer fuzzer (Nick Wellnhofer),
Update fuzzing code (Nick Wellnhofer),
More *NodeDumpOutput fixes (Nick Wellnhofer),
Fix *NodeDumpOutput functions (Nick Wellnhofer),
Make xmlNodeDumpOutputInternal non-recursive (Nick Wellnhofer),
Make xhtmlNodeDumpOutput non-recursive (Nick Wellnhofer),
Make htmlNodeDumpFormatOutput non-recursive (Nick Wellnhofer),
Fix .gitattributes (Nick Wellnhofer),
Rework control flow in htmlCurrentChar (Nick Wellnhofer),
Make 'xmllint --html --push -' read from stdin (Nick Wellnhofer),
Remove misleading comments in xpath.c (Nick Wellnhofer),
Update to Devhelp index file format version 2 (Andre Klapper),
Set project language to C (Markus Rickert),
Add variable for working directory of XML Conformance Test Suite (Markus Rickert),
Add additional tests and XML Conformance Test Suite (Markus Rickert),
Add command line option for temp directory in runtest (Markus Rickert),
Ensure LF line endings for test files (Markus Rickert),
Enable runtests and testThreads (Markus Rickert),
Limit regexp nesting depth (Nick Wellnhofer),
Fix return values and documentation in encoding.c (Nick Wellnhofer),
Add regexp regression tests (David Kilzer),
Report error for invalid regexp quantifiers (Nick Wellnhofer),
Fix rebuilding docs, by hiding __attribute__((...)) behind a macro. (Martin Vidner),
Copy xs:duration parser from libexslt (Nick Wellnhofer),
Fuzz target for XML Schemas (Nick Wellnhofer),
Move entity recorder to fuzz.c (Nick Wellnhofer),
Fuzz target for HTML parser (Nick Wellnhofer),
Update GitLab CI container (Nick Wellnhofer),
Add options file for xml fuzzer (Nick Wellnhofer),
Add a couple of libFuzzer targets (Nick Wellnhofer),
Guard new calls to xmlValidatePopElement in xml_reader.c (Daniel Cheng),
Add LIBXML_VALID_ENABLED to xmlreader (Łukasz Wojniłowicz),
Fix typos (Nick Wellnhofer),
Disable LeakSanitizer (Nick Wellnhofer),
Stop calling SAX getEntity handler from XMLReader (Nick Wellnhofer),
Add test case for recursive external parsed entities (Nick Wellnhofer),
Enable error tests with entity substitution (Nick Wellnhofer),
Don't load external entity from xmlSAX2GetEntity (Nick Wellnhofer),
Merge code paths loading external entities (Nick Wellnhofer),
Copy some XMLReader option flags to parser context (Nick Wellnhofer),
Add xmlPopOutputCallbacks (Nick Wellnhofer),
Updated Python test reader2.py (Pieter van Oostrum),
Updated python/tests/tstLastError.py (Pieter van Oostrum),
Use random seed in xmlDictComputeFastKey (Ranier Vilela),
Enable more undefined behavior sanitizers (Nick Wellnhofer)
v2.9.10: Oct 30 2019:
- Documentation:
Fix a few more typos ("fonction") (Nick Wellnhofer),
Large batch of typo fixes (Jared Yanovich),
Fix typos: tree: move{ -> s}, reconcil{i -> }ed, h{o -> e}ld by... (Jan Pokorný),
Fix typo: xpath: simpli{ -> fi}ed (Jan Pokorný),
Doc: do not mislead towards "infeasible" scenario wrt. xmlBufNodeDump (Jan Pokorný),
Fix comments in test code (zhouzhongyuan),
fix comment in testReader.c (zhouzhongyuan)
- Portability:
Fix some release issues on Fedora 30 (Daniel Veillard),
Fix exponent digits when running tests under old MSVC (Daniel Richard G),
Work around buggy ceil() function on AIX (Daniel Richard G),
Don't call printf with NULL string in runtest.c (Daniel Richard G),
Switched from unsigned long to ptrdiff_t in parser.c (Stephen Chenney),
timsort.h: support older GCCs (Jérôme Duval),
Make configure.ac work with older pkg-config (Nick Wellnhofer),
Stop defining _REENTRANT on some Win32 platforms (Nick Wellnhofer),
Fix nanohttp.c on MinGW (Nick Wellnhofer),
Fix Windows compiler warning in testC14N.c (Nick Wellnhofer),
Merge testThreadsWin32.c into testThreads.c (Nick Wellnhofer),
Fix Python bindings under Windows (Nick Wellnhofer)
- Bug Fixes:
Another fix for conditional sections at end of document (Nick Wellnhofer),
Fix for conditional sections at end of document (Nick Wellnhofer),
Make sure that Python tests exit with error code (Nick Wellnhofer),
Audit memory error handling in xpath.c (Nick Wellnhofer),
Fix error code in xmlTextWriterStartDocument (Nick Wellnhofer),
Fix integer overflow when counting written bytes (Nick Wellnhofer),
Fix uninitialized memory access in HTML parser (Nick Wellnhofer),
Fix memory leak in xmlSchemaValAtomicType (Nick Wellnhofer),
Disallow conditional sections in internal subset (Nick Wellnhofer),
Fix use-after-free in xmlTextReaderFreeNodeList (Nick Wellnhofer),
Fix Regextests (Nick Wellnhofer),
Fix empty branch in regex (Nick Wellnhofer),
Fix integer overflow in entity recursion check (Nick Wellnhofer),
Don't read external entities or XIncludes from stdin (Nick Wellnhofer),
Fix Schema determinism check of ##other namespaces (Nick Wellnhofer),
Fix potential null deref in xmlSchemaIDCFillNodeTables (zhouzhongyuan),
Fix potential memory leak in xmlBufBackToBuffer (Nick Wellnhofer),
Fix error message when processing XIncludes with fallbacks (Nick Wellnhofer),
Fix memory leak in xmlRegEpxFromParse (zhouzhongyuan),
14:00 is a valid timezone for xs:dateTime (Nick Wellnhofer),
Fix memory leak in xmlParseBalancedChunkMemoryRecover (Zhipeng Xie),
Fix potential null deref in xmlRelaxNGParsePatterns (Nick Wellnhofer),
Misleading error message with xs:{min|max}Inclusive (bettermanzzy),
Fix memory leak in xmlXIncludeLoadTxt (Wang Kirin),
Partial fix for comparison of xs:durations (Nick Wellnhofer),
Fix null deref in xmlreader buffer (zhouzhongyuan),
Fix unability to RelaxNG-validate grammar with choice-based name class (Jan Pokorný),
Fix unability to validate ambiguously constructed interleave for RelaxNG (Jan Pokorný),
Fix possible null dereference in xmlXPathIdFunction (zhouzhongyuan),
fix memory leak in xmlAllocOutputBuffer (zhouzhongyuan),
Fix unsigned int overflow (Jens Eggerstedt),
dict.h: gcc 2.95 doesn't allow multiple storage classes (Nick Wellnhofer),
Fix another code path in xmlParseQName (Nick Wellnhofer),
Make sure that xmlParseQName returns NULL in error case (Nick Wellnhofer),
Fix build without reader but with pattern (Nick Wellnhofer),
Fix memory leak in xmlAllocOutputBufferInternal error path (Nick Wellnhofer),
Fix unsigned integer overflow (Nick Wellnhofer),
Fix return value of xmlOutputBufferWrite (Nick Wellnhofer),
Fix parser termination from "Double hyphen within comment" error (David Warring),
Fix call stack overflow in xmlFreePattern (Nick Wellnhofer),
Fix null deref in previous commit (Nick Wellnhofer),
Fix memory leaks in xmlXPathParseNameComplex error paths (Nick Wellnhofer),
Check for integer overflow in xmlXPtrEvalChildSeq (Nick Wellnhofer),
Fix xmllint dump of XPath namespace nodes (Nick Wellnhofer),
Fix float casts in xmlXPathSubstringFunction (Nick Wellnhofer),
Fix null deref in xmlregexp error path (Nick Wellnhofer),
Fix null pointer dereference in xmlTextReaderReadOuterXml (Nick Wellnhofer),
Fix memory leaks in xmlParseStartTag2 error paths (Nick Wellnhofer),
Fix memory leak in xmlSAX2StartElement (Nick Wellnhofer),
Fix commit "Memory leak in xmlFreeID (xmlreader.c)" (Nick Wellnhofer),
Fix NULL pointer deref in xmlTextReaderValidateEntity (Nick Wellnhofer),
Memory leak in xmlFreeTextReader (Nick Wellnhofer),
Memory leak in xmlFreeID (xmlreader.c) (Nick Wellnhofer)
- Improvements:
Run XML conformance tests under CI (Nick Wellnhofer),
Update GitLab CI config (Nick Wellnhofer),
Propagate memory errors in valuePush (Nick Wellnhofer),
Propagate memory errors in xmlXPathCompExprAdd (Nick Wellnhofer),
Make xmlFreeDocElementContent non-recursive (Nick Wellnhofer),
Enable continuous integration via GitLab CI (Nick Wellnhofer),
Avoid ignored attribute warnings under GCC (Nick Wellnhofer),
Make xmlDumpElementContent non-recursive (Nick Wellnhofer),
Make apibuild.py ignore ATTRIBUTE_NO_SANITIZE (Nick Wellnhofer),
Mark xmlExp* symbols as removed (Nick Wellnhofer),
Make xmlParseConditionalSections non-recursive (Nick Wellnhofer),
Adjust expected error in Python tests (Nick Wellnhofer),
Make xmlTextReaderFreeNodeList non-recursive (Nick Wellnhofer),
Make xmlFreeNodeList non-recursive (Nick Wellnhofer),
Make xmlParseContent and xmlParseElement non-recursive (Nick Wellnhofer),
Remove executable bit from non-executable files (Nick Wellnhofer),
Fix expected output of test/schemas/any4 (Nick Wellnhofer),
Optimize build instructions in README (zhouzhongyuan),
xml2-config.in: Output CFLAGS and LIBS on the same line (Hugh McMaster),
xml2-config: Add a --dynamic switch to print only shared libraries (Hugh McMaster),
Annotate functions with __attribute__((no_sanitize)) (Nick Wellnhofer),
Fix warnings when compiling without reader or push parser (Nick Wellnhofer),
Remove unused member `doc` in xmlSaveCtxt (Nick Wellnhofer),
Limit recursion depth in xmlXPathCompOpEvalPredicate (Nick Wellnhofer),
Remove -Wno-array-bounds (Nick Wellnhofer),
Remove unreachable code in xmlXPathCountFunction (Nick Wellnhofer),
Improve XPath predicate and filter evaluation (Nick Wellnhofer),
Limit recursion depth in xmlXPathOptimizeExpression (Nick Wellnhofer),
Disable hash randomization when fuzzing (Nick Wellnhofer),
Optional recursion limit when parsing XPath expressions (Nick Wellnhofer),
Optional recursion limit when evaluating XPath expressions (Nick Wellnhofer),
Use break statements in xmlXPathCompOpEval (Nick Wellnhofer),
Optional XPath operation limit (Nick Wellnhofer),
Fix compilation with --with-minimum (Nick Wellnhofer),
Check XPath stack after calling functions (Nick Wellnhofer),
Remove debug printf in xmlreader.c (Nick Wellnhofer),
Always define LIBXML_THREAD_ENABLED when enabled (Michael Haubenwallner),
Regenerate NEWS (Nick Wellnhofer),
Change git repo URL (Nick Wellnhofer),
Change bug tracker URL (Nick Wellnhofer),
Remove outdated HTML file (Nick Wellnhofer),
Fix unused function warning in testapi.c (Nick Wellnhofer),
Add some generated test files to .gitignore (Nick Wellnhofer),
Remove unneeded function pointer casts (Nick Wellnhofer),
Fix -Wcast-function-type warnings (GCC 8) (Nick Wellnhofer),
Fix -Wformat-truncation warnings (GCC 8) (Nick Wellnhofer)
- Cleanups:
Rebuild docs (Nick Wellnhofer),
Disable xmlExp regex code (Nick Wellnhofer),
Remove redundant code in xmlRelaxNGValidateState (Nick Wellnhofer),
Remove redundant code in xmlXPathCompRelationalExpr (Nick Wellnhofer)
v2.9.9: Jan 03 2019:
- Security:
CVE-2018-9251 CVE-2018-14567 Fix infinite loop in LZMA decompression (Nick Wellnhofer),
CVE-2018-14404 Fix nullptr deref with XPath logic ops (Nick Wellnhofer),
- Documentation:
reader: Fix documentation comment (Mohammed Sadiq)
- Portability:
Fix MSVC build with lzma (Nick Wellnhofer),
Variables need 'extern' in static lib on Cygwin (Michael Haubenwallner),
Really declare dllexport/dllimport for Cygwin (Michael Haubenwallner),
Merge branch 'patch-2' into 'master' (Nick Wellnhofer),
Change dir to $THEDIR after ACLOCAL_PATH check autoreconf creates aclocal.m4 in $srcdir (Vitaly Buka),
Improve error message if pkg.m4 couldn't be found (Nick Wellnhofer),
NaN and Inf fixes for pre-C99 compilers (Nick Wellnhofer)
- Bug Fixes:
Revert "Support xmlTextReaderNextSibling w/o preparsed doc" (Nick Wellnhofer),
Fix building relative URIs (Thomas Holder),
Problem with data in interleave in RelaxNG validation (Nikolai Weibull),
Fix memory leak in xmlSwitchInputEncodingInt error path (Nick Wellnhofer),
Set doc on element obtained from freeElems (Nick Wellnhofer),
Fix HTML serialization with UTF-8 encoding (Nick Wellnhofer),
Use actual doc in xmlTextReaderRead*Xml (Nick Wellnhofer),
Unlink node before freeing it in xmlSAX2StartElement (Nick Wellnhofer),
Check return value of nodePush in xmlSAX2StartElement (Nick Wellnhofer),
Free input buffer in xmlHaltParser (Nick Wellnhofer),
Reset HTML parser input pointers on encoding failure (Nick Wellnhofer),
Don't run icu_parse_test if EUC-JP is unsupported (Nick Wellnhofer),
Fix xmlSchemaValidCtxtPtr reuse memory leak (Greg Hildstrom),
Fix xmlTextReaderNext with preparsed document (Felix Bünemann),
Remove stray character from comment (Nick Wellnhofer),
Remove a misleading line from xmlCharEncOutput (Andrey Bienkowski),
HTML noscript should not close p (Daniel Veillard),
Don't change context node in xmlXPathRoot (Nick Wellnhofer),
Stop using XPATH_OP_RESET (Nick Wellnhofer),
Revert "Change calls to xmlCharEncInput to set flush false" (Nick Wellnhofer)
- Improvements:
Fix "Problem with data in interleave in RelaxNG validation" (Nikolai Weibull),
cleanup: remove some unreachable code (Thomas Holder),
add --relative to testURI (Thomas Holder),
Remove redefined starts and defines inside include elements (Nikolai Weibull),
Allow choice within choice in nameClass in RELAX NG (Nikolai Weibull),
Look inside divs for starts and defines inside include (Nikolai Weibull),
Add compile and libxml2-config.cmake to .gitignore (Nikolai Weibull),
Stop using doc->charset outside parser code (Nick Wellnhofer),
Add newlines to 'xmllint --xpath' output (Nick Wellnhofer),
Don't include SAX.h from globals.h (Nick Wellnhofer),
Support xmlTextReaderNextSibling w/o preparsed doc (Felix Bünemann),
Don't instruct user to run make when autogen.sh failed (林博仁(Buo-ren Lin)),
Run Travis ASan tests with "sudo: required" (Nick Wellnhofer),
Improve restoring of context size and position (Nick Wellnhofer),
Simplify and harden nodeset filtering (Nick Wellnhofer),
Avoid unnecessary backups of the context node (Nick Wellnhofer),
Fix inconsistency in xmlXPathIsInf (Nick Wellnhofer)
- Cleanups:
v2.9.8: Mar 05 2018:
- Portability:
python: remove single use of _PyVerify_fd (Patrick Welche),
Build more test executables on Windows/MSVC (Nick Wellnhofer),
Stop including ansidecl.h (Nick Wellnhofer),
Fix libz and liblzma detection (Nick Wellnhofer),
Revert "Compile testapi with -Wno-unused-function" (Nick Wellnhofer)
- Bug Fixes:
Fix xmlParserEntityCheck (Nick Wellnhofer),
Halt parser in case of encoding error (Nick Wellnhofer),
Clear entity content in case of errors (Nick Wellnhofer),
Change calls to xmlCharEncInput to set flush false when not final call. Having flush incorrectly set to true causes errors for ICU. (Joel Hockey),
Fix buffer over-read in xmlParseNCNameComplex (Nick Wellnhofer),
Fix ICU library filenames on Windows/MSVC (Nick Wellnhofer),
Fix xmlXPathIsNaN broken by recent commit (Nick Wellnhofer),
Fix -Wenum-compare warnings (Nick Wellnhofer),
Fix callback signature in testapi.c (Nick Wellnhofer),
Fix unused parameter warning without ICU (Nick Wellnhofer),
Fix IO callback signatures (Nick Wellnhofer),
Fix misc callback signatures (Nick Wellnhofer),
Fix list callback signatures (Nick Wellnhofer),
Fix hash callback signatures (Nick Wellnhofer),
Refactor name and type signature for xmlNop (Vlad Tsyrklevich),
Fixed ICU to set flush correctly and provide pivot buffer. (Joel Hockey),
Skip EBCDIC tests if EBCDIC isn't supported (Nick Wellnhofer)
- Improvements:
Disable pointer-overflow UBSan checks under Travis (Nick Wellnhofer),
Improve handling of context input_id (Daniel Veillard),
Add resource file to Windows DLL (ccpaging),
Run Travis tests with -Werror (Nick Wellnhofer),
Build with "-Wall -Wextra" (Nick Wellnhofer),
Fix -Wtautological-pointer-compare warnings (Nick Wellnhofer),
Remove unused AC_CHECKs (Nick Wellnhofer),
Update information about contributing (Nick Wellnhofer),
Fix -Wmisleading-indentation warnings (Nick Wellnhofer),
Don't touch CFLAGS in configure.ac (Nick Wellnhofer),
Ignore function pointer cast warnings (Nick Wellnhofer),
Simplify XPath NaN, inf and -0 handling (Nick Wellnhofer),
Introduce xmlPosixStrdup and update xmlMemStrdup (Nick Wellnhofer),
Add test for ICU flush and pivot buffer (Nick Wellnhofer),
Compile testapi with -Wno-unused-function (Nick Wellnhofer)
2.9.7: Nov 02 2017:
- Documentation:
xmlcatalog: refresh man page wrt. querying system catalog easily (Jan Pokorný)
- Portability:
Fix deprecated Travis compiler flag (Nick Wellnhofer),
Add declaration for DllMain (J. Peter Mugaas),
Fix preprocessor conditional in threads.h (J. Peter Mugaas),
Fix pointer comparison warnings on 64-bit Windows (J. Peter Mugaas),
Fix macro redefinition warning (J. Peter Mugaas),
Default to native threads on MinGW-w64 (Nick Wellnhofer),
Simplify Windows IO functions (Nick Wellnhofer),
Fix runtest on Windows (Nick Wellnhofer),
socklen_t is always int on Windows (Nick Wellnhofer),
Don't redefine socket error codes on Windows (Nick Wellnhofer),
Fix pointer/int cast warnings on 64-bit Windows (Nick Wellnhofer),
Fix Windows compiler warnings in xmlCanonicPath (Nick Wellnhofer)
- Bug Fixes:
xmlcatalog: restore ability to query system catalog easily (Jan Pokorný),
Fix comparison of nodesets to strings (Nick Wellnhofer)
- Improvements:
Add Makefile rules to rebuild HTML man pages (Nick Wellnhofer),
Fix mixed decls and code in timsort.h (Nick Wellnhofer),
Rework handling of return values in thread tests (Nick Wellnhofer),
Fix unused variable warnings in testrecurse (Nick Wellnhofer),
Fix -Wimplicit-fallthrough warnings (J. Peter Mugaas),
Upgrade timsort.h to latest revision (Nick Wellnhofer),
Increase warning level to /W3 under MSVC (Nick Wellnhofer),
Fix a couple of warnings in dict.c and threads.c (Nick Wellnhofer),
Update .gitignore for Windows (Nick Wellnhofer),
Fix unused variable warnings in nanohttp.c (Nick Wellnhofer),
Fix the Windows header mess (Nick Wellnhofer),
Don't include winsock2.h in xmllint.c (Nick Wellnhofer),
Remove generated file python/setup.py from version control (Nick Wellnhofer),
Use __linux__ macro in generated code (Nick Wellnhofer)
v2.9.6: Oct 06 2017:
- Portability:
Change preprocessor OS tests to __linux__ (Nick Wellnhofer)
- Bug Fixes:
Fix XPath stack frame logic (Nick Wellnhofer),
Report undefined XPath variable error message (Nick Wellnhofer),
Fix regression with librsvg (Nick Wellnhofer),
Handle more invalid entity values in recovery mode (Nick Wellnhofer),
Fix structured validation errors (Nick Wellnhofer),
Fix memory leak in LZMA decompressor (Nick Wellnhofer),
Set memory limit for LZMA decompression (Nick Wellnhofer),
Handle illegal entity values in recovery mode (Nick Wellnhofer),
Fix debug dump of streaming XPath expressions (Nick Wellnhofer),
Fix memory leak in nanoftp (Nick Wellnhofer),
Fix memory leaks in SAX1 parser (Nick Wellnhofer)
v2.9.5: Sep 04 2017:
- Security:
Detect infinite recursion in parameter entities (Nick Wellnhofer),
Fix handling of parameter-entity references (Nick Wellnhofer),
Disallow namespace nodes in XPointer ranges (Nick Wellnhofer),
Fix XPointer paths beginning with range-to (Nick Wellnhofer)
- Documentation:
Documentation fixes (Nick Wellnhofer),
Spelling and grammar fixes (Nick Wellnhofer)
- Portability:
Adding README.zOS to list of extra files for the release (Daniel Veillard),
Description of work needed to compile on zOS (Stéphane Michaut),
Porting libxml2 on zOS encoding of code (Stéphane Michaut),
small changes for OS/400 (Patrick Monnerat),
relaxng.c, xmlschemas.c: Fix build on pre-C99 compilers (Chun-wei Fan)
- Bug Fixes:
Problem resolving relative URIs (Daniel Veillard),
Fix unwanted warnings when switching encodings (Nick Wellnhofer),
Fix signature of xmlSchemaAugmentImportedIDC (Daniel Veillard),
Heap-buffer-overflow read of size 1 in xmlFAParsePosCharGroup (David Kilzer),
Fix NULL pointer deref in xmlFAParseCharClassEsc (Nick Wellnhofer),
Fix infinite loops with push parser in recovery mode (Nick Wellnhofer),
Send xmllint usage error to stderr (Nick Wellnhofer),
Fix NULL deref in xmlParseExternalEntityPrivate (Nick Wellnhofer),
Make sure not to call IS_BLANK_CH when parsing the DTD (Nick Wellnhofer),
Fix xmlHaltParser (Nick Wellnhofer),
Fix pathological performance when outputting charrefs (Nick Wellnhofer),
Fix invalid-source-encoding warnings in testWriter.c (Nick Wellnhofer),
Fix duplicate SAX callbacks for entity content (David Kilzer),
Treat URIs with scheme as absolute in C14N (Nick Wellnhofer),
Fix copy-paste errors in error messages (Nick Wellnhofer),
Fix sanity check in htmlParseNameComplex (Nick Wellnhofer),
Fix potential infinite loop in xmlStringLenDecodeEntities (Nick Wellnhofer),
Reset parser input pointers on encoding failure (Nick Wellnhofer),
Fix memory leak in xmlParseEntityDecl error path (Nick Wellnhofer),
Fix xmlBuildRelativeURI for URIs starting with './' (Nick Wellnhofer),
Fix type confusion in xmlValidateOneNamespace (Nick Wellnhofer),
Fix memory leak in xmlStringLenGetNodeList (Nick Wellnhofer),
Fix NULL pointer deref in xmlDumpElementContent (Daniel Veillard),
Fix memory leak in xmlBufAttrSerializeTxtContent (Nick Wellnhofer),
Stop parser on unsupported encodings (Nick Wellnhofer),
Check for integer overflow in memory debug code (Nick Wellnhofer),
Fix buffer size checks in xmlSnprintfElementContent (Nick Wellnhofer),
Avoid reparsing in xmlParseStartTag2 (Nick Wellnhofer),
Fix undefined behavior in xmlRegExecPushStringInternal (Nick Wellnhofer),
Check XPath exponents for overflow (Nick Wellnhofer),
Check for overflow in xmlXPathIsPositionalPredicate (Nick Wellnhofer),
Fix spurious error message (Nick Wellnhofer),
Fix memory leak in xmlCanonicPath (Nick Wellnhofer),
Fix memory leak in xmlXPathCompareNodeSetValue (Nick Wellnhofer),
Fix memory leak in pattern error path (Nick Wellnhofer),
Fix memory leak in parser error path (Nick Wellnhofer),
Fix memory leaks in XPointer error paths (Nick Wellnhofer),
Fix memory leak in xmlXPathNodeSetMergeAndClear (Nick Wellnhofer),
Fix memory leak in XPath filter optimizations (Nick Wellnhofer),
Fix memory leaks in XPath error paths (Nick Wellnhofer),
Do not leak the new CData node if adding fails (David Tardon),
Prevent unwanted external entity reference (Neel Mehta),
Increase buffer space for port in HTTP redirect support (Daniel Veillard),
Fix more NULL pointer derefs in xpointer.c (Nick Wellnhofer),
Avoid function/data pointer conversion in xpath.c (Nick Wellnhofer),
Fix format string warnings (Nick Wellnhofer),
Disallow namespace nodes in XPointer points (Nick Wellnhofer),
Fix comparison with root node in xmlXPathCmpNodes (Nick Wellnhofer),
Fix attribute decoding during XML schema validation (Alex Henrie),
Fix NULL pointer deref in XPointer range-to (Nick Wellnhofer)
- Improvements:
Updating the spec file to reflect Fedora 24 (Daniel Veillard),
Add const in five places to move 1 KiB to .rdata (Bruce Dawson),
Fix missing part of comment for function xmlXPathEvalExpression() (Daniel Veillard),
Get rid of "blanks wrapper" for parameter entities (Nick Wellnhofer),
Simplify handling of parameter entity references (Nick Wellnhofer),
Deduplicate code in encoding.c (Nick Wellnhofer),
Make HTML parser functions take const pointers (Nick Wellnhofer),
Build test programs only when needed (Nick Wellnhofer),
Fix doc/examples/index.py (Nick Wellnhofer),
Fix compiler warnings in threads.c (Nick Wellnhofer),
Fix empty-body warning in nanohttp.c (Nick Wellnhofer),
Fix cast-align warnings (Nick Wellnhofer),
Fix unused-parameter warnings (Nick Wellnhofer),
Rework entity boundary checks (Nick Wellnhofer),
Don't switch encoding for internal parameter entities (Nick Wellnhofer),
Merge duplicate code paths handling PE references (Nick Wellnhofer),
Test SAX2 callbacks with entity substitution (Nick Wellnhofer),
Support catalog and threads tests under --without-sax1 (Nick Wellnhofer),
Misc fixes for 'make tests' (Nick Wellnhofer),
Initialize keepBlanks in HTML parser (Nick Wellnhofer),
Add test cases for bug 758518 (David Kilzer),
Fix compiler warning in htmlParseElementInternal (Nick Wellnhofer),
Remove useless check in xmlParseAttributeListDecl (Nick Wellnhofer),
Allow zero sized memory input buffers (Nick Wellnhofer),
Add TODO comment in xmlSwitchEncoding (Nick Wellnhofer),
Check for integer overflow in xmlXPathFormatNumber (Nick Wellnhofer),
Make Travis print UBSan stacktraces (Nick Wellnhofer),
Add .travis.yml (Nick Wellnhofer),
Fix expected error output in Python tests (Nick Wellnhofer),
Simplify control flow in xmlParseStartTag2 (Nick Wellnhofer),
Disable LeakSanitizer when running API tests (Nick Wellnhofer),
Avoid out-of-bound array access in API tests (Nick Wellnhofer),
Avoid spurious UBSan errors in parser.c (Nick Wellnhofer),
Parse small XPath numbers more accurately (Nick Wellnhofer),
Rework XPath rounding functions (Nick Wellnhofer),
Fix white space in test output (Nick Wellnhofer),
Fix axis traversal from attribute and namespace nodes (Nick Wellnhofer),
Check for trailing characters in XPath expressions earlier (Nick Wellnhofer),
Rework final handling of XPath results (Nick Wellnhofer),
Make xmlXPathEvalExpression call xmlXPathEval (Nick Wellnhofer),
Remove unused variables (Nick Wellnhofer),
Don't print generic error messages in XPath tests (Nick Wellnhofer)
- Cleanups:
Fix a couple of misleading indentation errors (Daniel Veillard),
Remove unnecessary calls to xmlPopInput (Nick Wellnhofer)
2.9.4: May 23 2016:
- Security:
More format string warnings with possible format string vulnerability (David Kilzer),
Avoid building recursive entities (Daniel Veillard),
Heap-based buffer overread in htmlCurrentChar (Pranjal Jumde),
Heap-based buffer-underreads due to xmlParseName (David Kilzer),
Heap use-after-free in xmlSAX2AttributeNs (Pranjal Jumde),
Heap use-after-free in htmlParsePubidLiteral and htmlParseSystemiteral (Pranjal Jumde),
Fix some format string warnings with possible format string vulnerability (David Kilzer),
Detect change of encoding when parsing HTML names (Hugh Davenport),
Fix inappropriate fetch of entities content (Daniel Veillard),
Bug 759398: Heap use-after-free in xmlDictComputeFastKey <https://bugzilla.gnome.org/show_bug.cgi?id=759398> (Pranjal Jumde),
Bug 758605: Heap-based buffer overread in xmlDictAddString <https://bugzilla.gnome.org/show_bug.cgi?id=758605> (Pranjal Jumde),
Bug 758588: Heap-based buffer overread in xmlParserPrintFileContextInternal <https://bugzilla.gnome.org/show_bug.cgi?id=758588> (David Kilzer),
Bug 757711: heap-buffer-overflow in xmlFAParsePosCharGroup <https://bugzilla.gnome.org/show_bug.cgi?id=757711> (Pranjal Jumde),
Add missing increments of recursion depth counter to XML parser. (Peter Simons)
- Documentation:
Fix typo: s{ ec -> cr }cipt (Jan Pokorný),
Fix typos: dictio{ nn -> n }ar{y,ies} (Jan Pokorný),
Fix typos: PATH_{ SEAPARATOR -> SEPARATOR } (Jan Pokorný),
Correct a typo. (Shlomi Fish)
- Portability:
Correct the usage of LDFLAGS (Mattias Hansson),
Revert the use of SAVE_LDFLAGS in configure.ac (Mattias Hansson),
libxml2 hardcodes -L/lib in zlib/lzma tests which breaks cross-compiles (Mike Frysinger),
Fix apibuild for a recently added construct (Daniel Veillard),
Use pkg-config to locate zlib when possible (Stewart Brodie),
Use pkg-config to locate ICU when possible (Stewart Brodie),
Portability to non C99 compliant compilers (Patrick Monnerat),
dict.h: Move xmlDictPtr definition before includes to allow direct inclusion. (Patrick Monnerat),
os400: tell about xmllint and xmlcatalog in README400. (Patrick Monnerat),
os400: properly process SGML add in XMLCATALOG command. (Patrick Monnerat),
os400: implement CL command XMLCATALOG. (Patrick Monnerat),
os400: compile and install program xmlcatalog (qshell-only). (Patrick Monnerat),
os400: expand tabs in sources, strip trailing blanks. (Patrick Monnerat),
os400: implement CL command XMLLINT. (Patrick Monnerat),
os400: compile and install program xmllint (qshell-only). (Patrick Monnerat),
os400: initscript make_module(): Use options instead of positional parameters. (Patrick Monnerat),
os400: c14n.rpgle: allow *omit for nullable reference parameters. (Patrick Monnerat),
os400: use like() for double type. (Patrick Monnerat),
os400: use like() for int type. (Patrick Monnerat),
os400: use like() for unsigned int type. (Patrick Monnerat),
os400: use like() for enum types. (Patrick Monnerat),
Add xz to xml2-config --libs output (Baruch Siach),
Bug 760190: configure.ac should be able to build --with-icu without icu-config tool <https://bugzilla.gnome.org/show_bug.cgi?id=760190> (David Kilzer),
win32\VC10\config.h and VS 2015 (Bruce Dawson),
Add configure maintainer mode (orzen)
- Bug Fixes:
Avoid an out of bound access when serializing malformed strings (Daniel Veillard),
Unsigned addition may overflow in xmlMallocAtomicLoc() (David Kilzer),
Integer signed/unsigned type mismatch in xmlParserInputGrow() (David Kilzer),
Bug 763071: heap-buffer-overflow in xmlStrncat <https://bugzilla.gnome.org/show_bug.cgi?id=763071> (Pranjal Jumde),
Integer overflow parsing port number in URI (Michael Paddon),
Fix an error with regexp on nullable counted char transition (Daniel Veillard),
Fix memory leak with XPath namespace nodes (Nick Wellnhofer),
Fix namespace axis traversal (Nick Wellnhofer),
Fix null pointer deref in docs with no root element (Hugh Davenport),
Fix XSD validation of URIs with ampersands (Alex Henrie),
xmlschemastypes.c: accept endOfDayFrag Times set to "24:00:00" mean "end of day" and should not cause an error. (Patrick Monnerat),
xmlcatalog: flush stdout before interactive shell input. (Patrick Monnerat),
xmllint: flush stdout before interactive shell input. (Patrick Monnerat),
Don't recurse into OP_VALUEs in xmlXPathOptimizeExpression (Nick Wellnhofer),
Fix namespace::node() XPath expression (Nick Wellnhofer),
Fix OOB write in xmlXPathEmptyNodeSet (Nick Wellnhofer),
Fix parsing of NCNames in XPath (Nick Wellnhofer),
Fix OOB read with invalid UTF-8 in xmlUTF8Strsize (Nick Wellnhofer),
Do normalize string-based datatype value in RelaxNG facet checking (Audric Schiltknecht),
Bug 760921: REGRESSION (8eb55d78): doc/examples/io1 test fails after fix for "xmlSaveUri() incorrectly recomposes URIs with rootless paths" <https://bugzilla.gnome.org/show_bug.cgi?id=760921> (David Kilzer),
Bug 760861: REGRESSION (bf9c1dad): Missing results for test/schemas/regexp-char-ref_[01].xsd <https://bugzilla.gnome.org/show_bug.cgi?id=760861> (David Kilzer),
error.c: *input->cur == 0 does not mean no error (Pavel Raiskup),
Add missing RNG test files (David Kilzer),
Bug 760183: REGRESSION (v2.9.3): XML push parser fails with bogus UTF-8 encoding error when multi-byte character in large CDATA section is split across buffer <https://bugzilla.gnome.org/show_bug.cgi?id=760183> (David Kilzer),
Bug 758572: ASAN crash in make check <https://bugzilla.gnome.org/show_bug.cgi?id=758572> (David Kilzer),
Bug 721158: Missing ICU string when doing --version on xmllint <https://bugzilla.gnome.org/show_bug.cgi?id=721158> (David Kilzer),
python 3: libxml2.c wrappers create Unicode str already (Michael Stahl),
Add autogen.sh to distrib (orzen),
Heap-based buffer overread in xmlNextChar (Daniel Veillard)
- Improvements:
Add more debugging info to runtest (Daniel Veillard),
Implement "runtest -u" mode (David Kilzer),
Add a make rule to rebuild for ASAN (Daniel Veillard)
v2.9.3: Nov 20 2015:
- Security:
CVE-2015-8242 Buffer overead with HTML parser in push mode (Hugh Davenport),
CVE-2015-7500 Fix memory access error due to incorrect entities boundaries (Daniel Veillard),
CVE-2015-7499-2 Detect incoherency on GROW (Daniel Veillard),
CVE-2015-7499-1 Add xmlHaltParser() to stop the parser (Daniel Veillard),
CVE-2015-5312 Another entity expansion issue (David Drysdale),
CVE-2015-7497 Avoid an heap buffer overflow in xmlDictComputeFastQKey (David Drysdale),
CVE-2015-7498 Avoid processing entities after encoding conversion failures (Daniel Veillard),
CVE-2015-8035 Fix XZ compression support loop (Daniel Veillard),
CVE-2015-7942-2 Fix an error in previous Conditional section patch (Daniel Veillard),
CVE-2015-7942 Another variation of overflow in Conditional sections (Daniel Veillard),
CVE-2015-1819 Enforce the reader to run in constant memory (Daniel Veillard)
CVE-2015-7941_2 Cleanup conditional section error handling (Daniel Veillard),
CVE-2015-7941_1 Stop parsing on entities boundaries errors (Daniel Veillard),
- Documentation:
Correct spelling of "calling" (Alex Henrie),
Fix a small error in xmllint --format description (Fabien Degomme),
Avoid XSS on the search of xmlsoft.org (Daniel Veillard)
- Portability:
threads: use forward declarations only for glibc (Michael Heimpold),
Update Win32 configure.js to search for configure.ac (Daniel Veillard)
- Bug Fixes:
Bug on creating new stream from entity (Daniel Veillard),
Fix some loop issues embedding NEXT (Daniel Veillard),
Do not print error context when there is none (Daniel Veillard),
Avoid extra processing of MarkupDecl when EOF (Hugh Davenport),
Fix parsing short unclosed comment uninitialized access (Daniel Veillard),
Add missing Null check in xmlParseExternalEntityPrivate (Gaurav Gupta),
Fix a bug in CData error handling in the push parser (Daniel Veillard),
Fix a bug on name parsing at the end of current input buffer (Daniel Veillard),
Fix the spurious ID already defined error (Daniel Veillard),
Fix previous change to node sort order (Nick Wellnhofer),
Fix a self assignment issue raised by clang (Scott Graham),
Fail parsing early on if encoding conversion failed (Daniel Veillard),
Do not process encoding values if the declaration if broken (Daniel Veillard),
Silence clang's -Wunknown-attribute (Michael Catanzaro),
xmlMemUsed is not thread-safe (Martin von Gagern),
Fix support for except in nameclasses (Daniel Veillard),
Fix order of root nodes (Nick Wellnhofer),
Allow attributes on descendant-or-self axis (Nick Wellnhofer),
Fix the fix to Windows locking (Steve Nairn),
Fix timsort invariant loop re: Envisage article (Christopher Swenson),
Don't add IDs in xmlSetTreeDoc (Nick Wellnhofer),
Account for ID attributes in xmlSetTreeDoc (Nick Wellnhofer),
Remove various unused value assignments (Philip Withnall),
Fix missing entities after CVE-2014-3660 fix (Daniel Veillard),
Revert "Missing initialization for the catalog module" (Daniel Veillard)
- Improvements:
Reuse xmlHaltParser() where it makes sense (Daniel Veillard),
xmlStopParser reset errNo (Daniel Veillard),
Re-enable xz support by default (Daniel Veillard),
Recover unescaped less-than character in HTML recovery parsing (Daniel Veillard),
Allow HTML serializer to output HTML5 DOCTYPE (Shaun McCance),
Regression test for bug #695699 (Nick Wellnhofer),
Add a couple of XPath tests (Nick Wellnhofer),
Add Python 3 rpm subpackage (Tomas Radej),
libxml2-config.cmake.in: update include directories (Samuel Martin),
Adding example from bugs 738805 to regression tests (Daniel Veillard)
- Cleanups:
2.9.2: Oct 16 2014:
- Security:
Fix for CVE-2014-3660 billion laugh variant (Daniel Veillard),
CVE-2014-0191 Do not fetch external parameter entities (Daniel Veillard)
- Bug Fixes:
fix memory leak xml header encoding field with XML_PARSE_IGNORE_ENC (Bart De Schuymer),
xmlmemory: handle realloc properly (Yegor Yefremov),
Python generator bug raised by the const change (Daniel Veillard),
Windows Critical sections not released correctly (Daniel Veillard),
Parser error on repeated recursive entity expansion containing < (Daniel Veillard),
xpointer : fixing Null Pointers (Gaurav Gupta),
Remove Unnecessary Null check in xpointer.c (Gaurav Gupta),
parser bug on misformed namespace attributes (Dennis Filder),
Pointer dereferenced before null check (Daniel Veillard),
Leak of struct addrinfo in xmlNanoFTPConnect() (Gaurav Gupta),
Possible overflow in HTMLParser.c (Daniel Veillard),
python/tests/sync.py assumes Python dictionaries are ordered (John Beck),
Fix Enum check and missing break (Gaurav Gupta),
xmlIO: Handle error returns from dup() (Philip Withnall),
Fix a problem properly saving URIs (Daniel Veillard),
wrong error column in structured error when parsing attribute values (Juergen Keil),
wrong error column in structured error when skipping whitespace in xml decl (Juergen Keil),
no error column in structured error handler for xml schema validation errors (Juergen Keil),
Couple of Missing Null checks (Gaurav Gupta),
Add couple of missing Null checks (Daniel Veillard),
xmlschemastypes: Fix potential array overflow (Philip Withnall),
runtest: Fix a memory leak on parse failure (Philip Withnall),
xmlIO: Fix an FD leak on gzdopen() failure (Philip Withnall),
xmlcatalog: Fix a memory leak on quit (Philip Withnall),
HTMLparser: Correctly initialise a stack allocated structure (Philip Withnall),
Check for tmon in _xmlSchemaDateAdd() is incorrect (David Kilzer),
Avoid Possible Null Pointer in trio.c (Gaurav Gupta),
Fix processing in SAX2 in case of an allocation failure (Daniel Veillard),
XML Shell command "cd" does not handle "/" at end of path (Daniel Veillard),
Fix various Missing Null checks (Gaurav Gupta),
Fix a potential NULL dereference (Daniel Veillard),
Add a couple of misisng check in xmlRelaxNGCleanupTree (Gaurav Gupta),
Add a missing argument check (Gaurav Gupta),
Adding a check in case of allocation error (Gaurav Gupta),
xmlSaveUri() incorrectly recomposes URIs with rootless paths (Dennis Filder),
Adding some missing NULL checks (Gaurav),
Fixes for xmlInitParserCtxt (Daniel Veillard),
Fix regressions introduced by CVE-2014-0191 patch (Daniel Veillard),
erroneously ignores a validation error if no error callback set (Daniel Veillard),
xmllint was not parsing the --c14n11 flag (Sérgio Batista),
Avoid Possible null pointer dereference in memory debug mode (Gaurav),
Avoid Double Null Check (Gaurav),
Restore context size and position after XPATH_OP_ARG (Nick Wellnhofer),
Fix xmlParseInNodeContext() if node is not element (Daniel Veillard),
Avoid a possible NULL pointer dereference (Gaurav),
Fix xmlTextWriterWriteElement when a null content is given (Daniel Veillard),
Fix an typo 'onrest' in htmlScriptAttributes (Daniel Veillard),
fixing a ptotential uninitialized access (Daniel Veillard),
Fix an fd leak in an error case (Daniel Veillard),
Missing initialization for the catalog module (Daniel Veillard),
Handling of XPath function arguments in error case (Nick Wellnhofer),
Fix a couple of missing NULL checks (Gaurav),
Avoid a possibility of dangling encoding handler (Gaurav),
Fix HTML push parser to accept HTML_PARSE_NODEFDTD (Arnold Hendriks),
Fix a bug loading some compressed files (Mike Alexander),
Fix XPath node comparison bug (Gaurav),
Type mismatch in xmlschemas.c (Gaurav),
Type mismatch in xmlschemastypes.c (Gaurav),
Avoid a deadcode in catalog.c (Daniel Veillard),
run close socket on Solaris, same as we do on other platforms (Denis Pauk),
Fix pointer dereferenced before null check (Gaurav),
Fix a potential NULL dereference in tree code (Daniel Veillard),
Fix potential NULL pointer dereferences in regexp code (Gaurav),
xmllint --pretty crashed without following numeric argument (Tim Galeckas),
Fix XPath expressions of the form '@ns:*' (Nick Wellnhofer),
Fix XPath '//' optimization with predicates (Nick Wellnhofer),
Clear up a potential NULL dereference (Daniel Veillard),
Fix a possible NULL dereference (Gaurav),
Avoid crash if allocation fails (Daniel Veillard),
Remove occasional leading space in XPath number formatting (Daniel Veillard),
Fix handling of mmap errors (Daniel Veillard),
Catch malloc error and exit accordingly (Daniel Veillard),
missing else in xlink.c (Ami Fischman),
Fix a parsing bug on non-ascii element and CR/LF usage (Daniel Veillard),
Fix a regression in xmlGetDocCompressMode() (Daniel Veillard),
properly quote the namespace uris written out during c14n (Aleksey Sanin),
Remove premature XInclude check on URI being relative (Alexey Neyman),
Fix missing break on last() function for attributes (dcb),
Do not URI escape in server side includes (Romain Bondue),
Fix an error in xmlCleanupParser (Alexander Pastukhov)
- Documentation:
typo in error messages "colon are forbidden from..." (Daniel Veillard),
Fix a link to James SAX documentation old page (Daniel Veillard),
Fix typos in relaxng.c (Jan Pokorný),
Fix a doc typo (Daniel Veillard),
Fix typos in {tree,xpath}.c (errror) (Jan Pokorný),
Add limitations about encoding conversion (Daniel Veillard),
Fix typos in xmlschemas{,types}.c (Jan Pokorný),
Fix incorrect spelling entites->entities (Jan Pokorný),
Forgot to document 2.9.1 release, regenerate docs (Daniel Veillard)
- Portability:
AC_CONFIG_FILES and executable bit (Roumen Petrov),
remove HAVE_CONFIG_H dependency in testlimits.c (Roumen Petrov),
fix some tabs mixing incompatible with python3 (Roumen Petrov),
Visual Studio 14 CTP defines snprintf() (Francis Dupont),
OS400: do not try to copy unexisting doc files (Patrick Monnerat),
OS400: use either configure.ac or configure.in. (Patrick Monnerat),
os400: make-src.sh: create physical file with target CCSID (Patrick Monnerat),
OS400: Add some more C macros equivalent procedures. (Patrick Monnerat),
OS400: use C macros to implement equivalent RPG support procedures. (Patrick Monnerat),
OS400: implement XPath macros as procedures for ILE/RPG support. (Patrick Monnerat),
OS400: include in distribution tarball. (Patrick Monnerat),
OS400: Add README: compilation directives and OS/400 specific stuff. (Patrick Monnerat),
OS400: Add compilation scripts. (Patrick Monnerat),
OS400: ILE RPG language header files. (Patrick Monnerat),
OS400: implement some macros as functions for ILE/RPG language support (that as no macros). (Patrick Monnerat),
OS400: UTF8<-->EBCDIC wrappers for system and external library calls (Patrick Monnerat),
OS400: Easy character transcoding support (Patrick Monnerat),
OS400: iconv functions compatibility wrappers and table builder. (Patrick Monnerat),
OS400: create architecture directory. Implement dlfcn emulation. (Patrick Monnerat),
Fix building when configuring without xpath and xptr (Daniel Veillard),
configure: Add --with-python-install-dir (Jonas Eriksson),
Fix compilation with minimum and xinclude. (Nicolas Le Cam),
Compile out use of xmlValidateNCName() when not available. (Nicolas Le Cam),
Fix compilation with minimum and schematron. (Nicolas Le Cam),
Legacy needs xmlSAX2StartElement() and xmlSAX2EndElement(). (Nicolas Le Cam),
Don't use xmlValidateName() when not available. (Nicolas Le Cam),
Fix a portability issue on Windows (Longstreth Jon),
Various portability patches for OpenVMS (Jacob (Jouk) Jansen),
Use specific macros for portability to OS/400 (Patrick Monnerat),
Add macros needed for OS/400 portability (Patrick Monnerat),
Portability patch for fopen on OS/400 (Patrick Monnerat),
Portability fixes for OS/400 (Patrick Monnerat),
Improve va_list portability (Patrick Monnerat),
Portability fix (Patrick Monnerat),
Portability fix (Patrick Monnerat),
Generic portability fix (Patrick Monnerat),
Shortening lines in headers (Patrick Monnerat),
build: Use pkg-config to find liblzma in preference to AC_CHECK_LIB (Philip Withnall),
build: Add @LZMA_LIBS@ to libxml’s pkg-config files (Philip Withnall),
fix some tabs mixing incompatible with python3 (Daniel Veillard),
add additional defines checks for support "./configure --with-minimum" (Denis Pauk),
Another round of fixes for older versions of Python (Arfrever Frehtes Taifersar Arahesis),
python: fix drv_libxml2.py for python3 compatibility (Alexandre Rostovtsev),
python: Fix compiler warnings when building python3 bindings (Armin K),
Fix for compilation with python 2.6.8 (Petr Sumbera)
- Improvements:
win32/libxml2.def.src after rebuild in doc (Roumen Petrov),
elfgcchack.h: more legacy needs xmlSAX2StartElement() and xmlSAX2EndElement() (Roumen Petrov),
elfgcchack.h: add xmlXPathNodeEval and xmlXPathSetContextNode (Roumen Petrov),
Provide cmake module (Samuel Martin),
Fix a couple of issues raised by make dist (Daniel Veillard),
Fix and add const qualifiers (Kurt Roeckx),
Preparing for upcoming release of 2.9.2 (Daniel Veillard),
Fix zlib and lzma libraries check via command line (Dmitriy),
wrong error column in structured error when parsing end tag (Juergen Keil),
doc/news.html: small update to avoid line join while generating NEWS. (Patrick Monnerat),
Add methods for python3 iterator (Ron Angeles),
Support element node traversal in document fragments. (Kyle VanderBeek),
xmlNodeSetName: Allow setting the name to a substring of the currently set name (Tristan Van Berkom),
Added macros for argument casts (Eric Zurcher),
adding init calls to xml and html Read parsing entry points (Daniel Veillard),
Get rid of 'REPLACEMENT CHARACTER' Unicode chars in xmlschemas.c (Jan Pokorný),
Implement choice for name classes on attributes (Shaun McCance),
Two small namespace tweaks (Daniel Veillard),
xmllint --memory should fail on empty files (Daniel Veillard),
Cast encoding name to char pointer to match arg type (Nikolay Sivov)
- Cleanups:
Removal of old configure.in (Daniel Veillard),
Unreachable code in tree.c (Gaurav Gupta),
Remove a couple of dead conditions (Gaurav Gupta),
Avoid some dead code and cleanup in relaxng.c (Gaurav),
Drop not needed checks (Denis Pauk),
Fix a wrong test (Daniel Veillard)
2.9.1: Apr 19 2013:
- Features:
Support for Python3 (Daniel Veillard),
Add xmlXPathSetContextNode and xmlXPathNodeEval (Alex Bligh)
- Documentation:
Add documentation for xmllint --xpath (Daniel Veillard),
Fix the URL of the SAX documentation from James (Daniel Veillard),
Fix spelling of "length". (Michael Wood)
- Portability:
Fix python bindings with versions older than 2.7 (Daniel Veillard),
rebuild docs:Makefile.am (Roumen Petrov),
elfgcchack.h after rebuild in doc (Roumen Petrov),
elfgcchack for buf module (Roumen Petrov),
Fix a uneeded and wrong extra link parameter (Daniel Veillard),
Few cleanup patches for Windows (Denis Pauk),
Fix rpmbuild --nocheck (Mark Salter),
Fix for win32/configure.js and WITH_THREAD_ALLOC (Daniel Richard),
Fix Broken multi-arch support in xml2-config (Daniel Veillard),
Fix a portability issue for GCC < 3.4.0 (Daniel Veillard),
Windows build fixes (Daniel Richard),
Fix a thread portability problem (Friedrich Haubensak),
Downgrade autoconf requirement to 2.63 (Daniel Veillard)
- Bug Fixes:
Fix a linking error for python bindings (Daniel Veillard),
Fix a couple of return without value (Jüri Aedla),
Improve the hashing functions (Daniel Franke),
Improve handling of xmlStopParser() (Daniel Veillard),
Remove risk of lockup in dictionary initialization (Daniel Veillard),
Activate detection of encoding in external subset (Daniel Veillard),
Fix an output buffer flushing conversion bug (Mikhail Titov),
Fix an old bug in xmlSchemaValidateOneElement (Csaba László),
Fix configure cannot remove messages (Gilles Espinasse),
fix schema validation in combination with xsi:nil (Daniel Veillard),
xmlCtxtReadFile doesn't work with literal IPv6 URLs (Steve Wolf),
Fix a few problems with setEntityLoader (Alexey Neyman),
Detect excessive entities expansion upon replacement (Daniel Veillard),
Fix the flushing out of raw buffers on encoding conversions (Daniel,
Veillard),
Fix some buffer conversion issues (Daniel Veillard),
When calling xmlNodeDump make sure we grow the buffer quickly (Daniel,
Veillard),
Fix an error in the progressive DTD parsing code (Dan Winship),
xmllint should not load DTD by default when using the reader (Daniel,
Veillard),
Try IBM-037 when looking for EBCDIC handlers (Petr Sumbera),
Fix potential out of bound access (Daniel Veillard),
Fix large parse of file from memory (Daniel Veillard),
Fix a bug in the nsclean option of the parser (Daniel Veillard),
Fix a regression in 2.9.0 breaking validation while streaming (Daniel,
Veillard),
Remove potential calls to exit() (Daniel Veillard)
- Improvements:
Regenerated API, and testapi, rebuild documentation (Daniel Veillard),
Fix tree iterators broken by 2to3 script (Daniel Veillard),
update all tests for Python3 and Python2 (Daniel Veillard),
A few more fixes for python 3 affecting libxml2.py (Daniel Veillard),
Fix compilation on Python3 (Daniel Veillard),
Converting apibuild.py to python3 (Daniel Veillard),
First pass at starting porting to python3 (Daniel Veillard),
updated configure.in for python3 (Daniel Veillard),
Add support for xpathRegisterVariable in Python (Shaun McCance),
Added a regression tests from bug 694228 data (Daniel Veillard),
Cache presence of '<' in entities content (Daniel Veillard),
Avoid extra processing on entities (Daniel Veillard),
Python binding for xmlRegisterInputCallback (Alexey Neyman),
Python bindings: DOM casts everything to xmlNode (Alexey Neyman),
Define LIBXML_THREAD_ALLOC_ENABLED via xmlversion.h (Tim Starling),
Adding streaming validation to runtest checks (Daniel Veillard),
Add a --pushsmall option to xmllint (Daniel Veillard)
- Cleanups:
Switched comment in file to UTF-8 encoding (Daniel Veillard),
Extend gitignore (Daniel Veillard),
Silent the new python test on input (Alexey Neyman),
Cleanup of a duplicate test (Daniel Veillard),
Cleanup on duplicate test expressions (Daniel Veillard),
Fix compiler warning after 153cf15905cf4ec080612ada6703757d10caba1e (Patrick,
Gansterer),
Spec cleanups and a fix for multiarch support (Daniel Veillard),
Silence a clang warning (Daniel Veillard),
Cleanup the Copyright to be pure MIT Licence wording (Daniel Veillard),
rand_seed should be static in dict.c (Wouter Van Rooy),
Fix typos in parser comments (Jan Pokorný)
2.9.0: Sep 11 2012:
- Features:
A few new API entry points,
More resilient push parser mode,
A lot of portability improvement,
Faster XPath evaluation
- Documentation:
xml2-config.1 markup error (Christian Weisgerber),
libxml(3) manpage typo fix (John Bradshaw),
More cleanups to the documentation part of libxml2 (Daniel Richard G)
- Portability:
Bug 676544 - fails to build with --without-sax1 (Akira TAGOH),
fix builds not having stdint.h (Rob Richards),
GetProcAddressA is available only on WinCE (Daniel Veillard),
More updates and cleanups on autotools and Makefiles (Daniel Richard G),
More changes for Win32 compilation (Eric Zurcher),
Basic changes for Win32 builds of release 2.9.0: compile buf.c (Eric Zurcher),
Bundles all generated files for python into the distribution (Daniel Richard G),
Fix compiler warnings of wincecompat.c (Patrick Gansterer),
Fix non __GNUC__ build (Patrick Gansterer),
Fix windows unicode build (Patrick Gansterer),
clean redefinition of {v}snprintf in C-source (Roumen Petrov),
use xmlBuf... if DEBUG_INPUT is defined (Roumen Petrov),
fix runtests to use pthreads support for various Unix platforms (Daniel Richard G),
Various "make distcheck" and portability fixups 2nd part (Daniel Richard G),
Various "make distcheck" and portability fixups (Daniel Richard G),
Fix compilation on older Visual Studio (Daniel Veillard)
- Bug Fixes:
Change the XPath code to percolate allocation errors (Daniel Veillard),
Fix reuse of xmlInitParser (Daniel Veillard),
Fix potential crash on entities errors (Daniel Veillard),
initialize var (Rob Richards),
Fix the XPath arity check to also check the XPath stack limits (Daniel Veillard),
Fix problem with specific and generic error handlers (Pietro Cerutti),
Avoid a potential infinite recursion (Daniel Veillard),
Fix an XSD error when generating internal automata (Daniel Veillard),
Patch for xinclude of text using multibyte characters (Vitaly Ostanin),
Fix a segfault on XSD validation on pattern error (Daniel Veillard),
Fix missing xmlsave.h module which was ignored in recent builds (Daniel Veillard),
Add a missing element check (Daniel Veillard),
Adding various checks on node type though the API (Daniel Veillard),
Namespace nodes can't be unlinked with xmlUnlinkNode (Daniel Veillard),
Fix make dist to include new private header files (Daniel Veillard),
More fixups on the push parser behaviour (Daniel Veillard),
Strengthen behaviour of the push parser in problematic situations (Daniel Veillard),
Enforce XML_PARSER_EOF state handling through the parser (Daniel Veillard),
Fixup limits parser (Daniel Veillard),
Do not fetch external parsed entities (Daniel Veillard),
Fix an error in previous commit (Aron Xu),
Fix entities local buffers size problems (Daniel Veillard),
Fix parser local buffers size problems (Daniel Veillard),
Fix a failure to report xmlreader parsing failures (Daniel Veillard)
- Improvements:
Keep libxml2.syms when running "make distclean" (Daniel Veillard),
Allow to set the quoting character of an xmlWriter (Csaba Raduly),
Keep non-significant blanks node in HTML parser (Daniel Veillard),
Add a forbidden variable error number and message to XPath (Daniel Veillard),
Support long path names on WNT (Michael Stahl),
Improve HTML escaping of attribute on output (Daniel Veillard),
Handle ICU_LIBS as LIBADD, not LDFLAGS to prevent linking errors (Arfrever Frehtes Taifersar Arahesis),
Switching XPath node sorting to Timsort (Vojtech Fried),
Optimizing '//' in XPath expressions (Nick Wellnhofer),
Expose xmlBufShrink in the public tree API (Daniel Veillard),
Visible HTML elements close the head tag (Conrad Irwin),
Fix file and line report for XSD SAX and reader streaming validation (Daniel Veillard),
Fix const qualifyer to definition of xmlBufferDetach (Daniel Veillard),
minimize use of HAVE_CONFIG_H (Roumen Petrov),
fixup regression in Various "make distcheck" and portability fixups (Roumen Petrov),
Add support for big line numbers in error reporting (Daniel Veillard),
Avoid using xmlBuffer for serialization (Daniel Veillard),
Improve compatibility between xmlBuf and xmlBuffer (Daniel Veillard),
Provide new accessors for xmlOutputBuffer (Daniel Veillard),
Improvements for old buffer compatibility (Daniel Veillard),
Expand the limit test program (Daniel Veillard),
Improve error reporting on parser errors (Daniel Veillard),
Implement some default limits in the XPath module (Daniel Veillard),
Introduce some default parser limits (Daniel Veillard),
Cleanups and new limit APIs for dictionaries (Daniel Veillard),
Fixup for buf.c (Daniel Veillard),
Cleanup URI module memory allocation code (Daniel Veillard),
Extend testlimits (Daniel Veillard),
More avoid quadratic behaviour (Daniel Veillard),
Impose a reasonable limit on PI size (Daniel Veillard),
first version of testlimits new test (Daniel Veillard),
Avoid quadratic behaviour in some push parsing cases (Daniel Veillard),
Impose a reasonable limit on comment size (Daniel Veillard),
Impose a reasonable limit on attribute size (Daniel Veillard),
Harden the buffer code and make it more compatible (Daniel Veillard),
More cleanups for input/buffers code (Daniel Veillard),
Cleanup function xmlBufResetInput(), to set input from Buffer (Daniel Veillard)
Switch the test program for characters to new input buffers (Daniel Veillard),
Convert the HTML tree module to the new buffers (Daniel Veillard),
Convert of the HTML parser to new input buffers (Daniel Veillard),
Convert the writer to new output buffer and save APIs (Daniel Veillard),
Convert XMLReader to the new input buffers (Daniel Veillard),
New saving functions using xmlBuf and conversion (Daniel Veillard),
Provide new xmlBuf based saving functions (Daniel Veillard),
Convert XInclude to the new input buffers (Daniel Veillard),
Convert catalog code to the new input buffers (Daniel Veillard),
Convert C14N to the new Input buffer (Daniel Veillard),
Convert xmlIO.c to the new input and output buffers (Daniel Veillard),
Convert XML parser to the new input buffers (Daniel Veillard),
Incompatible change to the Input and Output buffers (Daniel Veillard),
Adding new encoding function to deal with the new structures (Daniel Veillard),
Convert XPath to xmlBuf (Daniel Veillard),
Adding a new buf module for buffers (Daniel Veillard),
Memory error within SAX2 reuse common framework (Daniel Veillard),
Fix xmllint --xpath node initialization (Daniel Veillard)
- Cleanups:
Various cleanups to avoid compiler warnings (Daniel Veillard),
Big space and tab cleanup (Daniel Veillard),
Followup to LibXML2 docs/examples cleanup patch (Daniel Veillard),
Second round of cleanups for LibXML2 docs/examples (Daniel Richard),
Remove all .cvsignore as they are not used anymore (Daniel Veillard),
Fix a Timsort function helper comment (Daniel Veillard),
Small cleanup for valgrind target (Daniel Veillard),
Patch for portability of latin characters in C files (Daniel Veillard),
Cleanup some of the parser code (Daniel Veillard),
Fix a variable name in comment (Daniel Veillard),
Regenerated testapi.c (Daniel Veillard),
Regenerating docs and API files (Daniel Veillard),
Small cleanup of unused variables in test (Daniel Veillard),
Expand .gitignore with more files (Daniel Veillard)
2.8.0: May 23 2012:
- Features:
add lzma compression support (Anders F Bjorklund)
- Documentation:
xmlcatalog: Add uri and delegateURI to possible add types in man page. (Ville Skyttä),
Update README.tests (Daniel Veillard),
URI handling code is not OOM resilient (Daniel Veillard),
Fix an error in comment (Daniel Veillard),
Fixed bug #617016 (Daniel Mustieles),
Fixed two typos in the README document (Daniel Neel),
add generated html files (Anders F Bjorklund),
Clarify the need to use xmlFreeNode after xmlUnlinkNode (Daniel Veillard),
Improve documentation a bit (Daniel Veillard),
Updated URL for lxml python bindings (Daniel Veillard)
- Portability:
Restore code for Windows compilation (Daniel Veillard),
Remove git error message during configure (Christian Dywan),
xmllint: Build fix for endTimer if !defined(HAVE_GETTIMEOFDAY) (Patrick R. Gansterer),
remove a bashism in confgure.in (John Hein),
undef ERROR if already defined (Patrick R. Gansterer),
Fix library problems with mingw-w64 (Michael Cronenworth),
fix windows build. ifdef addition from bug 666491 makes no sense (Rob Richards),
prefer native threads on win32 (Sam Thursfield),
Allow to compile with Visual Studio 2010 (Thomas Lemm),
Fix mingw's snprintf configure check (Andoni Morales),
fixed a 64bit big endian issue (Marcus Meissner),
Fix portability failure if netdb.h lacks NO_ADDRESS (Daniel Veillard),
Fix windows build from lzma addition (Rob Richards),
autogen: Only check for libtoolize (Colin Walters),
Fix the Windows build files (Patrick von Reth),
634846 Remove a linking option breaking Windows VC10 (Daniel Veillard),
599241 fix an initialization problem on Win64 (Andrew W. Nosenko),
fix win build (Rob Richards)
- Bug fixes:
Part for rand_r checking missing (Daniel Veillard),
Cleanup on randomization (Daniel Veillard),
Fix undefined reference in python module (Pacho Ramos),
Fix a race in xmlNewInputStream (Daniel Veillard),
Fix weird streaming RelaxNG errors (Noam),
Fix various bugs in new code raised by the API checking (Daniel Veillard),
Fix various problems with "make dist" (Daniel Veillard),
Fix a memory leak in the xzlib code (Daniel Veillard),
HTML parser error with <noscript> in the <head> (Denis Pauk),
XSD: optional element in complex type extension (Remi Gacogne),
Fix html serialization error and htmlSetMetaEncoding() (Daniel Veillard),
Fix a wrong return value in previous patch (Daniel Veillard),
Fix an uninitialized variable use (Daniel Veillard),
Fix a compilation problem with --minimum (Brandon Slack),
Remove redundant and ungarded include of resolv.h (Daniel Veillard),
xinclude with parse="text" does not use the entity loader (Shaun McCance),
Allow to parse 1 byte HTML files (Denis Pauk),
Patch that fixes the skipping of the HTML_PARSE_NOIMPLIED flag (Martin Schröder),
Avoid memory leak if xmlParserInputBufferCreateIO fails (Lin Yi-Li),
Prevent an infinite loop when dumping a node with encoding problems (Timothy Elliott),
xmlParseNodeInContext problems with an empty document (Tim Elliott),
HTML element position is not detected properly (Pavel Andrejs),
Fix an off by one pointer access (Jüri Aedla),
Try to fix a problem with entities in SAX mode (Daniel Veillard),
Fix a crash with xmllint --path on empty results (Daniel Veillard),
Fixed bug #667946 (Daniel Mustieles),
Fix a logic error in Schemas Component Constraints (Ryan Sleevi),
Fix a wrong enum type use in Schemas Types (Nico Weber),
Fix SAX2 builder in case of undefined attributes namespace (Daniel Veillard),
Fix SAX2 builder in case of undefined element namespaces (Daniel Veillard),
fix reference to STDOUT_FILENO on MSVC (Tay Ray Chuan),
fix a pair of possible out of array char references (Daniel Veillard),
Fix an allocation error when copying entities (Daniel Veillard),
Make sure the parser returns when getting a Stop order (Chris Evans),
Fix some potential problems on reallocation failures(parser.c) (Xia Xinfeng),
Fix a schema type duration comparison overflow (Daniel Veillard),
Fix an unimplemented part in RNG value validation (Daniel Veillard),
Fix missing error status in XPath evaluation (Daniel Veillard),
Hardening of XPath evaluation (Daniel Veillard),
Fix an off by one error in encoding (Daniel Veillard),
Fix RELAX NG include bug #655288 (Shaun McCance),
Fix XSD validation bug #630130 (Toyoda Eizi),
Fix some potential problems on reallocation failures (Chris Evans),
__xmlRaiseError: fix use of the structured callback channel (Dmitry V. Levin),
__xmlRaiseError: fix the structured callback channel's data initialization (Dmitry V. Levin),
Fix memory corruption when xmlParseBalancedChunkMemoryInternal is called from xmlParseBalancedChunk (Rob Richards),
Small fix for previous commit (Daniel Veillard),
Fix a potential freeing error in XPath (Daniel Veillard),
Fix a potential memory access error (Daniel Veillard),
Reactivate the shared library versioning script (Daniel Veillard)
- Improvements:
use mingw C99 compatible functions {v}snprintf instead those from MSVC runtime (Roumen Petrov),
New symbols added for the next release (Daniel Veillard),
xmlTextReader bails too quickly on error (Andy Lutomirski),
Use a hybrid allocation scheme in xmlNodeSetContent (Conrad Irwin),
Use buffers when constructing string node lists. (Conrad Irwin),
Add HTML parser support for HTML5 meta charset encoding declaration (Denis Pauk),
wrong message for double hyphen in comment XML error (Bryan Henderson),
Fix "make tst" to grab lzma lib too (Daniel Veillard),
Add "whereis" command to xmllint shell (Ryan),
Improve xmllint shell (Ryan),
add function xmlTextReaderRelaxNGValidateCtxt() (Noam Postavsky),
Add --system support to autogen.sh (Daniel Veillard),
Add hash randomization to hash and dict structures (Daniel Veillard),
included xzlib in dist (Anders F Bjorklund),
move xz/lzma helpers to separate included files (Anders F Bjorklund),
add generated devhelp files (Anders F Bjorklund),
add XML_WITH_LZMA to api (Anders F Bjorklund),
autogen.sh: Honor NOCONFIGURE environment variable (Colin Walters),
Improve the error report on undefined REFs (Daniel Veillard),
Add exception for new W3C PI xml-model (Daniel Veillard),
Add options to ignore the internal encoding (Daniel Veillard),
testapi: use the right type for the check (Stefan Kost),
various: handle return values of write calls (Stefan Kost),
testWriter: xmlTextWriterWriteFormatElement wants an int instead of a long int (Stefan Kost),
runxmlconf: update to latest testsuite version (Stefan Kost),
configure: add -Wno-long-long to CFLAGS (Stefan Kost),
configure: support silent automake rules if possible (Stefan Kost),
xmlmemory: add a cast as size_t has no portable printf modifier (Stefan Kost),
__xmlRaiseError: remove redundant schannel initialization (Dmitry V. Levin),
__xmlRaiseError: do cheap code check early (Dmitry V. Levin)
- Cleanups:
Cleanups before 2.8.0-rc2 (Daniel Veillard),
Avoid an extra operation (Daniel Veillard),
Remove vestigial de-ANSI-fication support. (Javier Jardón),
autogen.sh: Fix typo (Javier Jardón),
Do not use unsigned but unsigned int (Daniel Veillard),
Remove two references to u_short (Daniel Veillard),
Fix -Wempty-body warning from clang (Nico Weber),
Cleanups of lzma support (Daniel Veillard),
Augment the list of ignored files (Daniel Veillard),
python: remove unused variable (Stefan Kost),
python: flag two unused args (Stefan Kost),
configure: acconfig.h is deprecated since autoconf-2.50 (Stefan Kost),
xpath: remove unused variable (Stefan Kost)
2.7.8: Nov 4 2010:
- Features:
480323 add code to plug in ICU converters by default (Giuseppe Iuculano),
Add xmlSaveOption XML_SAVE_WSNONSIG (Adam Spragg)
- Documentation:
Fix devhelp documentation installation (Mike Hommey),
Fix web site encoding problems (Daniel Veillard),
Fix a couple of typo in HTML parser error messages (Michael Day),
Forgot to update the news page for 0.7.7 (Daniel Veillard)
- Portability:
607273 Fix python detection on MSys/Windows (LRN),
614087 Fix Socket API usage to allow Windows64 compilation (Ozkan Sezer),
Fix compilation with Clang (Koop Mast),
Fix Win32 build (Rob Richards)
- Bug Fixes:
595789 fix a remaining potential Solaris problem (Daniel Veillard),
617468 fix progressive HTML parsing with style using "'" (Denis Pauk),
616478 Fix xmllint shell write command (Gwenn Kahz),
614005 Possible erroneous HTML parsing on unterminated script (Pierre Belzile),
627987 Fix XSD IDC errors in imported schemas (Jim Panetta),
629325 XPath rounding errors first cleanup (Phil Shafer),
630140 fix iso995x encoding error (Daniel Veillard),
make sure htmlCtxtReset do reset the disableSAX field (Daniel Veillard),
Fix a change of semantic on XPath preceding and following axis (Daniel Veillard),
Fix a potential segfault due to weak symbols on pthreads (Mike Hommey),
Fix a leak in XPath compilation (Daniel Veillard),
Fix the semantic of XPath axis for namespace/attribute context nodes (Daniel Veillard),
Avoid a descriptor leak in catalog loading code (Carlo Bramini),
Fix a small bug in XPath evaluation code (Marius Wachtler),
Fix handling of XML-1.0 XML namespace declaration (Daniel Veillard),
Fix errors in XSD double validation check (Csaba Raduly),
Fix handling of apos in URIs (Daniel Veillard),
xmlTextReaderReadOuterXml should handle DTD (Rob Richards),
Autogen.sh needs to create m4 directory (Rob Richards)
- Improvements:
606592 update language ID parser to RFC 5646 (Daniel Veillard),
Sort python generated stubs (Mike Hommey),
Add an HTML parser option to avoid a default doctype (Daniel Veillard)
- Cleanups:
618831 don't ship generated files in git (Adrian Bunk),
Switch from the obsolete mkinstalldirs to AC_PROG_MKDIR_P (Adrian Bunk),
Various cleanups on encoding handling (Daniel Veillard),
Fix xmllint to use format=1 for default formatting (Adam Spragg),
Force _xmlSaveCtxt.format to be 0 or 1 (Adam Spragg),
Cleanup encoding pointer comparison (Nikolay Sivov),
Small code cleanup on previous patch (Daniel Veillard)
2.7.7: Mar 15 2010:
- Improvements:
Adding a --xpath option to xmllint (Daniel Veillard),
Make HTML parser non-recursive (Eugene Pimenov)
- Portability:
relaxng.c: cast to allow compilation with sun studio 11 (Ben Walton),
Fix build failure on Sparc solaris (Roumen Petrov),
use autoreconf in autogen.sh (Daniel Veillard),
Fix build with mingw (Roumen Petrov),
Upgrade some of the configure and autogen (Daniel Veillard),
Fix relaxNG tests in runtest for Windows runtest.c: initialize ret (Rob Richards),
Fix a const warning in xmlNodeSetBase (Martin Trappel),
Fix python generator to not use deprecated xmllib (Daniel Veillard),
Update some automake files (Daniel Veillard),
598785 Fix nanohttp on Windows (spadix)
- Bug Fixes:
libxml violates the zlib interface and crashes (Mark Adler),
Fix broken escape behaviour in regexp ranges (Daniel Veillard),
Fix missing win32 libraries in libxml-2.0.pc (Volker Grabsch),
Fix detection of python linker flags (Daniel Macks),
fix build error in libxml2/python (Paul Smith),
ChunkParser: Incorrect decoding of small xml files (Raul Hudea),
htmlCheckEncoding doesn't update input-end after shrink (Eugene Pimenov),
Fix a missing #ifdef (Daniel Veillard),
Fix encoding selection for xmlParseInNodeContext (Daniel Veillard),
xmlPreviousElementSibling mistake (François Delyon),
608773 add a missing check in xmlGROW (Daniel Veillard),
Fix xmlParseInNodeContext for HTML content (Daniel Veillard),
Fix lost namespace when copying node * tree.c: reconcile namespace if not found (Rob Richards),
Fix some missing commas in HTML element lists (Eugene Pimenov),
Correct variable type to unsigned (Nikolay Sivov),
Recognize ID attribute in HTML without DOCTYPE (Daniel Veillard),
Fix memory leak in xmlXPathEvalExpression() (Martin),
Fix an init bug in global.c (Kai Henning),
Fix xmlNodeSetBase() comment (Daniel Veillard),
Fix broken escape behaviour in regexp ranges (Daniel Veillard),
Don't give default HTML boolean attribute values in parser (Daniel Veillard),
xmlCtxtResetLastError should reset ctxt-errNo (Daniel Veillard)
- Cleanups:
Cleanup a couple of weirdness in HTML parser (Eugene Pimenov)
2.7.6: Oct 6 2009:
- Bug Fixes:
Restore thread support in default configuration (Andrew W. Nosenko),
URI with no path parsing problem (Daniel Veillard),
Minor patch for conditional defines in threads.c (Eric Zurcher)
2.7.5: Sep 24 2009:
- Bug Fixes:
Restore behavior of --with-threads without argument (Andrew W. Nosenko),
Fix memory leak when doc is NULL (Rob Richards),
595792 fixing a RelaxNG bug introduced in 2.7.4 (Daniel Veillard),
Fix a Relaxng bug raised by libvirt test suite (Daniel Veillard),
Fix a parsing problem with little data at startup (Daniel Veillard),
link python module with python library (Frederic Crozat),
594874 Forgot an fclose in xmllint (Daniel Veillard)
- Cleanup:
Adding symbols.xml to EXTRA_DIST (Daniel Veillard)
2.7.4: Sep 10 2009:
- Improvements:
Switch to GIT (GNOME),
Add symbol versioning to libxml2 shared libs (Daniel Veillard)
- Portability:
593857 try to work around thread pbm MinGW 4.4 (Daniel Veillard),
594250 rename ATTRIBUTE_ALLOC_SIZE to avoid clashes (Daniel Veillard),
Fix Windows build * relaxng.c: fix windows build (Rob Richards),
Fix the globals.h to use XMLPUBFUN (Paul Smith),
Problem with extern extern in header (Daniel Veillard),
Add -lnetwork for compiling on Haiku (Scott McCreary),
Runtest portability patch for Solaris (Tim Rice),
Small patch to accommodate the Haiku OS (Scott McCreary),
584605 package VxWorks folder in the distribution (Daniel Veillard),
574017 Realloc too expensive on most platform (Daniel Veillard),
Fix windows build (Rob Richards),
545579 doesn't compile without schema support (Daniel Veillard),
xmllint use xmlGetNodePath when not compiled in (Daniel Veillard),
Try to avoid __imp__xmlFree link trouble on msys (Daniel Veillard),
Allow to select the threading system on Windows (LRN),
Fix Solaris binary links, cleanups (Daniel Veillard),
Bug 571059 â MSVC doesn't work with the bakefile (Intron),
fix ATTRIBUTE_PRINTF header clash (Belgabor and Mike Hommey),
fixes for Borland/CodeGear/Embarcadero compilers (Eric Zurcher)
- Documentation:
544910 typo: "renciliateNs" (Leonid Evdokimov),
Add VxWorks to list of OSes (Daniel Veillard),
Regenerate the documentation and update for git (Daniel Veillard),
560524 ¿ xmlTextReaderLocalName description (Daniel Veillard),
Added sponsoring by AOE media for the server (Daniel Veillard),
updated URLs for GNOME (Vincent Lefevre),
more warnings about xmlCleanupThreads and xmlCleanupParser (Daniel Veillard)
- Bug fixes:
594514 memory leaks - duplicate initialization (MOD),
Wrong block opening in htmlNodeDumpOutputInternal (Daniel Veillard),
492317 Fix Relax-NG validation problems (Daniel Veillard),
558452 fight with reg test and error report (Daniel Veillard),
558452 RNG compilation of optional multiple child (Daniel Veillard),
579746 XSD validation not correct / nilable groups (Daniel Veillard),
502960 provide namespace stack when parsing entity (Daniel Veillard),
566012 part 2 fix regression tests and push mode (Daniel Veillard),
566012 autodetected encoding and encoding conflict (Daniel Veillard),
584220 xpointer(/) and xinclude problems (Daniel Veillard),
587663 Incorrect Attribute-Value Normalization (Daniel Veillard),
444994 HTML chunked failure for attribute with <> (Daniel Veillard),
Fix end of buffer char being split in XML parser (Daniel Veillard),
Non ASCII character may be split at buffer end (Adiel Mittmann),
440226 Add xmlXIncludeProcessTreeFlagsData API (Stefan Behnel),
572129 speed up parsing of large HTML text nodes (Markus Kull),
Fix HTML parsing with 0 character in CDATA (Daniel Veillard),
Fix SetGenericErrorFunc and SetStructured clash (Wang Lam),
566012 Incomplete EBCDIC parsing support (Martin Kogler),
541335 HTML avoid creating 2 head or 2 body element (Daniel Veillard),
541237 error correcting missing end tags in HTML (Daniel Veillard),
583439 missing line numbers in push mode (Daniel Veillard),
587867 xmllint --html --xmlout serializing as HTML (Daniel Veillard),
559501 avoid select and use poll for nanohttp (Raphael Prevost),
559410 - Regexp bug on (...)? constructs (Daniel Veillard),
Fix a small problem on previous HTML parser patch (Daniel Veillard),
592430 - HTML parser runs into endless loop (Daniel Veillard),
447899 potential double free in xmlFreeTextReader (Daniel Veillard),
446613 small validation bug mixed content with NS (Daniel Veillard),
Fix the problem of revalidating a doc with RNG (Daniel Veillard),
Fix xmlKeepBlanksDefault to not break indent (Nick Wellnhofer),
512131 refs from externalRef part need to be added (Daniel Veillard),
512131 crash in xmlRelaxNGValidateFullElement (Daniel Veillard),
588441 allow '.' in HTML Names even if invalid (Daniel Veillard),
582913 Fix htmlSetMetaEncoding() to be nicer (Daniel Veillard),
579317 Try to find the HTML encoding information (Daniel Veillard),
575875 don't output charset=html (Daniel Veillard),
571271 fix semantic of xsd:all with minOccurs=0 (Daniel Veillard),
570702 fix a bug in regexp determinism checking (Daniel Veillard),
567619 xmlValidateNotationUse missing param test (Daniel Veillard),
574393 ¿ utf-8 filename magic for compressed files (Hans Breuer),
Fix a couple of problems in the parser (Daniel Veillard),
585505 ¿ Document ids and refs populated by XSD (Wayne Jensen),
582906 XSD validating multiple imports of the same schema (Jason Childs),
Bug 582887 ¿ problems validating complex schemas (Jason Childs),
Bug 579729 ¿ fix XSD schemas parsing crash (Miroslav Bajtos),
576368 ¿ htmlChunkParser with special attributes (Jiri Netolicky),
Bug 565747 ¿ relax anyURI data character checking (Vincent Lefevre),
Preserve attributes of include start on tree copy (Petr Pajas),
Skip silently unrecognized XPointer schemes (Jakub Wilk),
Fix leak on SAX1, xmllint --sax1 option and debug (Daniel Veillard),
potential NULL dereference on non-glibc (Jim Meyering),
Fix an XSD validation crash (Daniel Veillard),
Fix a regression in streaming entities support (Daniel Veillard),
Fix a couple of ABI issues with C14N 1.1 (Aleksey Sanin),
Aleksey Sanin support for c14n 1.1 (Aleksey Sanin),
reader bug fix with entities (Daniel Veillard),
use options from current parser ctxt for external entities (Rob Richards),
581612 use %s to printf strings (Christian Persch),
584605 change the threading initialization sequence (Igor Novoseltsev),
580705 keep line numbers in HTML parser (Aaron Patterson),
581803 broken HTML table attributes init (Roland Steiner),
do not set error code in xmlNsWarn (Rob Richards),
564217 fix structured error handling problems,
reuse options from current parser for entities (Rob Richards),
xmlXPathRegisterNs should not allow enpty prefixes (Daniel Veillard),
add a missing check in xmlAddSibling (Kris Breuker),
avoid leaks on errors (Jinmei Tatuya)
- Cleanup:
Chasing dead assignments reported by clang-scan (Daniel Veillard),
A few more safety cleanup raised by scan (Daniel Veillard),
Fixing assorted potential problems raised by scan (Daniel Veillard),
Potential uninitialized arguments raised by scan (Daniel Veillard),
Fix a bunch of scan 'dead increments' and cleanup (Daniel Veillard),
Remove a pedantic warning (Daniel Veillard),
555833 always use rm -f in uninstall-local (Daniel Veillard),
542394 xmlRegisterOutputCallbacks MAX_INPUT_CALLBACK (Daniel Veillard),
Autoregenerate libxml2.syms automated checkings (Daniel Veillard),
Make xmlRecoverDoc const (Martin Trappel) (Daniel Veillard),
Both args of xmlStrcasestr are const (Daniel Veillard),
hide the nbParse* variables used for debugging (Mike Hommey),
570806 changed include of config.h (William M. Brack),
cleanups and error reports when xmlTextWriterVSprintf fails (Jinmei Tatuya)
2.7.3: Jan 18 2009:
- Build fix: fix build when HTML support is not included.
- Bug fixes: avoid memory overflow in gigantic text nodes,
indentation problem on the writed (Rob Richards),
xmlAddChildList pointer problem (Rob Richards and Kevin Milburn),
xmlAddChild problem with attribute (Rob Richards and Kris Breuker),
avoid a memory leak in an edge case (Daniel Zimmermann),
deallocate some pthread data (Alex Ott).
- Improvements: configure option to avoid rebuilding docs (Adrian Bunk),
limit text nodes to 10MB max by default, add element traversal
APIs, add a parser option to enable pre 2.7 SAX behavior (Rob Richards),
add gcc malloc checking (Marcus Meissner), add gcc printf like functions
parameters checking (Marcus Meissner).
2.7.2: Oct 3 2008:
- Portability fix: fix solaris compilation problem, fix compilation
if XPath is not configured in
- Bug fixes: nasty entity bug introduced in 2.7.0, restore old behaviour
when saving an HTML doc with an xml dump function, HTML UTF-8 parsing
bug, fix reader custom error handlers (Riccardo Scussat)
- Improvement: xmlSave options for more flexibility to save as
XML/HTML/XHTML, handle leading BOM in HTML documents
2.7.1: Sep 1 2008:
- Portability fix: Borland C fix (Moritz Both)
- Bug fixes: python serialization wrappers, XPath QName corner
case handking and leaks (Martin)
- Improvement: extend the xmlSave to handle HTML documents and trees
- Cleanup: python serialization wrappers
2.7.0: Aug 30 2008:
- Documentation: switch ChangeLog to UTF-8, improve mutithreads and
xmlParserCleanup docs
- Portability fixes: Older Win32 platforms (Rob Richards), MSVC
porting fix (Rob Richards), Mac OS X regression tests (Sven Herzberg),
non GNUCC builds (Rob Richards), compilation on Haiku (Andreas Färber)
- Bug fixes: various realloc problems (Ashwin), potential double-free
(Ashwin), regexp crash, icrash with invalid whitespace facets (Rob
Richards), pattern fix when streaming (William Brack), various XML
parsing and validation fixes based on the W3C regression tests, reader
tree skipping function fix (Ashwin), Schemas regexps escaping fix
(Volker Grabsch), handling of entity push errors (Ashwin), fix a slowdown
when encoder can't serialize characters on output
- Code cleanup: compilation fix without the reader, without the output
(Robert Schwebel), python whitespace (Martin), many space/tabs cleanups,
serious cleanup of the entity handling code
- Improvement: switch parser to XML-1.0 5th edition, add parsing flags
for old versions, switch URI parsing to RFC 3986,
add xmlSchemaValidCtxtGetParserCtxt (Holger Kaelberer),
new hashing functions for dictionaries (based on Stefan Behnel work),
improve handling of misplaced html/head/body in HTML parser, better
regression test tools and code coverage display, better algorithms
to detect various versions of the billion laughts attacks, make
arbitrary parser limits avoidable as a parser option
2.6.32: Apr 8 2008:
- Documentation: returning heap memory to kernel (Wolfram Sang),
trying to clarify xmlCleanupParser() use, xmlXPathContext improvement
(Jack Jansen), improve the *Recover* functions documentation,
XmlNodeType doc link fix (Martijn Arts)
- Bug fixes: internal subset memory leak (Ashwin), avoid problem with
paths starting with // (Petr Sumbera), streaming XSD validation callback
patches (Ashwin), fix redirection on port other than 80 (William Brack),
SAX2 leak (Ashwin), XInclude fragment of own document (Chris Ryan),
regexp bug with '.' (Andrew Tosh), flush the writer at the end of the
document (Alfred Mickautsch), output I/O bug fix (William Brack),
writer CDATA output after a text node (Alex Khesin), UTF-16 encoding
detection (William Brack), fix handling of empty CDATA nodes for Safari
team, python binding problem with namespace nodes, improve HTML parsing
(Arnold Hendriks), regexp automata build bug, memory leak fix (Vasily
Chekalkin), XSD test crash, weird system parameter entity parsing problem,
allow save to file:///X:/ windows paths, various attribute normalisation
problems, externalSubsetSplit fix (Ashwin), attribute redefinition in
the DTD (Ashwin), fix in char ref parsing check (Alex Khesin), many
out of memory handling fixes (Ashwin), XPath out of memory handling fixes
(Alvaro Herrera), various realloc problems (Ashwin), UCS4 encoding
conversion buffer size (Christian Fruth), problems with EatName
functions on memory errors, BOM handling in external parsed entities
(Mark Rowe)
- Code cleanup: fix build under VS 2008 (David Wimsey), remove useless
mutex in xmlDict (Florent Guilian), Mingw32 compilation fix (Carlo
Bramini), Win and MacOS EOL cleanups (Florent Guiliani), iconv need
a const detection (Roumen Petrov), simplify xmlSetProp (Julien Charbon),
cross compilation fixes for Mingw (Roumen Petrov), SCO Openserver build
fix (Florent Guiliani), iconv uses const on Win32 (Rob Richards),
duplicate code removal (Ashwin), missing malloc test and error reports
(Ashwin), VMS makefile fix (Tycho Hilhorst)
- improvements: better plug of schematron in the normal error handling
(Tobias Minich)
2.6.31: Jan 11 2008:
- Security fix: missing of checks in UTF-8 parsing
- Bug fixes: regexp bug, dump attribute from XHTML document, fix
xmlFree(NULL) to not crash in debug mode, Schematron parsing crash
(Rob Richards), global lock free on Windows (Marc-Antoine Ruel),
XSD crash due to double free (Rob Richards), indentation fix in
xmlTextWriterFullEndElement (Felipe Pena), error in attribute type
parsing if attribute redeclared, avoid crash in hash list scanner if
deleting elements, column counter bug fix (Christian Schmidt),
HTML embed element saving fix (Stefan Behnel), avoid -L/usr/lib
output from xml2-config (Fred Crozat), avoid an xmllint crash
(Stefan Kost), don't stop HTML parsing on out of range chars.
- Code cleanup: fix open() call third argument, regexp cut'n paste
copy error, unused variable in __xmlGlobalInitMutexLock (Hannes Eder),
some make distcheck related fixes (John Carr)
- Improvements: HTTP Header: includes port number (William Brack),
testURI --debug option,
2.6.30: Aug 23 2007:
- Portability: Solaris crash on error handling, windows path fixes
(Roland Schwarz and Rob Richards), mingw build (Roland Schwarz)
- Bugfixes: xmlXPathNodeSetSort problem (William Brack), leak when
reusing a writer for a new document (Dodji Seketeli), Schemas
xsi:nil handling patch (Frank Gross), relative URI build problem
(Patrik Fimml), crash in xmlDocFormatDump, invalid char in comment
detection bug, fix disparity with xmlSAXUserParseMemory, automata
generation for complex regexp counts problems, Schemas IDC import
problems (Frank Gross), xpath predicate evailation error handling
(William Brack)
2.6.29: Jun 12 2007:
- Portability: patches from Andreas Stricke for WinCEi,
fix compilation warnings (William Brack), avoid warnings on Apple OS/X
(Wendy Doyle and Mark Rowe), Windows compilation and threading
improvements (Rob Richards), compilation against old Python versions,
new GNU tar changes (Ryan Hill)
- Documentation: xmlURIUnescapeString comment,
- Bugfixes: xmlBufferAdd problem (Richard Jones), 'make valgrind'
flag fix (Richard Jones), regexp interpretation of \,
htmlCreateDocParserCtxt (Jean-Daniel Dupas), configure.in
typo (Bjorn Reese), entity content failure, xmlListAppend() fix
(Georges-André Silber), XPath number serialization (William Brack),
nanohttp gzipped stream fix (William Brack and Alex Cornejo),
xmlCharEncFirstLine typo (Mark Rowe), uri bug (François Delyon),
XPath string value of PI nodes (William Brack), XPath node set
sorting bugs (William Brack), avoid outputting namespace decl
dups in the writer (Rob Richards), xmlCtxtReset bug, UTF-8 encoding
error handling, recustion on next in catalogs, fix a Relax-NG crash,
workaround wrong file: URIs, htmlNodeDumpFormatOutput on attributes,
invalid character in attribute detection bug, big comments before
internal subset streaming bug, HTML parsing of attributes with : in
the name, IDness of name in HTML (Dagfinn I. Mannsåker)
- Improvement: keep URI query parts in raw form (Richard Jones),
embed tag support in HTML (Michael Day)
2.6.28: Apr 17 2007:
- Documentation: comment fixes (Markus Keim), xpath comments fixes too
(James Dennett)
- Bug fixes: XPath bug (William Brack), HTML parser autoclose stack usage
(Usamah Malik), various regexp bug fixes (DV and William), path conversion
on Windows (Igor Zlatkovic), htmlCtxtReset fix (Michael Day), XPath
principal node of axis bug, HTML serialization of some codepoint
(Steven Rainwater), user data propagation in XInclude (Michael Day),
standalone and XML decl detection (Michael Day), Python id output
for some id, fix the big python string memory leak, URI parsing fixes
(Stéphane Bidoul and William), long comments parsing bug (William),
concurrent threads initialization (Ted Phelps), invalid char
in text XInclude (William), XPath memory leak (William), tab in
python problems (Andreas Hanke), XPath node comparison error
(Oleg Paraschenko), cleanup patch for reader (Julien Reichel),
XML Schemas attribute group (William), HTML parsing problem (William),
fix char 0x2d in regexps (William), regexp quantifier range with
min occurs of 0 (William), HTML script/style parsing (Mike Day)
- Improvement: make xmlTextReaderSetup() public
- Compilation and postability: fix a missing include problem (William),
__ss_family on AIX again (Björn Wiberg), compilation without zlib
(Michael Day), catalog patch for Win32 (Christian Ehrlicher),
Windows CE fixes (Andreas Stricke)
- Various CVS to SVN infrastructure changes
2.6.27: Oct 25 2006:
- Portability fixes: file names on windows (Roland Schwingel,
Emelyanov Alexey), windows compile fixup (Rob Richards),
AIX iconv() is apparently case sensitive
- improvements: Python XPath types mapping (Nic Ferrier), XPath optimization
(Kasimier), add xmlXPathCompiledEvalToBoolean (Kasimier), Python node
equality and comparison (Andreas Pakulat), xmlXPathCollectAndTest
improvememt (Kasimier), expose if library was compiled with zlib
support (Andrew Nosenko), cache for xmlSchemaIDCMatcher structs
(Kasimier), xmlTextConcat should work with comments and PIs (Rob
Richards), export htmlNewParserCtxt needed by Michael Day, refactoring
of catalog entity loaders (Michael Day), add XPointer support to
python bindings (Ross Reedstrom, Brian West and Stefan Anca),
try to sort out most file path to URI conversions and xmlPathToUri,
add --html --memory case to xmllint
- building fix: fix --with-minimum (Felipe Contreras), VMS fix,
const'ification of HTML parser structures (Matthias Clasen),
portability fix (Emelyanov Alexey), wget autodetection (Peter
Breitenlohner), remove the build path recorded in the python
shared module, separate library flags for shared and static builds
(Mikhail Zabaluev), fix --with-minimum --with-sax1 builds, fix
--with-minimum --with-schemas builds
- bug fix: xmlGetNodePath fix (Kasimier), xmlDOMWrapAdoptNode and
attribute (Kasimier), crash when using the recover mode,
xmlXPathEvalExpr problem (Kasimier), xmlXPathCompExprAdd bug (Kasimier),
missing destroy in xmlFreeRMutex (Andrew Nosenko), XML Schemas fixes
(Kasimier), warning on entities processing, XHTML script and style
serialization (Kasimier), python generator for long types, bug in
xmlSchemaClearValidCtxt (Bertrand Fritsch), xmlSchemaXPathEvaluate
allocation bug (Marton Illes), error message end of line (Rob Richards),
fix attribute serialization in writer (Rob Richards), PHP4 DTD validation
crash, parser safety patch (Ben Darnell), _private context propagation
when parsing entities (with Michael Day), fix entities behaviour when
using SAX, URI to file path fix (Mikhail Zabaluev), disappearing validity
context, arg error in SAX callback (Mike Hommey), fix mixed-content
autodetect when using --noblanks, fix xmlIOParseDTD error handling,
fix bug in xmlSplitQName on special Names, fix Relax-NG element content
validation bug, fix xmlReconciliateNs bug, fix potential attribute
XML parsing bug, fix line/column accounting in XML parser, chunking bug
in the HTML parser on script, try to detect obviously buggy HTML
meta encoding indications, bugs with encoding BOM and xmlSaveDoc,
HTML entities in attributes parsing, HTML minimized attribute values,
htmlReadDoc and htmlReadIO were broken, error handling bug in
xmlXPathEvalExpression (Olaf Walkowiak), fix a problem in
htmlCtxtUseOptions, xmlNewInputFromFile could leak (Marius Konitzer),
bug on misformed SSD regexps (Christopher Boumenot)
- documentation: warning about XML_PARSE_COMPACT (Kasimier Buchcik),
fix xmlXPathCastToString documentation, improve man pages for
xmllitn and xmlcatalog (Daniel Leidert), fixed comments of a few
functions
2.6.26: Jun 6 2006:
- portability fixes: Python detection (Joseph Sacco), compilation
error(William Brack and Graham Bennett), LynxOS patch (Olli Savia)
- bug fixes: encoding buffer problem, mix of code and data in
xmlIO.c(Kjartan Maraas), entities in XSD validation (Kasimier Buchcik),
variousXSD validation fixes (Kasimier), memory leak in pattern (Rob
Richards andKasimier), attribute with colon in name (Rob Richards), XPath
leak inerror reporting (Aleksey Sanin), XInclude text include of
selfdocument.
- improvements: Xpath optimizations (Kasimier), XPath object
cache(Kasimier)
2.6.25: Jun 6 2006::
Do not use or package 2.6.25
2.6.24: Apr 28 2006:
- Portability fixes: configure on Windows, testapi compile on windows
(Kasimier Buchcik, venkat naidu), Borland C++ 6 compile (Eric Zurcher),
HP-UX compiler workaround (Rick Jones), xml2-config bugfix, gcc-4.1
cleanups, Python detection scheme (Joseph Sacco), UTF-8 file paths on
Windows (Roland Schwingel).
- Improvements: xmlDOMWrapReconcileNamespaces xmlDOMWrapCloneNode (Kasimier
Buchcik), XML catalog debugging (Rick Jones), update to Unicode 4.01.
- Bug fixes: xmlParseChunk() problem in 2.6.23, xmlParseInNodeContext()
on HTML docs, URI behaviour on Windows (Rob Richards), comment streaming
bug, xmlParseComment (with William Brack), regexp bug fixes (DV &
Youri Golovanov), xmlGetNodePath on text/CDATA (Kasimier),
one Relax-NG interleave bug, xmllint --path and --valid,
XSD bugfixes (Kasimier), remove debug
left in Python bindings (Nic Ferrier), xmlCatalogAdd bug (Martin Cole),
xmlSetProp fixes (Rob Richards), HTML IDness (Rob Richards), a large
number of cleanups and small fixes based on Coverity reports, bug
in character ranges, Unicode tables const (Aivars Kalvans), schemas
fix (Stefan Kost), xmlRelaxNGParse error deallocation,
xmlSchemaAddSchemaDoc error deallocation, error handling on unallowed
code point, ixmllint --nonet to never reach the net (Gary Coady),
line break in writer after end PI (Jason Viers).
- Documentation: man pages updates and cleanups (Daniel Leidert).
- New features: Relax NG structure error handlers.
2.6.23: Jan 5 2006:
- portability fixes: Windows (Rob Richards), getaddrinfo on Windows
(Kolja Nowak, Rob Richards), icc warnings (Kjartan Maraas),
--with-minimum compilation fixes (William Brack), error case handling fix
on Solaris (Albert Chin), don't use 'list' as parameter name reported by
Samuel Diaz Garcia, more old Unices portability fixes (Albert Chin),
MinGW compilation (Mark Junker), HP-UX compiler warnings (Rick
Jones),
- code cleanup: xmlReportError (Adrian Mouat), remove xmlBufferClose
(Geert Jansen), unreachable code (Oleksandr Kononenko), refactoring
parsing code (Bjorn Reese)
- bug fixes: xmlBuildRelativeURI and empty path (William Brack),
combinatory explosion and performances in regexp code, leak in
xmlTextReaderReadString(), xmlStringLenDecodeEntities problem (Massimo
Morara), Identity Constraints bugs and a segfault (Kasimier Buchcik),
XPath pattern based evaluation bugs (DV & Kasimier),
xmlSchemaContentModelDump() memory leak (Kasimier), potential leak in
xmlSchemaCheckCSelectorXPath(), xmlTextWriterVSprintf() misuse of
vsnprintf (William Brack), XHTML serialization fix (Rob Richards), CRLF
split problem (William), issues with non-namespaced attributes in
xmlAddChild() xmlAddNextSibling() and xmlAddPrevSibling() (Rob Richards),
HTML parsing of script, Python must not output to stdout (Nic Ferrier),
exclusive C14N namespace visibility (Aleksey Sanin), XSD datatype
totalDigits bug (Kasimier Buchcik), error handling when writing to an
xmlBuffer (Rob Richards), runtest schemas error not reported (Hisashi
Fujinaka), signed/unsigned problem in date/time code (Albert Chin), fix
XSI driven XSD validation (Kasimier), parsing of xs:decimal (Kasimier),
fix DTD writer output (Rob Richards), leak in xmlTextReaderReadInnerXml
(Gary Coady), regexp bug affecting schemas (Kasimier), configuration of
runtime debugging (Kasimier), xmlNodeBufGetContent bug on entity refs
(Oleksandr Kononenko), xmlRegExecPushString2 bug (Sreeni Nair),
compilation and build fixes (Michael Day), removed dependencies on
xmlSchemaValidError (Kasimier), bug with <xml:foo/>, more XPath
pattern based evaluation fixes (Kasimier)
- improvements: XSD Schemas redefinitions/restrictions (Kasimier
Buchcik), node copy checks and fix for attribute (Rob Richards), counted
transition bug in regexps, ctxt->standalone = -2 to indicate no
standalone attribute was found, add xmlSchemaSetParserStructuredErrors()
(Kasimier Buchcik), add xmlTextReaderSchemaValidateCtxt() to API
(Kasimier), handle gzipped HTTP resources (Gary Coady), add
htmlDocDumpMemoryFormat. (Rob Richards),
- documentation: typo (Michael Day), libxml man page (Albert Chin), save
function to XML buffer (Geert Jansen), small doc fix (Aron Stansvik),
2.6.22: Sep 12 2005:
- build fixes: compile without schematron (Stéphane Bidoul)
- bug fixes: xmlDebugDumpNode on namespace node (Oleg Paraschenko)i,
CDATA push parser bug, xmlElemDump problem with XHTML1 doc,
XML_FEATURE_xxx clash with expat headers renamed XML_WITH_xxx, fix some
output formatting for meta element (Rob Richards), script and style
XHTML1 serialization (David Madore), Attribute derivation fixups in XSD
(Kasimier Buchcik), better IDC error reports (Kasimier Buchcik)
- improvements: add XML_SAVE_NO_EMPTY xmlSaveOption (Rob Richards), add
XML_SAVE_NO_XHTML xmlSaveOption, XML Schemas improvements preparing for
derive (Kasimier Buchcik).
- documentation: generation of gtk-doc like docs, integration with
devhelp.
2.6.21: Sep 4 2005:
- build fixes: Cygwin portability fixes (Gerrit P. Haase), calling
convention problems on Windows (Marcus Boerger), cleanups based on Linus'
sparse tool, update of win32/configure.js (Rob Richards), remove warnings
on Windows(Marcus Boerger), compilation without SAX1, detection of the
Python binary, use $GCC inestad of $CC = 'gcc' (Andrew W. Nosenko),
compilation/link with threads and old gcc, compile problem by C370 on
Z/OS,
- bug fixes: http_proxy environments (Peter Breitenlohner), HTML UTF-8
bug (Jiri Netolicky), XPath NaN compare bug (William Brack),
htmlParseScript potential bug, Schemas regexp handling of spaces, Base64
Schemas comparisons NIST passes, automata build error xsd:all,
xmlGetNodePath for namespaced attributes (Alexander Pohoyda), xmlSchemas
foreign namespaces handling, XML Schemas facet comparison (Kupriyanov
Anatolij), xmlSchemaPSimpleTypeErr error report (Kasimier Buchcik), xml:
namespace ahndling in Schemas (Kasimier), empty model group in Schemas
(Kasimier), wildcard in Schemas (Kasimier), URI composition (William),
xs:anyType in Schemas (Kasimier), Python resolver emitting error
messages directly, Python xmlAttr.parent (Jakub Piotr Clapa), trying to
fix the file path/URI conversion, xmlTextReaderGetAttribute fix (Rob
Richards), xmlSchemaFreeAnnot memleak (Kasimier), HTML UTF-8
serialization, streaming XPath, Schemas determinism detection problem,
XInclude bug, Schemas context type (Dean Hill), validation fix (Derek
Poon), xmlTextReaderGetAttribute[Ns] namespaces (Rob Richards), Schemas
type fix (Kuba Nowakowski), UTF-8 parser bug, error in encoding handling,
xmlGetLineNo fixes, bug on entities handling, entity name extraction in
error handling with XInclude, text nodes in HTML body tags (Gary Coady),
xml:id and IDness at the treee level fixes, XPath streaming patterns
bugs.
- improvements: structured interfaces for schemas and RNG error reports
(Marcus Boerger), optimization of the char data inner loop parsing
(thanks to Behdad Esfahbod for the idea), schematron validation though
not finished yet, xmlSaveOption to omit XML declaration, keyref match
error reports (Kasimier), formal expression handling code not plugged
yet, more lax mode for the HTML parser, parser XML_PARSE_COMPACT option
for text nodes allocation.
- documentation: xmllint man page had --nonet duplicated
2.6.20: Jul 10 2005:
- build fixes: Windows build (Rob Richards), Mingw compilation (Igor
Zlatkovic), Windows Makefile (Igor), gcc warnings (Kasimier and
andriy@google.com), use gcc weak references to pthread to avoid the
pthread dependency on Linux, compilation problem (Steve Nairn), compiling
of subset (Morten Welinder), IPv6/ss_family compilation (William Brack),
compilation when disabling parts of the library, standalone test
distribution.
- bug fixes: bug in lang(), memory cleanup on errors (William Brack),
HTTP query strings (Aron Stansvik), memory leak in DTD (William), integer
overflow in XPath (William), nanoftp buffer size, pattern "." apth fixup
(Kasimier), leak in tree reported by Malcolm Rowe, replaceNode patch
(Brent Hendricks), CDATA with NULL content (Mark Vakoc), xml:base fixup
on XInclude (William), pattern fixes (William), attribute bug in
exclusive c14n (Aleksey Sanin), xml:space and xml:lang with SAX2 (Rob
Richards), namespace trouble in complex parsing (Malcolm Rowe), XSD type
QNames fixes (Kasimier), XPath streaming fixups (William), RelaxNG bug
(Rob Richards), Schemas for Schemas fixes (Kasimier), removal of ID (Rob
Richards), a small RelaxNG leak, HTML parsing in push mode bug (James
Bursa), failure to detect UTF-8 parsing bugs in CDATA sections,
areBlanks() heuristic failure, duplicate attributes in DTD bug
(William).
- improvements: lot of work on Schemas by Kasimier Buchcik both on
conformance and streaming, Schemas validation messages (Kasimier Buchcik,
Matthew Burgess), namespace removal at the python level (Brent
Hendricks), Update to new Schemas regression tests from W3C/Nist
(Kasimier), xmlSchemaValidateFile() (Kasimier), implementation of
xmlTextReaderReadInnerXml and xmlTextReaderReadOuterXml (James Wert),
standalone test framework and programs, new DOM import APIs
xmlDOMWrapReconcileNamespaces() xmlDOMWrapAdoptNode() and
xmlDOMWrapRemoveNode(), extension of xmllint capabilities for SAX and
Schemas regression tests, xmlStopParser() available in pull mode too,
ienhancement to xmllint --shell namespaces support, Windows port of the
standalone testing tools (Kasimier and William),
xmlSchemaValidateStream() xmlSchemaSAXPlug() and xmlSchemaSAXUnplug() SAX
Schemas APIs, Schemas xmlReader support.
2.6.19: Apr 02 2005:
- build fixes: drop .la from RPMs, --with-minimum build fix (William
Brack), use XML_SOCKLEN_T instead of SOCKLEN_T because it breaks with AIX
5.3 compiler, fixed elfgcchack.h generation and PLT reduction code on
Linux/ELF/gcc4
- bug fixes: schemas type decimal fixups (William Brack), xmmlint return
code (Gerry Murphy), small schemas fixes (Matthew Burgess and GUY
Fabrice), workaround "DAV:" namespace brokenness in c14n (Aleksey Sanin),
segfault in Schemas (Kasimier Buchcik), Schemas attribute validation
(Kasimier), Prop related functions and xmlNewNodeEatName (Rob Richards),
HTML serialization of name attribute on a elements, Python error handlers
leaks and improvement (Brent Hendricks), uninitialized variable in
encoding code, Relax-NG validation bug, potential crash if
gnorableWhitespace is NULL, xmlSAXParseDoc and xmlParseDoc signatures,
switched back to assuming UTF-8 in case no encoding is given at
serialization time
- improvements: lot of work on Schemas by Kasimier Buchcik on facets
checking and also mixed handling.
-
2.6.18: Mar 13 2005:
- build fixes: warnings (Peter Breitenlohner), testapi.c generation,
Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed),
some gcc4 fixes, HP-UX portability fixes (Rick Jones).
- bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and
xmlreader stopping on non-fatal errors, thread support for dictionaries
reference counting (Gary Coady), internal subset and push problem, URL
saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python paths
fixup (Stephane Bidoul), xmlGetNodePath and namespaces, xmlSetNsProp fix
(Mike Hommey), warning should not count as error (William Brack),
xmlCreatePushParser empty chunk, XInclude parser flags (William), cleanup
FTP and HTTP code to reuse the uri parsing and IPv6 (William),
xmlTextWriterStartAttributeNS fix (Rob Richards), XMLLINT_INDENT being
empty (William), xmlWriter bugs (Rob Richards), multithreading on Windows
(Rich Salz), xmlSearchNsByHref fix (Kasimier), Python binding leak (Brent
Hendricks), aliasing bug exposed by gcc4 on s390, xmlTextReaderNext bug
(Rob Richards), Schemas decimal type fixes (William Brack),
xmlByteConsumed static buffer (Ben Maurer).
- improvement: speedup parsing comments and DTDs, dictionary support for
hash tables, Schemas Identity constraints (Kasimier), streaming XPath
subset, xmlTextReaderReadString added (Bjorn Reese), Schemas canonical
values handling (Kasimier), add xmlTextReaderByteConsumed (Aron
Stansvik),
- Documentation: Wiki support (Joel Reed)
2.6.17: Jan 16 2005:
- build fixes: Windows, warnings removal (William Brack),
maintainer-clean dependency(William), build in a different directory
(William), fixing --with-minimum configure build (William), BeOS build
(Marcin Konicki), Python-2.4 detection (William), compilation on AIX (Dan
McNichol)
- bug fixes: xmlTextReaderHasAttributes (Rob Richards), xmlCtxtReadFile()
to use the catalog(s), loop on output (William Brack), XPath memory leak,
ID deallocation problem (Steve Shepard), debugDumpNode crash (William),
warning not using error callback (William), xmlStopParser bug (William),
UTF-16 with BOM on DTDs (William), namespace bug on empty elements in
push mode (Rob Richards), line and col computations fixups (Aleksey
Sanin), xmlURIEscape fix (William), xmlXPathErr on bad range (William),
patterns with too many steps, bug in RNG choice optimization, line number
sometimes missing.
- improvements: XSD Schemas (Kasimier Buchcik), python generator
(William), xmlUTF8Strpos speedup (William), unicode Python strings
(William), XSD error reports (Kasimier Buchcik), Python __str__ call
serialize().
- new APIs: added xmlDictExists(), GetLineNumber and GetColumnNumber for
the xmlReader (Aleksey Sanin), Dynamic Shared Libraries APIs (mostly Joel
Reed), error extraction API from regexps, new XMLSave option for format
(Phil Shafer)
- documentation: site improvement (John Fleck), FAQ entries
(William).
2.6.16: Nov 10 2004:
- general hardening and bug fixing crossing all the API based on new
automated regression testing
- build fix: IPv6 build and test on AIX (Dodji Seketeli)
- bug fixes: problem with XML::Libxml reported by Petr Pajas, encoding
conversion functions return values, UTF-8 bug affecting XPath reported by
Markus Bertheau, catalog problem with NULL entries (William Brack)
- documentation: fix to xmllint man page, some API function description
were updated.
- improvements: DTD validation APIs provided at the Python level (Brent
Hendricks)
2.6.15: Oct 27 2004:
- security fixes on the nanoftp and nanohttp modules
- build fixes: xmllint detection bug in configure, building outside the
source tree (Thomas Fitzsimmons)
- bug fixes: HTML parser on broken ASCII chars in names (William), Python
paths (Malcolm Tredinnick), xmlHasNsProp and default namespace (William),
saving to python file objects (Malcolm Tredinnick), DTD lookup fix
(Malcolm), save back <group> in catalogs (William), tree build
fixes (DV and Rob Richards), Schemas memory bug, structured error handler
on Python 64bits, thread local memory deallocation, memory leak reported
by Volker Roth, xmlValidateDtd in the presence of an internal subset,
entities and _private problem (William), xmlBuildRelativeURI error
(William).
- improvements: better XInclude error reports (William), tree debugging
module and tests, convenience functions at the Reader API (Graham
Bennett), add support for PI in the HTML parser.
2.6.14: Sep 29 2004:
- build fixes: configure paths for xmllint and xsltproc, compilation
without HTML parser, compilation warning cleanups (William Brack &
Malcolm Tredinnick), VMS makefile update (Craig Berry),
- bug fixes: xmlGetUTF8Char (William Brack), QName properties (Kasimier
Buchcik), XInclude testing, Notation serialization, UTF8ToISO8859x
transcoding (Mark Itzcovitz), lots of XML Schemas cleanup and fixes
(Kasimier), ChangeLog cleanup (Stepan Kasal), memory fixes (Mark Vakoc),
handling of failed realloc(), out of bound array addressing in Schemas
date handling, Python space/tabs cleanups (Malcolm Tredinnick), NMTOKENS
E20 validation fix (Malcolm),
- improvements: added W3C XML Schemas testsuite (Kasimier Buchcik), add
xmlSchemaValidateOneElement (Kasimier), Python exception hierearchy
(Malcolm Tredinnick), Python libxml2 driver improvement (Malcolm
Tredinnick), Schemas support for xsi:schemaLocation,
xsi:noNamespaceSchemaLocation, xsi:type (Kasimier Buchcik)
2.6.13: Aug 31 2004:
- build fixes: Windows and zlib (Igor Zlatkovic), -O flag with gcc,
Solaris compiler warning, fixing RPM BuildRequires,
- fixes: DTD loading on Windows (Igor), Schemas error reports APIs
(Kasimier Buchcik), Schemas validation crash, xmlCheckUTF8 (William Brack
and Julius Mittenzwei), Schemas facet check (Kasimier), default namespace
problem (William), Schemas hexbinary empty values, encoding error could
generate a serialization loop.
- Improvements: Schemas validity improvements (Kasimier), added --path
and --load-trace options to xmllint
- documentation: tutorial update (John Fleck)
2.6.12: Aug 22 2004:
- build fixes: fix --with-minimum, elfgcchack.h fixes (Peter
Breitenlohner), perl path lookup (William), diff on Solaris (Albert
Chin), some 64bits cleanups.
- Python: avoid a warning with 2.3 (William Brack), tab and space mixes
(William), wrapper generator fixes (William), Cygwin support (Gerrit P.
Haase), node wrapper fix (Marc-Antoine Parent), XML Schemas support
(Torkel Lyng)
- Schemas: a lot of bug fixes and improvements from Kasimier Buchcik
- fixes: RVT fixes (William), XPath context resets bug (William), memory
debug (Steve Hay), catalog white space handling (Peter Breitenlohner),
xmlReader state after attribute reading (William), structured error
handler (William), XInclude generated xml:base fixup (William), Windows
memory reallocation problem (Steve Hay), Out of Memory conditions
handling (William and Olivier Andrieu), htmlNewDoc() charset bug,
htmlReadMemory init (William), a posteriori validation DTD base
(William), notations serialization missing, xmlGetNodePath (Dodji),
xmlCheckUTF8 (Diego Tartara), missing line numbers on entity
(William)
- improvements: DocBook catalog build scrip (William), xmlcatalog tool
(Albert Chin), xmllint --c14n option, no_proxy environment (Mike Hommey),
xmlParseInNodeContext() addition, extend xmllint --shell, allow XInclude
to not generate start/end nodes, extend xmllint --version to include CVS
tag (William)
- documentation: web pages fixes, validity API docs fixes (William)
schemas API fix (Eric Haszlakiewicz), xmllint man page (John Fleck)
2.6.11: July 5 2004:
- Schemas: a lot of changes and improvements by Kasimier Buchcik for
attributes, namespaces and simple types.
- build fixes: --with-minimum (William Brack), some gcc cleanup
(William), --with-thread-alloc (William)
- portability: Windows binary package change (Igor Zlatkovic), Catalog
path on Windows
- documentation: update to the tutorial (John Fleck), xmllint return code
(John Fleck), man pages (Ville Skytta),
- bug fixes: C14N bug serializing namespaces (Aleksey Sanin), testSAX
properly initialize the library (William), empty node set in XPath
(William), xmlSchemas errors (William), invalid charref problem pointed
by Morus Walter, XInclude xml:base generation (William), Relax-NG bug
with div processing (William), XPointer and xml:base problem(William),
Reader and entities, xmllint return code for schemas (William), reader
streaming problem (Steve Ball), DTD serialization problem (William),
libxml.m4 fixes (Mike Hommey), do not provide destructors as methods on
Python classes, xmlReader buffer bug, Python bindings memory interfaces
improvement (with Stéphane Bidoul), Fixed the push parser to be back to
synchronous behaviour.
- improvement: custom per-thread I/O enhancement (Rob Richards), register
namespace in debug shell (Stefano Debenedetti), Python based regression
test for non-Unix users (William), dynamically increase the number of
XPath extension functions in Python and fix a memory leak (Marc-Antoine
Parent and William)
- performance: hack done with Arjan van de Ven to reduce ELF footprint
and generated code on Linux, plus use gcc runtime profiling to optimize
the code generated in the RPM packages.
2.6.10: May 17 2004:
- Web page generated for ChangeLog
- build fixes: --without-html problems, make check without make all
- portability: problem with xpath.c on Windows (MSC and Borland), memcmp
vs. strncmp on Solaris, XPath tests on Windows (Mark Vakoc), C++ do not
use "list" as parameter name, make tests work with Python 1.5 (Ed
Davis),
- improvements: made xmlTextReaderMode public, small buffers resizing
(Morten Welinder), add --maxmem option to xmllint, add
xmlPopInputCallback() for Matt Sergeant, refactoring of serialization
escaping, added escaping customization
- bugfixes: xsd:extension (Taihei Goi), assorted regexp bugs (William
Brack), xmlReader end of stream problem, node deregistration with reader,
URI escaping and filemanes, XHTML1 formatting (Nick Wellnhofer), regexp
transition reduction (William), various XSD Schemas fixes (Kasimier
Buchcik), XInclude fallback problem (William), weird problems with DTD
(William), structured error handler callback context (William), reverse
xmlEncodeSpecialChars() behaviour back to escaping '"'
2.6.9: Apr 18 2004:
- implement xml:id Working Draft, relaxed XPath id() checking
- bugfixes: xmlCtxtReset (Brent Hendricks), line number and CDATA (Dave
Beckett), Relax-NG compilation (William Brack), Regexp patches (with
William), xmlUriEscape (Mark Vakoc), a Relax-NG notAllowed problem (with
William), Relax-NG name classes compares (William), XInclude duplicate
fallback (William), external DTD encoding detection (William), a DTD
validation bug (William), xmlReader Close() fix, recursive extension
schemas
- improvements: use xmlRead* APIs in test tools (Mark Vakoc), indenting
save optimization, better handle IIS broken HTTP redirect behaviour (Ian
Hummel), HTML parser frameset (James Bursa), libxml2-python RPM
dependency, XML Schemas union support (Kasimier Buchcik), warning removal
clanup (William), keep ChangeLog compressed when installing from RPMs
- documentation: examples and xmlDocDumpMemory docs (John Fleck), new
example (load, xpath, modify, save), xmlCatalogDump() comments,
- Windows: Borland C++ builder (Eric Zurcher), work around Microsoft
compiler NaN handling bug (Mark Vakoc)
2.6.8: Mar 23 2004:
- First step of the cleanup of the serialization code and APIs
- XML Schemas: mixed content (Adam Dickmeiss), QName handling fixes (Adam
Dickmeiss), anyURI for "" (John Belmonte)
- Python: Canonicalization C14N support added (Anthony Carrico)
- xmlDocCopyNode() extension (William)
- Relax-NG: fix when processing XInclude results (William), external
reference in interleave (William), missing error on <choice>
failure (William), memory leak in schemas datatype facets.
- xmlWriter: patch for better DTD support (Alfred Mickautsch)
- bug fixes: xmlXPathLangFunction memory leak (Mike Hommey and William
Brack), no ID errors if using HTML_PARSE_NOERROR, xmlcatalog fallbacks to
URI on SYSTEM lookup failure, XInclude parse flags inheritance (William),
XInclude and XPointer fixes for entities (William), XML parser bug
reported by Holger Rauch, nanohttp fd leak (William), regexps char
groups '-' handling (William), dictionary reference counting problems,
do not close stderr.
- performance patches from Petr Pajas
- Documentation fixes: XML_CATALOG_FILES in man pages (Mike Hommey)
- compilation and portability fixes: --without-valid, catalog cleanups
(Peter Breitenlohner), MingW patch (Roland Schwingel), cross-compilation
to Windows (Christophe de Vienne), --with-html-dir fixup (Julio Merino
Vidal), Windows build (Eric Zurcher)
2.6.7: Feb 23 2004:
- documentation: tutorial updates (John Fleck), benchmark results
- xmlWriter: updates and fixes (Alfred Mickautsch, Lucas Brasilino)
- XPath optimization (Petr Pajas)
- DTD ID handling optimization
- bugfixes: xpath number with > 19 fractional (William Brack), push
mode with unescaped '>' characters, fix xmllint --stream --timing, fix
xmllint --memory --stream memory usage, xmlAttrSerializeTxtContent
handling NULL, trying to fix Relax-NG/Perl interface.
- python: 2.3 compatibility, whitespace fixes (Malcolm Tredinnick)
- Added relaxng option to xmllint --shell
2.6.6: Feb 12 2004:
- nanohttp and nanoftp: buffer overflow error on URI parsing (Igor and
William) reported by Yuuichi Teranishi
- bugfixes: make test and path issues, xmlWriter attribute serialization
(William Brack), xmlWriter indentation (William), schemas validation
(Eric Haszlakiewicz), XInclude dictionaries issues (William and Oleg
Paraschenko), XInclude empty fallback (William), HTML warnings (William),
XPointer in XInclude (William), Python namespace serialization,
isolat1ToUTF8 bound error (Alfred Mickautsch), output of parameter
entities in internal subset (William), internal subset bug in push mode,
<xs:all> fix (Alexey Sarytchev)
- Build: fix for automake-1.8 (Alexander Winston), warnings removal
(Philip Ludlam), SOCKLEN_T detection fixes (Daniel Richard), fix
--with-minimum configuration.
- XInclude: allow the 2001 namespace without warning.
- Documentation: missing example/index.html (John Fleck), version
dependencies (John Fleck)
- reader API: structured error reporting (Steve Ball)
- Windows compilation: mingw, msys (Mikhail Grushinskiy), function
prototype (Cameron Johnson), MSVC6 compiler warnings, _WINSOCKAPI_
patch
- Parsers: added xmlByteConsumed(ctxt) API to get the byte offset in
input.
2.6.5: Jan 25 2004:
- Bugfixes: dictionaries for schemas (William Brack), regexp segfault
(William), xs:all problem (William), a number of XPointer bugfixes
(William), xmllint error go to stderr, DTD validation problem with
namespace, memory leak (William), SAX1 cleanup and minimal options fixes
(Mark Vadoc), parser context reset on error (Shaun McCance), XPath union
evaluation problem (William) , xmlReallocLoc with NULL (Aleksey Sanin),
XML Schemas double free (Steve Ball), XInclude with no href, argument
callbacks order for XPath callbacks (Frederic Peters)
- Documentation: python scripts (William Brack), xslt stylesheets (John
Fleck), doc (Sven Zimmerman), I/O example.
- Python bindings: fixes (William), enum support (Stéphane Bidoul),
structured error reporting (Stéphane Bidoul)
- XInclude: various fixes for conformance, problem related to dictionary
references (William & me), recursion (William)
- xmlWriter: indentation (Lucas Brasilino), memory leaks (Alfred
Mickautsch),
- xmlSchemas: normalizedString datatype (John Belmonte)
- code cleanup for strings functions (William)
- Windows: compiler patches (Mark Vakoc)
- Parser optimizations, a few new XPath and dictionary APIs for future
XSLT optimizations.
2.6.4: Dec 24 2003:
- Windows build fixes (Igor Zlatkovic)
- Some serious XInclude problems reported by Oleg Paraschenko and
- Unix and Makefile packaging fixes (me, William Brack,
- Documentation improvements (John Fleck, William Brack), example fix
(Lucas Brasilino)
- bugfixes: xmlTextReaderExpand() with xmlReaderWalker, XPath handling of
NULL strings (William Brack) , API building reader or parser from
filedescriptor should not close it, changed XPath sorting to be stable
again (William Brack), xmlGetNodePath() generating '(null)' (William
Brack), DTD validation and namespace bug (William Brack), XML Schemas
double inclusion behaviour
2.6.3: Dec 10 2003:
- documentation updates and cleanup (DV, William Brack, John Fleck)
- added a repository of examples, examples from Aleksey Sanin, Dodji
Seketeli, Alfred Mickautsch
- Windows updates: Mark Vakoc, Igor Zlatkovic, Eric Zurcher, Mingw
(Kenneth Haley)
- Unicode range checking (William Brack)
- code cleanup (William Brack)
- Python bindings: doc (John Fleck), bug fixes
- UTF-16 cleanup and BOM issues (William Brack)
- bug fixes: ID and xmlReader validation, XPath (William Brack),
xmlWriter (Alfred Mickautsch), hash.h inclusion problem, HTML parser
(James Bursa), attribute defaulting and validation, some serialization
cleanups, XML_GET_LINE macro, memory debug when using threads (William
Brack), serialization of attributes and entities content, xmlWriter
(Daniel Schulman)
- XInclude bugfix, new APIs and update to the last version including the
namespace change.
- XML Schemas improvements: include (Robert Stepanek), import and
namespace handling, fixed the regression tests troubles, added examples
based on Eric van der Vlist book, regexp fixes
- preliminary pattern support for streaming (needed for schemas
constraints), added xmlTextReaderPreservePattern() to collect subdocument
when streaming.
- various fixes in the structured error handling
2.6.2: Nov 4 2003:
- XPath context unregistration fixes
- text node coalescing fixes (Mark Lilback)
- API to screate a W3C Schemas from an existing document (Steve Ball)
- BeOS patches (Marcin 'Shard' Konicki)
- xmlStrVPrintf function added (Aleksey Sanin)
- compilation fixes (Mark Vakoc)
- stdin parsing fix (William Brack)
- a posteriori DTD validation fixes
- xmlReader bug fixes: Walker fixes, python bindings
- fixed xmlStopParser() to really stop the parser and errors
- always generate line numbers when using the new xmlReadxxx
functions
- added XInclude support to the xmlReader interface
- implemented XML_PARSE_NONET parser option
- DocBook XSLT processing bug fixed
- HTML serialization for <p> elements (William Brack and me)
- XPointer failure in XInclude are now handled as resource errors
- fixed xmllint --html to use the HTML serializer on output (added
--xmlout to implement the previous behaviour of saving it using the XML
serializer)
2.6.1: Oct 28 2003:
- Mostly bugfixes after the big 2.6.0 changes
- Unix compilation patches: libxml.m4 (Patrick Welche), warnings cleanup
(William Brack)
- Windows compilation patches (Joachim Bauch, Stephane Bidoul, Igor
Zlatkovic)
- xmlWriter bugfix (Alfred Mickautsch)
- chvalid.[ch]: couple of fixes from Stephane Bidoul
- context reset: error state reset, push parser reset (Graham
Bennett)
- context reuse: generate errors if file is not readable
- defaulted attributes for element coming from internal entities
(Stephane Bidoul)
- Python: tab and spaces mix (William Brack)
- Error handler could crash in DTD validation in 2.6.0
- xmlReader: do not use the document or element _private field
- testSAX.c: avoid a problem with some PIs (Massimo Morara)
- general bug fixes: mandatory encoding in text decl, serializing
Document Fragment nodes, xmlSearchNs 2.6.0 problem (Kasimier Buchcik),
XPath errors not reported, slow HTML parsing of large documents.
2.6.0: Oct 20 2003:
- Major revision release: should be API and ABI compatible but got a lot
of change
- Increased the library modularity, far more options can be stripped out,
a --with-minimum configuration will weight around 160KBytes
- Use per parser and per document dictionary, allocate names and small
text nodes from the dictionary
- Switch to a SAX2 like parser rewrote most of the XML parser core,
provides namespace resolution and defaulted attributes, minimize memory
allocations and copies, namespace checking and specific error handling,
immutable buffers, make predefined entities static structures, etc...
- rewrote all the error handling in the library, all errors can be
intercepted at a structured level, with precise information
available.
- New simpler and more generic XML and HTML parser APIs, allowing to
easily modify the parsing options and reuse parser context for multiple
consecutive documents.
- Similar new APIs for the xmlReader, for options and reuse, provided new
functions to access content as const strings, use them for Python
bindings
- a lot of other smaller API improvements: xmlStrPrintf (Aleksey Sanin),
Walker i.e. reader on a document tree based on Alfred Mickautsch code,
make room in nodes for line numbers, reference counting and future PSVI
extensions, generation of character ranges to be checked with faster
algorithm (William), xmlParserMaxDepth (Crutcher Dunnavant), buffer
access
- New xmlWriter API provided by Alfred Mickautsch
- Schemas: base64 support by Anthony Carrico
- Parser<->HTTP integration fix, proper processing of the Mime-Type
and charset information if available.
- Relax-NG: bug fixes including the one reported by Martijn Faassen and
zeroOrMore, better error reporting.
- Python bindings (Stéphane Bidoul), never use stdout for errors
output
- Portability: all the headers have macros for export and calling
convention definitions (Igor Zlatkovic), VMS update (Craig A. Berry),
Windows: threads (Jesse Pelton), Borland compiler (Eric Zurcher, Igor),
Mingw (Igor), typos (Mark Vakoc), beta version (Stephane Bidoul),
warning cleanups on AIX and MIPS compilers (William Brack), BeOS (Marcin
'Shard' Konicki)
- Documentation fixes and README (William Brack), search fix (William),
tutorial updates (John Fleck), namespace docs (Stefan Kost)
- Bug fixes: xmlCleanupParser (Dave Beckett), threading uninitialized
mutexes, HTML doctype lowercase, SAX/IO (William), compression detection
and restore (William), attribute declaration in DTDs (William), namespace
on attribute in HTML output (William), input filename (Rob Richards),
namespace DTD validation, xmlReplaceNode (Chris Ryland), I/O callbacks
(Markus Keim), CDATA serialization (Shaun McCance), xmlReader (Peter
Derr), high codepoint charref like , buffer access in push
mode (Justin Fletcher), TLS threads on Windows (Jesse Pelton), XPath bug
(William), xmlCleanupParser (Marc Liyanage), CDATA output (William), HTTP
error handling.
- xmllint options: --dtdvalidfpi for Tobias Reif, --sax1 for compat
testing, --nodict for building without tree dictionary, --nocdata to
replace CDATA by text, --nsclean to remove surperfluous namespace
declarations
- added xml2-config --libtool-libs option from Kevin P. Fleming
- a lot of profiling and tuning of the code, speedup patch for
xmlSearchNs() by Luca Padovani. The xmlReader should do far less
allocation and it speed should get closer to SAX. Chris Anderson worked
on speeding and cleaning up repetitive checking code.
- cleanup of "make tests"
- libxml-2.0-uninstalled.pc from Malcolm Tredinnick
- deactivated the broken docBook SGML parser code and plugged the XML
parser instead.
2.5.11: Sep 9 2003:
A bugfix only release: - risk of crash in Relax-NG
- risk of crash when using multithreaded programs
2.5.10: Aug 15 2003:
A bugfixes only release - Windows Makefiles (William Brack)
- UTF-16 support fixes (Mark Itzcovitz)
- Makefile and portability (William Brack) automake, Linux alpha, Mingw
on Windows (Mikhail Grushinskiy)
- HTML parser (Oliver Stoeneberg)
- XInclude performance problem reported by Kevin Ruscoe
- XML parser performance problem reported by Grant Goodale
- xmlSAXParseDTD() bug fix from Malcolm Tredinnick
- and a couple other cleanup
2.5.9: Aug 9 2003:
- bugfixes: IPv6 portability, xmlHasNsProp (Markus Keim), Windows build
(Wiliam Brake, Jesse Pelton, Igor), Schemas (Peter Sobisch), threading
(Rob Richards), hexBinary type (), UTF-16 BOM (Dodji Seketeli),
xmlReader, Relax-NG schemas compilation, namespace handling, EXSLT (Sean
Griffin), HTML parsing problem (William Brack), DTD validation for mixed
content + namespaces, HTML serialization, library initialization,
progressive HTML parser
- better interfaces for Relax-NG error handling (Joachim Bauch, )
- adding xmlXIncludeProcessTree() for XInclud'ing in a subtree
- doc fixes and improvements (John Fleck)
- configure flag for -with-fexceptions when embedding in C++
- couple of new UTF-8 helper functions (William Brack)
- general encoding cleanup + ISO-8859-x without iconv (Peter Jacobi)
- xmlTextReader cleanup + enum for node types (Bjorn Reese)
- general compilation/warning cleanup Solaris/HP-UX/... (William
Brack)
2.5.8: Jul 6 2003:
- bugfixes: XPath, XInclude, file/URI mapping, UTF-16 save (Mark
Itzcovitz), UTF-8 checking, URI saving, error printing (William Brack),
PI related memleak, compilation without schemas or without xpath (Joerg
Schmitz-Linneweber/Garry Pennington), xmlUnlinkNode problem with DTDs,
rpm problem on , i86_64, removed a few compilation problems from 2.5.7,
xmlIOParseDTD, and xmlSAXParseDTD (Malcolm Tredinnick)
- portability: DJGPP (MsDos) , OpenVMS (Craig A. Berry)
- William Brack fixed multithreading lock problems
- IPv6 patch for FTP and HTTP accesses (Archana Shah/Wipro)
- Windows fixes (Igor Zlatkovic, Eric Zurcher), threading (Stéphane
Bidoul)
- A few W3C Schemas Structure improvements
- W3C Schemas Datatype improvements (Charlie Bozeman)
- Python bindings for thread globals (Stéphane Bidoul), and method/class
generator
- added --nonet option to xmllint
- documentation improvements (John Fleck)
2.5.7: Apr 25 2003:
- Relax-NG: Compiling to regexp and streaming validation on top of the
xmlReader interface, added to xmllint --stream
- xmlReader: Expand(), Next() and DOM access glue, bug fixes
- Support for large files: RGN validated a 4.5GB instance
- Thread support is now configured in by default
- Fixes: update of the Trio code (Bjorn), WXS Date and Duration fixes
(Charles Bozeman), DTD and namespaces (Brent Hendricks), HTML push parser
and zero bytes handling, some missing Windows file path conversions,
behaviour of the parser and validator in the presence of "out of memory"
error conditions
- extended the API to be able to plug a garbage collecting memory
allocator, added xmlMallocAtomic() and modified the allocations
accordingly.
- Performances: removed excessive malloc() calls, speedup of the push and
xmlReader interfaces, removed excessive thread locking
- Documentation: man page (John Fleck), xmlReader documentation
- Python: adding binding for xmlCatalogAddLocal (Brent M Hendricks)
2.5.6: Apr 1 2003:
- Fixed W3C XML Schemas datatype, should be compliant now except for
binHex and base64 which are not supported yet.
- bug fixes: non-ASCII IDs, HTML output, XInclude on large docs and
XInclude entities handling, encoding detection on external subsets, XML
Schemas bugs and memory leaks, HTML parser (James Bursa)
- portability: python/trio (Albert Chin), Sun compiler warnings
- documentation: added --relaxng option to xmllint man page (John)
- improved error reporting: xml:space, start/end tag mismatches, Relax NG
errors
2.5.5: Mar 24 2003:
- Lot of fixes on the Relax NG implementation. More testing including
DocBook and TEI examples.
- Increased the support for W3C XML Schemas datatype
- Several bug fixes in the URI handling layer
- Bug fixes: HTML parser, xmlReader, DTD validation, XPath, encoding
conversion, line counting in the parser.
- Added support for $XMLLINT_INDENT environment variable, FTP delete
- Fixed the RPM spec file name
2.5.4: Feb 20 2003:
- Conformance testing and lot of fixes on Relax NG and XInclude
implementation
- Implementation of XPointer element() scheme
- Bug fixes: XML parser, XInclude entities merge, validity checking on
namespaces,
2 serialization bugs, node info generation problems, a DTD regexp
generation problem.
- Portability: windows updates and path canonicalization (Igor)
- A few typo fixes (Kjartan Maraas)
- Python bindings generator fixes (Stephane Bidoul)
2.5.3: Feb 10 2003:
- RelaxNG and XML Schemas datatypes improvements, and added a first
version of RelaxNG Python bindings
- Fixes: XLink (Sean Chittenden), XInclude (Sean Chittenden), API fix for
serializing namespace nodes, encoding conversion bug, XHTML1
serialization
- Portability fixes: Windows (Igor), AMD 64bits RPM spec file
2.5.2: Feb 5 2003:
- First implementation of RelaxNG, added --relaxng flag to xmllint
- Schemas support now compiled in by default.
- Bug fixes: DTD validation, namespace checking, XInclude and entities,
delegateURI in XML Catalogs, HTML parser, XML reader (Stéphane Bidoul),
XPath parser and evaluation, UTF8ToUTF8 serialization, XML reader memory
consumption, HTML parser, HTML serialization in the presence of
namespaces
- added an HTML API to check elements and attributes.
- Documentation improvement, PDF for the tutorial (John Fleck), doc
patches (Stefan Kost)
- Portability fixes: NetBSD (Julio Merino), Windows (Igor Zlatkovic)
- Added python bindings for XPointer, contextual error reporting
(Stéphane Bidoul)
- URI/file escaping problems (Stefano Zacchiroli)
2.5.1: Jan 8 2003:
- Fixes a memory leak and configuration/compilation problems in 2.5.0
- documentation updates (John)
- a couple of XmlTextReader fixes
2.5.0: Jan 6 2003:
- New XmltextReader interface based on C#
API (with help of Stéphane Bidoul)
- Windows: more exports, including the new API (Igor)
- XInclude fallback fix
- Python: bindings for the new API, packaging (Stéphane Bidoul),
drv_libxml2.py Python xml.sax driver (Stéphane Bidoul), fixes, speedup
and iterators for Python-2.2 (Hannu Krosing)
- Tutorial fixes (john Fleck and Niraj Tolia) xmllint man update
(John)
- Fix an XML parser bug raised by Vyacheslav Pindyura
- Fix for VMS serialization (Nigel Hall) and config (Craig A. Berry)
- Entities handling fixes
- new API to optionally track node creation and deletion (Lukas
Schroeder)
- Added documentation for the XmltextReader interface and some XML guidelines
2.4.30: Dec 12 2002:
- 2.4.29 broke the python bindings, rereleasing
- Improvement/fixes of the XML API generator, and couple of minor code
fixes.
2.4.29: Dec 11 2002:
- Windows fixes (Igor): Windows CE port, pthread linking, python bindings
(Stéphane Bidoul), Mingw (Magnus Henoch), and export list updates
- Fix for prev in python bindings (ERDI Gergo)
- Fix for entities handling (Marcus Clarke)
- Refactored the XML and HTML dumps to a single code path, fixed XHTML1
dump
- Fix for URI parsing when handling URNs with fragment identifiers
- Fix for HTTP URL escaping problem
- added an TextXmlReader (C#) like API (work in progress)
- Rewrote the API in XML generation script, includes a C parser and saves
more information needed for C# bindings
2.4.28: Nov 22 2002:
- a couple of python binding fixes
- 2 bug fixes in the XML push parser
- potential memory leak removed (Martin Stoilov)
- fix to the configure script for Unix (Dimitri Papadopoulos)
- added encoding support for XInclude parse="text"
- autodetection of XHTML1 and specific serialization rules added
- nasty threading bug fixed (William Brack)
2.4.27: Nov 17 2002:
- fixes for the Python bindings
- a number of bug fixes: SGML catalogs, xmlParseBalancedChunkMemory(),
HTML parser, Schemas (Charles Bozeman), document fragment support
(Christian Glahn), xmlReconciliateNs (Brian Stafford), XPointer,
xmlFreeNode(), xmlSAXParseMemory (Peter Jones), xmlGetNodePath (Petr
Pajas), entities processing
- added grep to xmllint --shell
- VMS update patch from Craig A. Berry
- cleanup of the Windows build with support for more compilers (Igor),
better thread support on Windows
- cleanup of Unix Makefiles and spec file
- Improvements to the documentation (John Fleck)
2.4.26: Oct 18 2002:
- Patches for Windows CE port, improvements on Windows paths handling
- Fixes to the validation code (DTD and Schemas), xmlNodeGetPath() ,
HTML serialization, Namespace compliance, and a number of small
problems
2.4.25: Sep 26 2002:
- A number of bug fixes: XPath, validation, Python bindings, DOM and
tree, xmlI/O, Html
- Serious rewrite of XInclude
- Made XML Schemas regexp part of the default build and APIs, small fix
and improvement of the regexp core
- Changed the validation code to reuse XML Schemas regexp APIs
- Better handling of Windows file paths, improvement of Makefiles (Igor,
Daniel Gehriger, Mark Vakoc)
- Improved the python I/O bindings, the tests, added resolver and regexp
APIs
- New logos from Marc Liyanage
- Tutorial improvements: John Fleck, Christopher Harris
- Makefile: Fixes for AMD x86_64 (Mandrake), DESTDIR (Christophe
Merlet)
- removal of all stderr/perror use for error reporting
- Better error reporting: XPath and DTD validation
- update of the trio portability layer (Bjorn Reese)
2.4.24: Aug 22 2002 - XPath fixes (William), xf:escape-uri() (Wesley Terpstra)
- Python binding fixes: makefiles (William), generator, rpm build, x86-64
(fcrozat)
- HTML <style> and boolean attributes serializer fixes
- C14N improvements by Aleksey
- doc cleanups: Rick Jones
- Windows compiler makefile updates: Igor and Elizabeth Barham
- XInclude: implementation of fallback and xml:base fixup added
2.4.23: July 6 2002:
- performances patches: Peter Jacobi
- c14n fixes, testsuite and performances: Aleksey Sanin
- added xmlDocFormatDump: Chema Celorio
- new tutorial: John Fleck
- new hash functions and performances: Sander Vesik, portability fix from
Peter Jacobi
- a number of bug fixes: XPath (William Brack, Richard Jinks), XML and
HTML parsers, ID lookup function
- removal of all remaining sprintf: Aleksey Sanin
2.4.22: May 27 2002:
- a number of bug fixes: configure scripts, base handling, parser, memory
usage, HTML parser, XPath, documentation (Christian Cornelssen),
indentation, URI parsing
- Optimizations for XMLSec, fixing and making public some of the network
protocol handlers (Aleksey)
- performance patch from Gary Pennington
- Charles Bozeman provided date and time support for XML Schemas
datatypes
2.4.21: Apr 29 2002:
This release is both a bug fix release and also contains the early XML
Schemas structures at
http://www.w3.org/TR/xmlschema-1/
and datatypes at
http://www.w3.org/TR/xmlschema-2/
code, beware, all
interfaces are likely to change, there is huge holes, it is clearly a work in
progress and don't even think of putting this code in a production system,
it's actually not compiled in by default. The real fixes are:
- a couple of bugs or limitations introduced in 2.4.20
- patches for Borland C++ and MSC by Igor
- some fixes on XPath strings and conformance patches by Richard
Jinks
- patch from Aleksey for the ExcC14N specification
- OSF/1 bug fix by Bjorn
2.4.20: Apr 15 2002:
- bug fixes: file descriptor leak, XPath, HTML output, DTD validation
- XPath conformance testing by Richard Jinks
- Portability fixes: Solaris, MPE/iX, Windows, OSF/1, python bindings,
libxml.m4
2.4.19: Mar 25 2002:
- bug fixes: half a dozen XPath bugs, Validation, ISO-Latin to UTF8
encoder
- portability fixes in the HTTP code
- memory allocation checks using valgrind, and profiling tests
- revamp of the Windows build and Makefiles
2.4.18: Mar 18 2002:
- bug fixes: tree, SAX, canonicalization, validation, portability,
XPath
- removed the --with-buffer option it was becoming unmaintainable
- serious cleanup of the Python makefiles
- speedup patch to XPath very effective for DocBook stylesheets
- Fixes for Windows build, cleanup of the documentation
2.4.17: Mar 8 2002:
- a lot of bug fixes, including "namespace nodes have no parents in
XPath"
- fixed/improved the Python wrappers, added more examples and more
regression tests, XPath extension functions can now return node-sets
- added the XML Canonicalization support from Aleksey Sanin
2.4.16: Feb 20 2002:
- a lot of bug fixes, most of them were triggered by the XML Testsuite
from OASIS and W3C. Compliance has been significantly improved.
- a couple of portability fixes too.
2.4.15: Feb 11 2002:
- Fixed the Makefiles, especially the python module ones
- A few bug fixes and cleanup
- Includes cleanup
2.4.14: Feb 8 2002:
- Change of License to the MIT
License basically for integration in XFree86 codebase, and removing
confusion around the previous dual-licensing
- added Python bindings, beta software but should already be quite
complete
- a large number of fixes and cleanups, especially for all tree
manipulations
- cleanup of the headers, generation of a reference API definition in
XML
2.4.13: Jan 14 2002:
- update of the documentation: John Fleck and Charlie Bozeman
- cleanup of timing code from Justin Fletcher
- fixes for Windows and initial thread support on Win32: Igor and Serguei
Narojnyi
- Cygwin patch from Robert Collins
- added xmlSetEntityReferenceFunc() for Keith Isdale work on xsldbg
2.4.12: Dec 7 2001:
- a few bug fixes: thread (Gary Pennington), xmllint (Geert Kloosterman),
XML parser (Robin Berjon), XPointer (Danny Jamshy), I/O cleanups
(robert)
- Eric Lavigne contributed project files for MacOS
- some makefiles cleanups
2.4.11: Nov 26 2001:
- fixed a couple of errors in the includes, fixed a few bugs, some code
cleanups
- xmllint man pages improvement by Heiko Rupp
- updated VMS build instructions from John A Fotheringham
- Windows Makefiles updates from Igor
2.4.10: Nov 10 2001:
- URI escaping fix (Joel Young)
- added xmlGetNodePath() (for paths or XPointers generation)
- Fixes namespace handling problems when using DTD and validation
- improvements on xmllint: Morus Walter patches for --format and
--encode, Stefan Kost and Heiko Rupp improvements on the --shell
- fixes for xmlcatalog linking pointed by Weiqi Gao
- fixes to the HTML parser
2.4.9: Nov 6 2001:
- fixes more catalog bugs
- avoid a compilation problem, improve xmlGetLineNo()
2.4.8: Nov 4 2001:
- fixed SGML catalogs broken in previous release, updated xmlcatalog
tool
- fixed a compile errors and some includes troubles.
2.4.7: Oct 30 2001:
- exported some debugging interfaces
- serious rewrite of the catalog code
- integrated Gary Pennington thread safety patch, added configure option
and regression tests
- removed an HTML parser bug
- fixed a couple of potentially serious validation bugs
- integrated the SGML DocBook support in xmllint
- changed the nanoftp anonymous login passwd
- some I/O cleanup and a couple of interfaces for Perl wrapper
- general bug fixes
- updated xmllint man page by John Fleck
- some VMS and Windows updates
2.4.6: Oct 10 2001:
- added an updated man pages by John Fleck
- portability and configure fixes
- an infinite loop on the HTML parser was removed (William)
- Windows makefile patches from Igor
- fixed half a dozen bugs reported for libxml or libxslt
- updated xmlcatalog to be able to modify SGML super catalogs
2.4.5: Sep 14 2001:
- Remove a few annoying bugs in 2.4.4
- forces the HTML serializer to output decimal charrefs since some
version of Netscape can't handle hexadecimal ones
1.8.16: Sep 14 2001:
- maintenance release of the old libxml1 branch, couple of bug and
portability fixes
2.4.4: Sep 12 2001:
- added --convert to xmlcatalog, bug fixes and cleanups of XML
Catalog
- a few bug fixes and some portability changes
- some documentation cleanups
2.4.3: Aug 23 2001:
- XML Catalog support see the doc
- New NaN/Infinity floating point code
- A few bug fixes
2.4.2: Aug 15 2001:
- adds xmlLineNumbersDefault() to control line number generation
- lot of bug fixes
- the Microsoft MSC projects files should now be up to date
- inheritance of namespaces from DTD defaulted attributes
- fixes a serious potential security bug
- added a --format option to xmllint
2.4.1: July 24 2001:
- possibility to keep line numbers in the tree
- some computation NaN fixes
- extension of the XPath API
- cleanup for alpha and ia64 targets
- patch to allow saving through HTTP PUT or POST
2.4.0: July 10 2001:
- Fixed a few bugs in XPath, validation, and tree handling.
- Fixed XML Base implementation, added a couple of examples to the
regression tests
- A bit of cleanup
2.3.14: July 5 2001:
- fixed some entities problems and reduce memory requirement when
substituting them
- lots of improvements in the XPath queries interpreter can be
substantially faster
- Makefiles and configure cleanups
- Fixes to XPath variable eval, and compare on empty node set
- HTML tag closing bug fixed
- Fixed an URI reference computation problem when validating
2.3.13: June 28 2001:
- 2.3.12 configure.in was broken as well as the push mode XML parser
- a few more fixes for compilation on Windows MSC by Yon Derek
1.8.14: June 28 2001:
- Zbigniew Chyla gave a patch to use the old XML parser in push mode
- Small Makefile fix
2.3.12: June 26 2001:
- lots of cleanup
- a couple of validation fix
- fixed line number counting
- fixed serious problems in the XInclude processing
- added support for UTF8 BOM at beginning of entities
- fixed a strange gcc optimizer bugs in xpath handling of float, gcc-3.0
miscompile uri.c (William), Thomas Leitner provided a fix for the
optimizer on Tru64
- incorporated Yon Derek and Igor Zlatkovic fixes and improvements for
compilation on Windows MSC
- update of libxml-doc.el (Felix Natter)
- fixed 2 bugs in URI normalization code
2.3.11: June 17 2001:
- updates to trio, Makefiles and configure should fix some portability
problems (alpha)
- fixed some HTML serialization problems (pre, script, and block/inline
handling), added encoding aware APIs, cleanup of this code
- added xmlHasNsProp()
- implemented a specific PI for encoding support in the DocBook SGML
parser
- some XPath fixes (-Infinity, / as a function parameter and namespaces
node selection)
- fixed a performance problem and an error in the validation code
- fixed XInclude routine to implement the recursive behaviour
- fixed xmlFreeNode problem when libxml is included statically twice
- added --version to xmllint for bug reports
2.3.10: June 1 2001:
- fixed the SGML catalog support
- a number of reported bugs got fixed, in XPath, iconv detection,
XInclude processing
- XPath string function should now handle unicode correctly
2.3.9: May 19 2001:
Lots of bugfixes, and added a basic SGML catalog support:
- HTML push bugfix #54891 and another patch from Jonas Borgstrom
- some serious speed optimization again
- some documentation cleanups
- trying to get better linking on Solaris (-R)
- XPath API cleanup from Thomas Broyer
- Validation bug fixed #54631, added a patch from Gary Pennington, fixed
xmlValidGetValidElements()
- Added an INSTALL file
- Attribute removal added to API: #54433
- added a basic support for SGML catalogs
- fixed xmlKeepBlanksDefault(0) API
- bugfix in xmlNodeGetLang()
- fixed a small configure portability problem
- fixed an inversion of SYSTEM and PUBLIC identifier in HTML document
1.8.13: May 14 2001:
- bugfixes release of the old libxml1 branch used by Gnome
2.3.8: May 3 2001:
- Integrated an SGML DocBook parser for the Gnome project
- Fixed a few things in the HTML parser
- Fixed some XPath bugs raised by XSLT use, tried to fix the floating
point portability issue
- Speed improvement (8M/s for SAX, 3M/s for DOM, 1.5M/s for
DOM+validation using the XML REC as input and a 700MHz celeron).
- incorporated more Windows cleanup
- added xmlSaveFormatFile()
- fixed problems in copying nodes with entities references (gdome)
- removed some troubles surrounding the new validation module
2.3.7: April 22 2001:
- lots of small bug fixes, corrected XPointer
- Non deterministic content model validation support
- added xmlDocCopyNode for gdome2
- revamped the way the HTML parser handles end of tags
- XPath: corrections of namespaces support and number formatting
- Windows: Igor Zlatkovic patches for MSC compilation
- HTML output fixes from P C Chow and William M. Brack
- Improved validation speed sensible for DocBook
- fixed a big bug with ID declared in external parsed entities
- portability fixes, update of Trio from Bjorn Reese
2.3.6: April 8 2001:
- Code cleanup using extreme gcc compiler warning options, found and
cleared half a dozen potential problem
- the Eazel team found an XML parser bug
- cleaned up the user of some of the string formatting function. used the
trio library code to provide the one needed when the platform is missing
them
- xpath: removed a memory leak and fixed the predicate evaluation
problem, extended the testsuite and cleaned up the result. XPointer seems
broken ...
2.3.5: Mar 23 2001:
- Biggest change is separate parsing and evaluation of XPath expressions,
there is some new APIs for this too
- included a number of bug fixes(XML push parser, 51876, notations,
52299)
- Fixed some portability issues
2.3.4: Mar 10 2001:
- Fixed bugs #51860 and #51861
- Added a global variable xmlDefaultBufferSize to allow default buffer
size to be application tunable.
- Some cleanup in the validation code, still a bug left and this part
should probably be rewritten to support ambiguous content model :-\
- Fix a couple of serious bugs introduced or raised by changes in 2.3.3
parser
- Fixed another bug in xmlNodeGetContent()
- Bjorn fixed XPath node collection and Number formatting
- Fixed a loop reported in the HTML parsing
- blank space are reported even if the Dtd content model proves that they
are formatting spaces, this is for XML conformance
2.3.3: Mar 1 2001:
- small change in XPath for XSLT
- documentation cleanups
- fix in validation by Gary Pennington
- serious parsing performances improvements
2.3.2: Feb 24 2001:
- chasing XPath bugs, found a bunch, completed some TODO
- fixed a Dtd parsing bug
- fixed a bug in xmlNodeGetContent
- ID/IDREF support partly rewritten by Gary Pennington
2.3.1: Feb 15 2001:
- some XPath and HTML bug fixes for XSLT
- small extension of the hash table interfaces for DOM gdome2
implementation
- A few bug fixes
2.3.0: Feb 8 2001 (2.2.12 was on 25 Jan but I didn't kept track):
- Lots of XPath bug fixes
- Add a mode with Dtd lookup but without validation error reporting for
XSLT
- Add support for text node without escaping (XSLT)
- bug fixes for xmlCheckFilename
- validation code bug fixes from Gary Pennington
- Patch from Paul D. Smith correcting URI path normalization
- Patch to allow simultaneous install of libxml-devel and
libxml2-devel
- the example Makefile is now fixed
- added HTML to the RPM packages
- tree copying bugfixes
- updates to Windows makefiles
- optimization patch from Bjorn Reese
2.2.11: Jan 4 2001:
- bunch of bug fixes (memory I/O, xpath, ftp/http, ...)
- added htmlHandleOmittedElem()
- Applied Bjorn Reese's IPV6 first patch
- Applied Paul D. Smith patches for validation of XInclude results
- added XPointer xmlns() new scheme support
2.2.10: Nov 25 2000:
- Fix the Windows problems of 2.2.8
- integrate OpenVMS patches
- better handling of some nasty HTML input
- Improved the XPointer implementation
- integrate a number of provided patches
2.2.9: Nov 25 2000:
- erroneous release :-(
2.2.8: Nov 13 2000:
- First version of XInclude
support
- Patch in conditional section handling
- updated MS compiler project
- fixed some XPath problems
- added an URI escaping function
- some other bug fixes
2.2.7: Oct 31 2000:
- added message redirection
- XPath improvements (thanks TOM !)
- xmlIOParseDTD() added
- various small fixes in the HTML, URI, HTTP and XPointer support
- some cleanup of the Makefile, autoconf and the distribution content
2.2.6: Oct 25 2000::
- Added an hash table module, migrated a number of internal structure to
those
- Fixed a posteriori validation problems
- HTTP module cleanups
- HTML parser improvements (tag errors, script/style handling, attribute
normalization)
- coalescing of adjacent text nodes
- couple of XPath bug fixes, exported the internal API
2.2.5: Oct 15 2000::
- XPointer implementation and testsuite
- Lot of XPath fixes, added variable and functions registration, more
tests
- Portability fixes, lots of enhancements toward an easy Windows build
and release
- Late validation fixes
- Integrated a lot of contributed patches
- added memory management docs
- a performance problem when using large buffer seems fixed
2.2.4: Oct 1 2000::
- main XPath problem fixed
- Integrated portability patches for Windows
- Serious bug fixes on the URI and HTML code
2.2.3: Sep 17 2000:
- bug fixes
- cleanup of entity handling code
- overall review of all loops in the parsers, all sprintf usage has been
checked too
- Far better handling of larges Dtd. Validating against DocBook XML Dtd
works smoothly now.
1.8.10: Sep 6 2000:
- bug fix release for some Gnome projects
2.2.2: August 12 2000:
- mostly bug fixes
- started adding routines to access xml parser context options
2.2.1: July 21 2000:
- a purely bug fixes release
- fixed an encoding support problem when parsing from a memory block
- fixed a DOCTYPE parsing problem
- removed a bug in the function allowing to override the memory
allocation routines
2.2.0: July 14 2000:
- applied a lot of portability fixes
- better encoding support/cleanup and saving (content is now always
encoded in UTF-8)
- the HTML parser now correctly handles encodings
- added xmlHasProp()
- fixed a serious problem with &
- propagated the fix to FTP client
- cleanup, bugfixes, etc ...
- Added a page about libxml Internationalization
support
1.8.9: July 9 2000:
- fixed the spec the RPMs should be better
- fixed a serious bug in the FTP implementation, released 1.8.9 to solve
rpmfind users problem
2.1.1: July 1 2000:
- fixes a couple of bugs in the 2.1.0 packaging
- improvements on the HTML parser
2.1.0 and 1.8.8: June 29 2000:
- 1.8.8 is mostly a commodity package for upgrading to libxml2 according
to new instructions. It fixes a nasty problem
about & charref parsing
- 2.1.0 also ease the upgrade from libxml v1 to the recent version. it
also contains numerous fixes and enhancements:
added xmlStopParser() to stop parsing
improved a lot parsing speed when there is large CDATA blocks
includes XPath patches provided by Picdar Technology
tried to fix as much as possible DTD validation and namespace
related problems
output to a given encoding has been added/tested
lot of various fixes
- added xmlStopParser() to stop parsing
- improved a lot parsing speed when there is large CDATA blocks
- includes XPath patches provided by Picdar Technology
- tried to fix as much as possible DTD validation and namespace
related problems
- output to a given encoding has been added/tested
- lot of various fixes
2.0.0: Apr 12 2000:
- First public release of libxml2. If you are using libxml, it's a good
idea to check the 1.x to 2.x upgrade instructions. NOTE: while initially
scheduled for Apr 3 the release occurred only on Apr 12 due to massive
workload.
- The include are now located under $prefix/include/libxml (instead of
$prefix/include/gnome-xml), they also are referenced by
#include <libxml/xxx.h>
instead of
#include "xxx.h"
- a new URI module for parsing URIs and following strictly RFC 2396
- the memory allocation routines used by libxml can now be overloaded
dynamically by using xmlMemSetup()
- The previously CVS only tool tester has been renamed
xmllint and is now installed as part of the libxml2
package
- The I/O interface has been revamped. There is now ways to plug in
specific I/O modules, either at the URI scheme detection level using
xmlRegisterInputCallbacks() or by passing I/O functions when creating a
parser context using xmlCreateIOParserCtxt()
- there is a C preprocessor macro LIBXML_VERSION providing the version
number of the libxml module in use
- a number of optional features of libxml can now be excluded at
configure time (FTP/HTTP/HTML/XPath/Debug)
2.0.0beta: Mar 14 2000:
- This is a first Beta release of libxml version 2
- It's available only fromxmlsoft.org
FTP, it's packaged as libxml2-2.0.0beta and available as tar and
RPMs
- This version is now the head in the Gnome CVS base, the old one is
available under the tag LIB_XML_1_X
- This includes a very large set of changes. From a programmatic point
of view applications should not have to be modified too much, check the
upgrade page
- Some interfaces may changes (especially a bit about encoding).
- the updates includes:
fix I18N support. ISO-Latin-x/UTF-8/UTF-16 (nearly) seems correctly
handled now
Better handling of entities, especially well-formedness checking
and proper PEref extensions in external subsets
DTD conditional sections
Validation now correctly handle entities content
change
structures to accommodate DOM
- fix I18N support. ISO-Latin-x/UTF-8/UTF-16 (nearly) seems correctly
handled now
- Better handling of entities, especially well-formedness checking
and proper PEref extensions in external subsets
- DTD conditional sections
- Validation now correctly handle entities content
- change
structures to accommodate DOM
- Serious progress were made toward compliance, here are the result of the test against the
OASIS testsuite (except the Japanese tests since I don't support that
encoding yet). This URL is rebuilt every couple of hours using the CVS
head version.
1.8.7: Mar 6 2000:
- This is a bug fix release:
- It is possible to disable the ignorable blanks heuristic used by
libxml-1.x, a new function xmlKeepBlanksDefault(0) will allow this. Note
that for adherence to XML spec, this behaviour will be disabled by
default in 2.x . The same function will allow to keep compatibility for
old code.
- Blanks in <a> </a> constructs are not ignored anymore,
avoiding heuristic is really the Right Way :-\
- The unchecked use of snprintf which was breaking libxml-1.8.6
compilation on some platforms has been fixed
- nanoftp.c nanohttp.c: Fixed '#' and '?' stripping when processing
URIs
1.8.6: Jan 31 2000:
- added a nanoFTP transport module, debugged until the new version of rpmfind can use
it without troubles
1.8.5: Jan 21 2000:
- adding APIs to parse a well balanced chunk of XML (production [43] content of the
XML spec)
- fixed a hideous bug in xmlGetProp pointed by Rune.Djurhuus@fast.no
- Jody Goldberg <jgoldberg@home.com> provided another patch trying
to solve the zlib checks problems
- The current state in gnome CVS base is expected to ship as 1.8.5 with
gnumeric soon
1.8.4: Jan 13 2000:
- bug fixes, reintroduced xmlNewGlobalNs(), fixed xmlNewNs()
- all exit() call should have been removed from libxml
- fixed a problem with INCLUDE_WINSOCK on WIN32 platform
- added newDocFragment()
1.8.3: Jan 5 2000:
- a Push interface for the XML and HTML parsers
- a shell-like interface to the document tree (try tester --shell :-)
- lots of bug fixes and improvement added over XMas holidays
- fixed the DTD parsing code to work with the xhtml DTD
- added xmlRemoveProp(), xmlRemoveID() and xmlRemoveRef()
- Fixed bugs in xmlNewNs()
- External entity loading code has been revamped, now it uses
xmlLoadExternalEntity(), some fix on entities processing were added
- cleaned up WIN32 includes of socket stuff
1.8.2: Dec 21 1999:
- I got another problem with includes and C++, I hope this issue is fixed
for good this time
- Added a few tree modification functions: xmlReplaceNode,
xmlAddPrevSibling, xmlAddNextSibling, xmlNodeSetName and
xmlDocSetRootElement
- Tried to improve the HTML output with help from Chris Lahey
1.8.1: Dec 18 1999:
- various patches to avoid troubles when using libxml with C++ compilers
the "namespace" keyword and C escaping in include files
- a problem in one of the core macros IS_CHAR was corrected
- fixed a bug introduced in 1.8.0 breaking default namespace processing,
and more specifically the Dia application
- fixed a posteriori validation (validation after parsing, or by using a
Dtd not specified in the original document)
- fixed a bug in
1.8.0: Dec 12 1999:
- cleanup, especially memory wise
- the parser should be more reliable, especially the HTML one, it should
not crash, whatever the input !
- Integrated various patches, especially a speedup improvement for large
dataset from Carl Nygard,
configure with --with-buffers to enable them.
- attribute normalization, oops should have been added long ago !
- attributes defaulted from DTDs should be available, xmlSetProp() now
does entities escaping by default.
1.7.4: Oct 25 1999:
- Lots of HTML improvement
- Fixed some errors when saving both XML and HTML
- More examples, the regression tests should now look clean
- Fixed a bug with contiguous charref
1.7.3: Sep 29 1999:
- portability problems fixed
- snprintf was used unconditionally, leading to link problems on system
were it's not available, fixed
1.7.1: Sep 24 1999:
- The basic type for strings manipulated by libxml has been renamed in
1.7.1 from CHAR to xmlChar. The reason
is that CHAR was conflicting with a predefined type on Windows. However
on non WIN32 environment, compatibility is provided by the way of a
#define .
- Changed another error : the use of a structure field called errno, and
leading to troubles on platforms where it's a macro
1.7.0: Sep 23 1999:
- Added the ability to fetch remote DTD or parsed entities, see the nanohttp module.
- Added an errno to report errors by another mean than a simple printf
like callback
- Finished ID/IDREF support and checking when validation
- Serious memory leaks fixed (there is now a memory wrapper module)
- Improvement of XPath
implementation
- Added an HTML parser front-end
Daniel Veillard at
bugs.html
doc/alt-libxml2-devel/tutorial/includexpath.c 0000644 00000002723 15173033512 0015240 0 ustar 00 <![CDATA[
#include <libxml/parser.h>
#include <libxml/xpath.h>
xmlDocPtr
getdoc (char *docname) {
xmlDocPtr doc;
doc = xmlParseFile(docname);
if (doc == NULL ) {
fprintf(stderr,"Document not parsed successfully. \n");
return NULL;
}
return doc;
}
xmlXPathObjectPtr
getnodeset (xmlDocPtr doc, xmlChar *xpath){
xmlXPathContextPtr context;
xmlXPathObjectPtr result;
context = xmlXPathNewContext(doc);
if (context == NULL) {
printf("Error in xmlXPathNewContext\n");
return NULL;
}
result = xmlXPathEvalExpression(xpath, context);
xmlXPathFreeContext(context);
if (result == NULL) {
printf("Error in xmlXPathEvalExpression\n");
return NULL;
}
if(xmlXPathNodeSetIsEmpty(result->nodesetval)){
xmlXPathFreeObject(result);
printf("No result\n");
return NULL;
}
return result;
}
int
main(int argc, char **argv) {
char *docname;
xmlDocPtr doc;
xmlChar *xpath = (xmlChar*) "//keyword";
xmlNodeSetPtr nodeset;
xmlXPathObjectPtr result;
int i;
xmlChar *keyword;
if (argc <= 1) {
printf("Usage: %s docname\n", argv[0]);
return(0);
}
docname = argv[1];
doc = getdoc(docname);
result = getnodeset (doc, xpath);
if (result) {
nodeset = result->nodesetval;
for (i=0; i < nodeset->nodeNr; i++) {
keyword = xmlNodeListGetString(doc, nodeset->nodeTab[i]->xmlChildrenNode, 1);
printf("keyword: %s\n", keyword);
xmlFree(keyword);
}
xmlXPathFreeObject (result);
}
xmlFreeDoc(doc);
xmlCleanupParser();
return (1);
}
]]>