[Python-checkins] r69732 - in distutils/trunk: EXTERNALS.txt README.txt setup.cfg setup.py

tarek.ziade python-checkins at python.org
Wed Feb 18 13:43:23 CET 2009


Author: tarek.ziade
Date: Wed Feb 18 13:43:23 2009
New Revision: 69732

Log:
setting up an external to release Python's Distutils at PyPI

Added:
   distutils/trunk/EXTERNALS.txt   (contents, props changed)
   distutils/trunk/setup.cfg   (contents, props changed)
   distutils/trunk/setup.py   (contents, props changed)
Modified:
   distutils/trunk/   (props changed)
   distutils/trunk/README.txt

Added: distutils/trunk/EXTERNALS.txt
==============================================================================
--- (empty file)
+++ distutils/trunk/EXTERNALS.txt	Wed Feb 18 13:43:23 2009
@@ -0,0 +1 @@
+distutils http://svn.python.org/projects/python/trunk/Lib/distutils/

Modified: distutils/trunk/README.txt
==============================================================================
--- distutils/trunk/README.txt	(original)
+++ distutils/trunk/README.txt	Wed Feb 18 13:43:23 2009
@@ -1,12 +1,17 @@
-=======
-Warning
-=======
+=========
+Distutils
+=========
 
-The Distutils standalone project is no longer maintained.
-You may find the latest trunk version in the branches in `latest_trunk_r318`.
+This is the standalone distribution of Distutils,
+that gets Distutils from Python into its own package.
 
-The Distutils package is now part of the Standard Library and is maintained
-and evolves there.
+To install it, just run::
+
+    $ python setup.py install
+
+And remove or rename the Distutils version located
+in your Python library directory.
 
 Distutils-SIG home page : http://www.python.org/community/sigs/current/distutils-sig
 
+

Added: distutils/trunk/setup.cfg
==============================================================================
--- (empty file)
+++ distutils/trunk/setup.cfg	Wed Feb 18 13:43:23 2009
@@ -0,0 +1,48 @@
+#
+# setup.cfg
+#
+# the Distutils config file.  Just as with the Distutils setup script, this
+# has the dual purpose of being used to distribute the Distutils and
+# serving as an example of some of the things you can do with Distutils
+# config files.  Currently, this is only useful for me (assuming I'm the
+# only person who creates Distutils source and RPM distributions), but you
+# could add build and installation preferences here, too.  (Although those
+# sorts of things are probably best handled on a site-wide or per-user
+# basis, rather than in the config file for each module distribution.)
+#
+# $Id: setup.cfg 317 2003-10-24 18:50:38Z akuchling $
+#
+
+[sdist]
+formats=gztar,zip
+
+[bdist_rpm]
+release = 1
+packager = A.M. Kuchling <amk at amk.ca>
+doc_files = CHANGES.txt
+            README.txt
+            doc/
+            examples/
+
+changelog =
+  * Fri Oct 24 2003 A.M. Kuchling <amk at amk.ca> 1.1
+  - Updated for the Distutils 1.1 code base.
+
+  * Thu Jun 29 2000 Greg Ward <gward at python.net> 0.9
+  - Made myself the packager, since I can now create the RPM on my own
+
+  * Sun Jun 04 2000 Harry Henry Gebel <hgebel at inet.net> 0.9pre-1
+  - Made sure scripts are file names, filled in some help strings, formatted
+    changelog correctly
+
+  * Wed May 31 2000 Greg Ward <gward at python.net> 0.8.3pre-1
+  - Hacked up bdist_rpm.py, moved meta-data into setup.cfg
+
+  * Thu May 10 2000 Harry Henry Gebel <hgebel at inet.net> 0.8.2-3
+  - Added new options to package_data
+
+  * Tue May 09 2000 Harry Henry Gebel <hgebel at inet.net> 0.8.2-2
+  - Include RPM_OPT_FLAGS in distutils
+
+  * Wed Apr 26 2000 Harry Henry Gebel <hgebel at inet.net> 0.8.2-1
+  - First test of bdist_rpm

Added: distutils/trunk/setup.py
==============================================================================
--- (empty file)
+++ distutils/trunk/setup.py	Wed Feb 18 13:43:23 2009
@@ -0,0 +1,76 @@
+#!/usr/bin/env python
+# -*- encoding: utf8 -*-
+__revision__ = "$Id$"
+import sys
+import re
+import os
+
+from distutils.core import setup
+
+# to be removed for stable releases
+TRUNK_VERSION = True
+
+# the reStructuredText contained in
+# README.txt will be displayed in PyPI
+README_FILE = open('README.txt')
+try:
+    description = README_FILE.read()
+finally:
+    README_FILE.close()
+
+# taken from setuptools
+def get_svn_revision():
+    """Will get the svn revision out of .svn"""
+    revision = 0
+    urlre = re.compile('url="([^"]+)"')
+    revre = re.compile('committed-rev="(\d+)"')
+
+    for base, dirs, files in os.walk(os.curdir):
+        if '.svn' not in dirs:
+            dirs[:] = []
+            continue
+        dirs.remove('.svn')
+        f = open(os.path.join(base, '.svn', 'entries'))
+        data = f.read()
+        f.close()
+
+        if data.startswith('9') or data.startswith('8'):
+            data = map(str.splitlines,data.split('\n\x0c\n'))
+            del data[0][0]  # get rid of the '8' or '9'
+            dirurl = data[0][3]
+            localrev = max([int(d[9]) for d in data if len(d)>9 and d[9]]+[0])
+        elif data.startswith('<?xml'):
+            dirurl = urlre.search(data).group(1)    # get repository URL
+            localrev = max([int(m.group(1)) for m in revre.finditer(data)]+[0])
+            dirs[:] = []
+            continue
+        if base == os.curdir:
+            base_url = dirurl + '/'   # save the root url
+        elif not dirurl.startswith(base_url):
+            dirs[:] = []
+            continue    # not part of the same svn tree, skip it
+        revision = max(revision, localrev)
+
+    return str(revision)
+
+if TRUNK_VERSION:
+    # for dev releases, the version is computed
+    # with the svn tag
+    version = '%sdev-r%s' % (sys.version.split()[0],
+                             get_svn_revision())
+else:
+    version = sys.version.split()[0]
+
+setup (name="distutils",
+       version=version,
+       description = "Python Distribution Utilities",
+       author = "Greg Ward",
+       author_email = "gward at python.net",
+       maintainer = "Tarek Ziadé",
+       maintainer_email = "tarek at ziade.org",
+       url = "http://www.python.org/sigs/distutils-sig",
+       license = "Python",
+       long_description = description,
+       packages = ['distutils'],
+      )
+


More information about the Python-checkins mailing list