[Python-checkins] r71475 - in python/branches/py3k: Doc/distutils/apiref.rst Doc/distutils/examples.rst Lib/distutils/command/__init__.py Lib/distutils/command/check.py Lib/distutils/tests/test_check.py Misc/NEWS
tarek.ziade
python-checkins at python.org
Sat Apr 11 17:00:44 CEST 2009
Author: tarek.ziade
Date: Sat Apr 11 17:00:43 2009
New Revision: 71475
Log:
Merged revisions 71473 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r71473 | tarek.ziade | 2009-04-11 16:55:07 +0200 (Sat, 11 Apr 2009) | 1 line
#5732: added the check command into Distutils
........
Added:
python/branches/py3k/Lib/distutils/command/check.py
- copied unchanged from r71473, /python/trunk/Lib/distutils/command/check.py
python/branches/py3k/Lib/distutils/tests/test_check.py
- copied unchanged from r71473, /python/trunk/Lib/distutils/tests/test_check.py
Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Doc/distutils/apiref.rst
python/branches/py3k/Doc/distutils/examples.rst
python/branches/py3k/Lib/distutils/command/__init__.py
python/branches/py3k/Misc/NEWS
Modified: python/branches/py3k/Doc/distutils/apiref.rst
==============================================================================
--- python/branches/py3k/Doc/distutils/apiref.rst (original)
+++ python/branches/py3k/Doc/distutils/apiref.rst Sat Apr 11 17:00:43 2009
@@ -1950,6 +1950,19 @@
.. % 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.
+It makes sure for example that all required meta-data are provided through
+the arguments passed to the :func:`setup` function.
+
+.. % todo
+
Creating a new Distutils command
================================
Modified: python/branches/py3k/Doc/distutils/examples.rst
==============================================================================
--- python/branches/py3k/Doc/distutils/examples.rst (original)
+++ python/branches/py3k/Doc/distutils/examples.rst Sat Apr 11 17:00:43 2009
@@ -233,6 +233,58 @@
ext_modules=[Extension('foopkg.foo', ['foo.c'])],
)
+Checking a package
+==================
+
+The ``check`` command allows you to verify if your package meta-data are
+meeting the minimum requirements to build a distribution.
+
+To run it, just call it over your :file:`setup.py` script. If something is
+missing, ``check`` will display a warning.
+
+Let's take an example with a simple script::
+
+ from distutils.core import setup
+
+ setup(name='foobar')
+
+Running the ``check`` command will display some warnings::
+
+ $ python setup.py check
+ running check
+ warning: check: missing required meta-data: version ,url
+ warning: check: missing meta-data: either (author and author_email) or
+ (maintainer and maintainer_email) must be supplied
+
+
+If you use the reStructuredText syntax in the `long_description` field and
+`docutils <http://docutils.sourceforge.net/>`_ is installed you can check if
+the syntax is fine with the ``check`` command, using the `restructuredtext`
+option.
+
+For example, if the :file:`setup.py` script is changed like this::
+
+ from distutils.core import setup
+
+ desc = """\
+ My description
+ =============
+
+ This is the description of the ``foobar`` package.
+ """
+
+ setup(name='foobar', version='1', author='tarek',
+ author_email='tarek at ziade.org',
+ url='http://example.com', long_description=desc)
+
+Where the long description is broken, ``check`` will be able to detect it
+by using the `docutils` parser::
+
+ $ pythontrunk setup.py check --restructuredtext
+ running check
+ warning: check: Title underline too short. (line 2)
+ warning: check: Could not finish the parsing.
+
.. % \section{Multiple extension modules}
.. % \label{multiple-ext}
Modified: python/branches/py3k/Lib/distutils/command/__init__.py
==============================================================================
--- python/branches/py3k/Lib/distutils/command/__init__.py (original)
+++ python/branches/py3k/Lib/distutils/command/__init__.py Sat Apr 11 17:00:43 2009
@@ -22,6 +22,7 @@
'bdist_dumb',
'bdist_rpm',
'bdist_wininst',
+ 'check',
# These two are reserved for future use:
#'bdist_sdux',
#'bdist_pkgtool',
Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS (original)
+++ python/branches/py3k/Misc/NEWS Sat Apr 11 17:00:43 2009
@@ -340,6 +340,8 @@
Library
-------
+- Issue #5732: added a new command in Distutils: check.
+
- Issue #5731: Distutils bdist_wininst no longer worked on non-Windows
platforms. Initial patch by Paul Moore.
More information about the Python-checkins
mailing list