[Python-checkins] r69258 - in sandbox/trunk/importlib: README setup.py

brett.cannon python-checkins at python.org
Tue Feb 3 06:47:41 CET 2009


Author: brett.cannon
Date: Tue Feb  3 06:47:41 2009
New Revision: 69258

Log:
Create setup.py and README for distribution along with svn:ignore for the
typical distutils stuff.


Added:
   sandbox/trunk/importlib/README
   sandbox/trunk/importlib/setup.py
Modified:
   sandbox/trunk/importlib/   (props changed)

Added: sandbox/trunk/importlib/README
==============================================================================
--- (empty file)
+++ sandbox/trunk/importlib/README	Tue Feb  3 06:47:41 2009
@@ -0,0 +1,11 @@
+Purpose
+========
+
+This package contains the code from importlib as found in Python 2.7. It is
+provided so that people who wish to use importlib.import_module() with a
+version of Python prior to 2.7 or in 3.0 have the function readily available.
+The code in no way deviates from what can be found in the 2.7 trunk.
+
+For documentaition, see the `importlib docs`_ for Python 2.7.
+
+.. _importlib docs: http://docs.python.org/dev/library/importlib.html

Added: sandbox/trunk/importlib/setup.py
==============================================================================
--- (empty file)
+++ sandbox/trunk/importlib/setup.py	Tue Feb  3 06:47:41 2009
@@ -0,0 +1,36 @@
+from distutils.core import setup
+import sys
+
+
+if sys.version_info[0] == 2 and sys.version_info[1] >= 7:
+    raise Exception("importlib is included in Python 2.7 and newer for 2.x")
+elif sys.version_info[0] == 3 and sys.version_info[1] >= 1:
+    raise Exception("importlib is included in Python 3.1 and newer for 3.x")
+
+
+version_classifiers = ['Programming Language :: Python :: %s' % version
+                        for version in [ '2.5', '2.6', '3.0']]
+other_classifiers = [
+        'Development Status :: 5 - Production/Stable',
+        'License :: OSI Approved :: Python Software Foundation License',
+    ]
+
+readme_file = open('README', 'r')
+try:
+    detailed_description = readme_file.read()
+finally:
+    readme_file.close()
+
+
+setup(
+        name='importlib',
+        version='1.0',
+        description='Backport of importlib.import_module() from Python 2.7',
+        long_description=detailed_description,
+        author='Brett Cannon',
+        author_email='brett at python.org',
+        url='http://svn.python.org/view/sandbox/trunk/importlib/',
+        packages=['importlib'],
+        data_files=['README'],
+        classifiers=version_classifiers + other_classifiers,
+    )


More information about the Python-checkins mailing list