Commit 31886b77 authored by Jim Fulton's avatar Jim Fulton

Bug fixed: extras were ignored in some cases when versions were specified.

(Also removed some extra imports and made formatting changes.)
parent bb27e0fd
......@@ -13,6 +13,11 @@ Change History
- Used the download API to allow caching of base configurations (specified by
the buildout section's 'extends' option).
1.3.1 (2009-08-12)
==================
- Bug fixed: extras were ignored in some cases when versions were specified.
1.3.0 (2009-06-22)
==================
......
......@@ -34,7 +34,6 @@ import shutil
import subprocess
import sys
import tempfile
import urlparse
import zc.buildout
import zipimport
......@@ -55,7 +54,6 @@ is_win32 = sys.platform == 'win32'
is_jython = sys.platform.startswith('java')
if is_jython:
import subprocess
import java.lang.System
jython_os_name = (java.lang.System.getProperties()['os.name']).lower()
......@@ -621,7 +619,9 @@ class Installer:
raise IncompatibleVersionError("Bad version", version)
requirement = pkg_resources.Requirement.parse(
"%s ==%s" % (requirement.project_name, version))
"%s[%s] ==%s" % (requirement.project_name,
','.join(requirement.extras),
version))
return requirement
......
......@@ -16,12 +16,19 @@
$Id$
"""
import os, re, shutil, sys, tempfile, unittest, zipfile
from zope.testing import doctest, renormalizing
from zope.testing import doctest
from zope.testing import renormalizing
import os
import pkg_resources
import zc.buildout.testing, zc.buildout.easy_install
import re
import shutil
import sys
import tempfile
import unittest
import zc.buildout.easy_install
import zc.buildout.testing
import zc.buildout.testselectingpython
import zipfile
os_path_sep = os.path.sep
if os_path_sep == '\\':
......@@ -2527,6 +2534,29 @@ def warn_users_when_expanding_shell_patterns_yields_no_results():
"""
def make_sure_versions_dont_cancel_extras():
"""
There was a bug that caused extras in requirements to be lost.
>>> open('setup.py', 'w').write('''
... from setuptools import setup
... setup(name='extraversiondemo', version='1.0',
... url='x', author='x', author_email='x',
... extras_require=dict(foo=['demo']), py_modules=['t'])
... ''')
>>> open('README', 'w').close()
>>> open('t.py', 'w').close()
>>> sdist('.', sample_eggs)
>>> mkdir('dest')
>>> ws = zc.buildout.easy_install.install(
... ['extraversiondemo[foo]'], 'dest', links=[sample_eggs],
... versions = dict(extraversiondemo='1.0')
... )
>>> sorted(dist.key for dist in ws)
['demo', 'demoneeded', 'extraversiondemo']
"""
######################################################################
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment