Commit e4427bf9 authored by Éric Araujo's avatar Éric Araujo

Branch merge

parents d5a91961 87418afb
...@@ -34,7 +34,7 @@ the same library that the Python runtime is using. ...@@ -34,7 +34,7 @@ the same library that the Python runtime is using.
according to the user's locale). It is important to note that the according to the user's locale). It is important to note that the
argument list may be modified (but the contents of the strings argument list may be modified (but the contents of the strings
pointed to by the argument list are not). The return value will be pointed to by the argument list are not). The return value will be
```0``` if the interpreter exits normally (ie, without an ``0`` if the interpreter exits normally (i.e. without an
exception), ``1`` if the interpreter exits due to an exception, or exception), ``1`` if the interpreter exits due to an exception, or
``2`` if the parameter list does not represent a valid Python ``2`` if the parameter list does not represent a valid Python
command line. command line.
......
...@@ -21,7 +21,7 @@ setup script). Indirectly provides the :class:`distutils.dist.Distribution` and ...@@ -21,7 +21,7 @@ setup script). Indirectly provides the :class:`distutils.dist.Distribution` and
.. function:: setup(arguments) .. function:: setup(arguments)
The basic do-everything function that does most everything you could ever ask The basic do-everything function that does most everything you could ever ask
for from a Distutils method. See XXXXX for from a Distutils method.
The setup function takes a large number of arguments. These are laid out in the The setup function takes a large number of arguments. These are laid out in the
following table. following table.
...@@ -1759,7 +1759,7 @@ Subclasses of :class:`Command` must define the following methods. ...@@ -1759,7 +1759,7 @@ Subclasses of :class:`Command` must define the following methods.
predicate)``, with *command_name* a string and *predicate* a function, a predicate)``, with *command_name* a string and *predicate* a function, a
string or ``None``. *predicate* is a method of the parent command that string or ``None``. *predicate* is a method of the parent command that
determines whether the corresponding command is applicable in the current determines whether the corresponding command is applicable in the current
situation. (E.g. we ``install_headers`` is only applicable if we have any C situation. (E.g. ``install_headers`` is only applicable if we have any C
header files to install.) If *predicate* is ``None``, that command is always header files to install.) If *predicate* is ``None``, that command is always
applicable. applicable.
...@@ -2006,3 +2006,17 @@ The ``register`` command registers the package with the Python Package Index. ...@@ -2006,3 +2006,17 @@ The ``register`` command registers the package with the Python Package Index.
This is described in more detail in :pep:`301`. This is described in more detail in :pep:`301`.
.. % todo .. % todo
:mod:`distutils.command.check` --- Check the meta-data of a package
===================================================================
.. module:: distutils.command.check
:synopsis: Check the metadata of a package
The ``check`` command performs some tests on the meta-data of a package.
For example, it verifies that all required meta-data are provided as
the arguments passed to the :func:`setup` function.
.. % todo
...@@ -242,7 +242,7 @@ Glossary ...@@ -242,7 +242,7 @@ Glossary
processing, remembering the location execution state (including local processing, remembering the location execution state (including local
variables and pending try-statements). When the generator resumes, it variables and pending try-statements). When the generator resumes, it
picks-up where it left-off (in contrast to functions which start fresh on picks-up where it left-off (in contrast to functions which start fresh on
every invocation. every invocation).
.. index:: single: generator expression .. index:: single: generator expression
......
...@@ -527,7 +527,7 @@ are always available. They are listed here in alphabetical order. ...@@ -527,7 +527,7 @@ are always available. They are listed here in alphabetical order.
Two objects with non-overlapping lifetimes may have the same :func:`id` Two objects with non-overlapping lifetimes may have the same :func:`id`
value. value.
.. impl-detail:: This is the address of the object. .. impl-detail:: This is the address of the object in memory.
.. function:: input([prompt]) .. function:: input([prompt])
......
...@@ -192,7 +192,7 @@ Example ...@@ -192,7 +192,7 @@ Example
------- -------
To demonstrate several uses of the :func:`pprint` function and its parameters, To demonstrate several uses of the :func:`pprint` function and its parameters,
let's fetch information about a package from PyPI:: let's fetch information about a project from PyPI::
>>> import json >>> import json
>>> import pprint >>> import pprint
...@@ -200,8 +200,8 @@ let's fetch information about a package from PyPI:: ...@@ -200,8 +200,8 @@ let's fetch information about a package from PyPI::
>>> with urlopen('http://pypi.python.org/pypi/configparser/json') as url: >>> with urlopen('http://pypi.python.org/pypi/configparser/json') as url:
... http_info = url.info() ... http_info = url.info()
... raw_data = url.read().decode(http_info.get_content_charset()) ... raw_data = url.read().decode(http_info.get_content_charset())
>>> package_data = json.loads(raw_data) >>> project_info = json.loads(raw_data)
>>> result = {'headers': http_info.items(), 'body': package_data} >>> result = {'headers': http_info.items(), 'body': project_info}
In its basic form, :func:`pprint` shows the whole object:: In its basic form, :func:`pprint` shows the whole object::
......
...@@ -57,11 +57,15 @@ class BuildPyTestCase(support.TempdirManager, ...@@ -57,11 +57,15 @@ class BuildPyTestCase(support.TempdirManager,
self.assertEqual(len(cmd.get_outputs()), 3) self.assertEqual(len(cmd.get_outputs()), 3)
pkgdest = os.path.join(destination, "pkg") pkgdest = os.path.join(destination, "pkg")
files = os.listdir(pkgdest) files = os.listdir(pkgdest)
self.assertTrue("__init__.py" in files) self.assertIn("__init__.py", files)
self.assertTrue("__init__.pyc" in files) self.assertIn("README.txt", files)
self.assertTrue("README.txt" in files) # XXX even with -O, distutils writes pyc, not pyo; bug?
if sys.dont_write_bytecode:
def test_empty_package_dir (self): self.assertNotIn("__init__.pyc", files)
else:
self.assertIn("__init__.pyc", files)
def test_empty_package_dir(self):
# See SF 1668596/1720897. # See SF 1668596/1720897.
cwd = os.getcwd() cwd = os.getcwd()
...@@ -109,7 +113,7 @@ class BuildPyTestCase(support.TempdirManager, ...@@ -109,7 +113,7 @@ class BuildPyTestCase(support.TempdirManager,
finally: finally:
sys.dont_write_bytecode = old_dont_write_bytecode sys.dont_write_bytecode = old_dont_write_bytecode
self.assertTrue('byte-compiling is disabled' in self.logs[0][1]) self.assertIn('byte-compiling is disabled', self.logs[0][1])
def test_suite(): def test_suite():
return unittest.makeSuite(BuildPyTestCase) return unittest.makeSuite(BuildPyTestCase)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment