[Python-checkins] devinabox: Tweak a few things

nick.coghlan python-checkins at python.org
Tue Jul 2 14:46:02 CEST 2013


http://hg.python.org/devinabox/rev/53a1f44a6219
changeset:   48:53a1f44a6219
user:        Nick Coghlan <ncoghlan at gmail.com>
date:        Tue Jul 02 22:45:52 2013 +1000
summary:
  Tweak a few things

files:
  .hgignore        |   2 ++
  README           |  22 +++++++++++++++-------
  full_coverage.py |  13 ++++++++++---
  3 files changed, 27 insertions(+), 10 deletions(-)


diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -5,6 +5,8 @@
 cpython
 devguide
 peps
+# Unversioned downloads
+Visual C++ Express/vc_web.exe
 # Generated
 coverage_report
 original_coverage_report
diff --git a/README b/README
--- a/README
+++ b/README
@@ -26,6 +26,10 @@
 get updates, sparing the probably taxed internet connection at the sprint from
 doing complete repository cloning.
 
+If recreating from an old checkout ``hg purge --all`` in the individual
+clones is a handy way to ensure old build artifacts have been removed.
+You will need to enable the purge extension in ``~/.hgrc``.
+
 
 Mercurial
 ---------
@@ -104,15 +108,16 @@
 
 01. Build the CPython repository
 02. Clone the repository from https://bitbucket.org/ned/coveragepy
-03. Download Distribute from https://pypi.python.org/pypi/distribute
-04. Unpack and build Distribute with Python 3 in the coveragepy repository
-05. Symlink the ``distribute-N.N.N/build/lib/setuptools`` directory into
-   ``coveragepy``
-06. Symlink ``distribute-N.N.N/build/lib/pkg_resources.py`` into ``coveragepy``
+03. Clone setuptools from https://bitbucket.org/pypa/setuptools/
+04. Run ``python3 setup.py build`` in the ``setuptools`` directory
+05. Run ``ln -s ../setuptools/build/lib/setuptools`` in the ``coveragepy``
+    directory
+06. Run ``ln -s ../setuptools/build/lib/pkg_resources.py`` in the
+    ``coveragepy`` directory
 07. Run ``./cpython/python full_coverage.py build``
 08. Run ``./cpython/python full_coverage.py run``
 09. Run ``./cpython/python full_coverage.py html original_coverage_report``
-10. ``make distclean`` the CPython repository
+10. Run ``hg purge --all`` in the CPython repository
 
 
 All these steps will generate a complete coverage report for the standard
@@ -150,9 +155,12 @@
 just simplifies this by having a single command subsume both the configure and
 build steps. It also uses reasonable defaults (e.g. all cores on the CPU).
 
+(You may need to cd into the CPython directory and run ``make`` to get the
+extension modules to build)
+
 
 ``index.html``
 --------------
 
 An HTML file with links to the various pieces of documentation you built
-previously and the helper scripts.
\ No newline at end of file
+previously and the helper scripts.
diff --git a/full_coverage.py b/full_coverage.py
--- a/full_coverage.py
+++ b/full_coverage.py
@@ -29,6 +29,13 @@
     yield
     os.chdir(original_directory)
 
+def make_setup_cmd(*args):
+    # Silence a spurious warning from setuptools
+    # See https://bitbucket.org/pypa/setuptools/issue/29/
+    cmd = [sys.executable, '-W', 'ignore::UserWarning:distutils.dist',
+           'setup.py']
+    cmd.extend(args)
+    return cmd
 
 def build(args):
     """Build coverage.py's C-based tracer.
@@ -43,11 +50,11 @@
                 os.unlink(tracer_path)
             except FileNotFoundError:
                 pass
-        subprocess.check_call([sys.executable, 'setup.py', 'clean'])
+        subprocess.check_call(make_setup_cmd('clean'))
         env = os.environ.copy()
         env['CPPFLAGS'] = '-I {} -I {}'.format(CPYTHON,
                                                os.path.join(CPYTHON, 'Include'))
-        command = [sys.executable, 'setup.py', 'build_ext', '--inplace']
+        command = make_setup_cmd('build_ext', '--inplace')
         process = subprocess.Popen(command, env=env)
         process.wait()
 
@@ -124,4 +131,4 @@
         help_args = ['-h']
         if args.command:
             help_args.insert(0, args.command)
-        parser.parse_args(help_args)
\ No newline at end of file
+        parser.parse_args(help_args)

-- 
Repository URL: http://hg.python.org/devinabox


More information about the Python-checkins mailing list