Commit fbf26248 authored by Jason R. Coombs's avatar Jason R. Coombs

Removed Features functionality. Fixes #65.

parent 65b76ae3
...@@ -18,6 +18,7 @@ CHANGES ...@@ -18,6 +18,7 @@ CHANGES
tarball. This approach avoids the potential security vulnerabilities tarball. This approach avoids the potential security vulnerabilities
presented by use of tar files. It also leverages the security features added presented by use of tar files. It also leverages the security features added
to ZipFile.extract in Python 2.7.4. to ZipFile.extract in Python 2.7.4.
* Issue #65: Removed deprecated Features functionality.
--- ---
2.3 2.3
......
...@@ -9,11 +9,11 @@ from distutils.util import convert_path ...@@ -9,11 +9,11 @@ from distutils.util import convert_path
import setuptools.version import setuptools.version
from setuptools.extension import Extension from setuptools.extension import Extension
from setuptools.dist import Distribution, Feature, _get_unpatched from setuptools.dist import Distribution, _get_unpatched
from setuptools.depends import Require from setuptools.depends import Require
__all__ = [ __all__ = [
'setup', 'Distribution', 'Feature', 'Command', 'Extension', 'Require', 'setup', 'Distribution', 'Command', 'Extension', 'Require',
'find_packages' 'find_packages'
] ]
......
This diff is collapsed.
...@@ -231,89 +231,6 @@ class DistroTests(unittest.TestCase): ...@@ -231,89 +231,6 @@ class DistroTests(unittest.TestCase):
self.dist.exclude, package_dir=['q'] self.dist.exclude, package_dir=['q']
) )
class FeatureTests(unittest.TestCase):
def setUp(self):
self.req = Require('Distutils','1.0.3','distutils')
self.dist = makeSetup(
features={
'foo': Feature("foo",standard=True,require_features=['baz',self.req]),
'bar': Feature("bar", standard=True, packages=['pkg.bar'],
py_modules=['bar_et'], remove=['bar.ext'],
),
'baz': Feature(
"baz", optional=False, packages=['pkg.baz'],
scripts = ['scripts/baz_it'],
libraries=[('libfoo','foo/foofoo.c')]
),
'dwim': Feature("DWIM", available=False, remove='bazish'),
},
script_args=['--without-bar', 'install'],
packages = ['pkg.bar', 'pkg.foo'],
py_modules = ['bar_et', 'bazish'],
ext_modules = [Extension('bar.ext',['bar.c'])]
)
def testDefaults(self):
self.assertTrue(not
Feature(
"test",standard=True,remove='x',available=False
).include_by_default()
)
self.assertTrue(
Feature("test",standard=True,remove='x').include_by_default()
)
# Feature must have either kwargs, removes, or require_features
self.assertRaises(DistutilsSetupError, Feature, "test")
def testAvailability(self):
self.assertRaises(
DistutilsPlatformError,
self.dist.features['dwim'].include_in, self.dist
)
def testFeatureOptions(self):
dist = self.dist
self.assertTrue(
('with-dwim',None,'include DWIM') in dist.feature_options
)
self.assertTrue(
('without-dwim',None,'exclude DWIM (default)') in dist.feature_options
)
self.assertTrue(
('with-bar',None,'include bar (default)') in dist.feature_options
)
self.assertTrue(
('without-bar',None,'exclude bar') in dist.feature_options
)
self.assertEqual(dist.feature_negopt['without-foo'],'with-foo')
self.assertEqual(dist.feature_negopt['without-bar'],'with-bar')
self.assertEqual(dist.feature_negopt['without-dwim'],'with-dwim')
self.assertTrue(not 'without-baz' in dist.feature_negopt)
def testUseFeatures(self):
dist = self.dist
self.assertEqual(dist.with_foo,1)
self.assertEqual(dist.with_bar,0)
self.assertEqual(dist.with_baz,1)
self.assertTrue(not 'bar_et' in dist.py_modules)
self.assertTrue(not 'pkg.bar' in dist.packages)
self.assertTrue('pkg.baz' in dist.packages)
self.assertTrue('scripts/baz_it' in dist.scripts)
self.assertTrue(('libfoo','foo/foofoo.c') in dist.libraries)
self.assertEqual(dist.ext_modules,[])
self.assertEqual(dist.require_features, [self.req])
# If we ask for bar, it should fail because we explicitly disabled
# it on the command line
self.assertRaises(DistutilsOptionError, dist.include_feature, 'bar')
def testFeatureWithInvalidRemove(self):
self.assertRaises(
SystemExit, makeSetup, features = {'x':Feature('x', remove='y')}
)
class TestCommandTests(unittest.TestCase): class TestCommandTests(unittest.TestCase):
def testTestIsCommand(self): def testTestIsCommand(self):
......
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