[Python-checkins] distutils2: one more case
tarek.ziade
python-checkins at python.org
Fri May 14 22:36:12 CEST 2010
tarek.ziade pushed 4235fd5e0d6b to distutils2:
http://hg.python.org/distutils2/rev/4235fd5e0d6b
changeset: 148:4235fd5e0d6b
user: Tarek Ziade <tarek at ziade.org>
date: Fri May 14 16:51:22 2010 +0200
summary: one more case
files: src/distutils2/tests/conversions/04_after.py, src/distutils2/tests/conversions/04_before.py
diff --git a/src/distutils2/tests/conversions/04_after.py b/src/distutils2/tests/conversions/04_after.py
new file mode 100644
--- /dev/null
+++ b/src/distutils2/tests/conversions/04_after.py
@@ -0,0 +1,69 @@
+import sys, os
+try:
+ from distutils2.core import setup
+ kw = {'entry_points':
+ """[console_scripts]\nvirtualenv = virtualenv:main\n""",
+ 'zip_safe': False}
+except ImportError:
+ from distutils2.core import setup
+ if sys.platform == 'win32':
+ print('Note: without Setuptools installed you will have to use "python -m virtualenv ENV"')
+ else:
+ kw = {'scripts': ['scripts/virtualenv']}
+import re
+
+here = os.path.dirname(os.path.abspath(__file__))
+
+## Figure out the version from virtualenv.py:
+version_re = re.compile(
+ r'virtualenv_version = "(.*?)"')
+fp = open(os.path.join(here, 'virtualenv.py'))
+version = None
+for line in fp:
+ match = version_re.search(line)
+ if match:
+ version = match.group(1)
+ break
+else:
+ raise Exception("Cannot find version in virtualenv.py")
+fp.close()
+
+## Get long_description from index.txt:
+f = open(os.path.join(here, 'docs', 'index.txt'))
+long_description = f.read().strip()
+long_description = long_description.split('split here', 1)[1]
+f.close()
+
+## A warning just for Ian (related to distribution):
+try:
+ import getpass
+except ImportError:
+ is_ianb = False
+else:
+ is_ianb = getpass.getuser() == 'ianb'
+
+if is_ianb and 'register' in sys.argv:
+ if 'hg tip\n~~~~~~' in long_description:
+ print >> sys.stderr, (
+ "WARNING: hg tip is in index.txt")
+
+setup(name='virtualenv',
+ version=version,
+ summary="Virtual Python Environment builder",
+ description=long_description,
+ classifiers=[
+ 'Development Status :: 4 - Beta',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: MIT License',
+ ],
+ keywords='setuptools deployment installation distutils',
+ author='Ian Bicking',
+ author_email='ianb at colorstudy.com',
+ home_page='http://virtualenv.openplans.org',
+ license='MIT',
+ use_2to3=True,
+ py_modules=['virtualenv'],
+ packages=['virtualenv_support'],
+ package_data={'virtualenv_support': ['*-py%s.egg' % sys.version[:3], '*.tar.gz']},
+ **kw
+ )
diff --git a/src/distutils2/tests/conversions/04_before.py b/src/distutils2/tests/conversions/04_before.py
new file mode 100644
--- /dev/null
+++ b/src/distutils2/tests/conversions/04_before.py
@@ -0,0 +1,69 @@
+import sys, os
+try:
+ from setuptools import setup
+ kw = {'entry_points':
+ """[console_scripts]\nvirtualenv = virtualenv:main\n""",
+ 'zip_safe': False}
+except ImportError:
+ from distutils.core import setup
+ if sys.platform == 'win32':
+ print('Note: without Setuptools installed you will have to use "python -m virtualenv ENV"')
+ else:
+ kw = {'scripts': ['scripts/virtualenv']}
+import re
+
+here = os.path.dirname(os.path.abspath(__file__))
+
+## Figure out the version from virtualenv.py:
+version_re = re.compile(
+ r'virtualenv_version = "(.*?)"')
+fp = open(os.path.join(here, 'virtualenv.py'))
+version = None
+for line in fp:
+ match = version_re.search(line)
+ if match:
+ version = match.group(1)
+ break
+else:
+ raise Exception("Cannot find version in virtualenv.py")
+fp.close()
+
+## Get long_description from index.txt:
+f = open(os.path.join(here, 'docs', 'index.txt'))
+long_description = f.read().strip()
+long_description = long_description.split('split here', 1)[1]
+f.close()
+
+## A warning just for Ian (related to distribution):
+try:
+ import getpass
+except ImportError:
+ is_ianb = False
+else:
+ is_ianb = getpass.getuser() == 'ianb'
+
+if is_ianb and 'register' in sys.argv:
+ if 'hg tip\n~~~~~~' in long_description:
+ print >> sys.stderr, (
+ "WARNING: hg tip is in index.txt")
+
+setup(name='virtualenv',
+ version=version,
+ description="Virtual Python Environment builder",
+ long_description=long_description,
+ classifiers=[
+ 'Development Status :: 4 - Beta',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: MIT License',
+ ],
+ keywords='setuptools deployment installation distutils',
+ author='Ian Bicking',
+ author_email='ianb at colorstudy.com',
+ url='http://virtualenv.openplans.org',
+ license='MIT',
+ use_2to3=True,
+ py_modules=['virtualenv'],
+ packages=['virtualenv_support'],
+ package_data={'virtualenv_support': ['*-py%s.egg' % sys.version[:3], '*.tar.gz']},
+ **kw
+ )
--
Repository URL: http://hg.python.org/distutils2
More information about the Python-checkins
mailing list