Obsolete deprecations from 1.x #153

Merged
merged 1 commit into from Dec 4, 2015
Jump to file or symbol
Failed to load files and symbols.
+18 −63
Split
@@ -7,7 +7,7 @@ icon: icon.svg
parts:
make-project:
- plugin: make-project
+ plugin: make
source: .
stage-packages:
- libxml2-dev
@@ -7,6 +7,6 @@ icon: icon.png
parts:
bzr:
- plugin: make-project
+ plugin: make
source: .
source-type: bzr
@@ -7,7 +7,7 @@ icon: icon.png
parts:
bzr:
- plugin: make-project
+ plugin: make
source: .
source-type: bzr
source-tag: initial
@@ -7,9 +7,9 @@ icon: icon.png
parts:
p1:
- plugin: make-project
+ plugin: make
source: .
p2:
- plugin: make-project
+ plugin: make
source: ./p2
after: [p1]
@@ -7,7 +7,7 @@ icon: icon.png
parts:
git:
- plugin: make-project
+ plugin: make
source: .
source-type: git
source-branch: second
@@ -7,6 +7,6 @@ icon: icon.png
parts:
git:
- plugin: make-project
+ plugin: make
source: .
source-type: git
@@ -7,7 +7,7 @@ icon: icon.png
parts:
git:
- plugin: make-project
+ plugin: make
source: .
source-type: git
source-tag: initial
@@ -7,7 +7,7 @@ icon: icon.png
parts:
mercurial:
- plugin: make-project
+ plugin: make
source: .
source-type: hg
source-branch: second
@@ -7,6 +7,6 @@ icon: icon.png
parts:
mercurial:
- plugin: make-project
+ plugin: make
source: .
source-type: hg
@@ -7,7 +7,7 @@ icon: icon.png
parts:
mercurial:
- plugin: make-project
+ plugin: make
source: .
source-type: hg
source-tag: initial
@@ -7,5 +7,5 @@ icon: icon.png
parts:
make-project:
- plugin: make-project
+ plugin: make
source: .
@@ -12,5 +12,5 @@ config: usr/bin/config.py
parts:
config:
- plugin: python3-project
+ plugin: python3
source: .
@@ -7,5 +7,5 @@ icon: icon.png
parts:
cmake-project:
- plugin: cmake-project
+ plugin: cmake
source: .
@@ -7,7 +7,7 @@ icon: icon.png
parts:
make-project:
- plugin: make-project
+ plugin: make
filesets:
files:
- share/file1
@@ -7,5 +7,5 @@ icon: icon.png
parts:
make-project:
- plugin: make-project
+ plugin: make
source: .
@@ -31,6 +31,6 @@ parts:
plugin: tar-content
source: readonly-files.tar.gz
project:
- plugin: make-project
+ plugin: make
source: project.tar.xz
source-type: tar
@@ -272,28 +272,6 @@ def test_invalid_yaml_invalid_name_chars(self, mock_loadPlugin):
raised.exception.message,
'\'myapp@me_1.0\' does not match \'^[a-z0-9][a-z0-9+-]*$\'')
- @unittest.mock.patch('snapcraft.yaml.Config.load_plugin')
- def test_deprecation_for_type(self, mock_loadPlugin):
- fake_logger = fixtures.FakeLogger(level=logging.WARNING)
- self.useFixture(fake_logger)
-
- self.make_snapcraft_yaml("""name: myapp
-version: "1"
-vendor: me <me@me.com>
-summary: test
-description: nothing
-icon: my-icon.png
-
-parts:
- part1:
- type: go
- stage-packages: [fswebcam]
-""")
- config = snapcraft.yaml.Config()
- self.assertEqual(fake_logger.output,
- 'DEPRECATED: Use "plugin" instead of "type"\n')
- self.assertFalse('type' in config.data)
-
@unittest.mock.patch('snapcraft.yaml.Config.load_plugin')
def test_invalid_yaml_missing_description(self, mock_loadPlugin):
fake_logger = fixtures.FakeLogger(level=logging.ERROR)
View
@@ -34,18 +34,6 @@
logger = logging.getLogger(__name__)
-_DEPRECATION_LIST = [
- 'ant-project',
- 'autotools-project',
- 'cmake-project',
- 'go-project',
- 'make-project',
- 'maven-project',
- 'python2-project',
- 'python3-project',
-]
-
-
@jsonschema.FormatChecker.cls_checks('file-path')
@jsonschema.FormatChecker.cls_checks('icon-path')
def _validate_file_exists(instance):
@@ -116,11 +104,7 @@ def __init__(self):
properties = self.data['parts'][part_name] or {}
plugin_name = properties.pop('plugin', None)
- # TODO search the wiki
- if not plugin_name and 'type' in properties:
- plugin_name = properties.pop('type')
- logger.warning('DEPRECATED: Use "plugin" instead of "type"')
- elif not plugin_name:
+ if not plugin_name:
logger.info(
'Searching the wiki to compose part "{}"'.format(
part_name))
@@ -131,13 +115,6 @@ def __init__(self):
if not plugin_name:
raise PluginNotDefinedError(part_name)
- if plugin_name in _DEPRECATION_LIST:
- plugin_name = plugin_name.rsplit('-project')[0]
- logger.warning(
- 'DEPRECATED: plugin names ending in -project are '
- 'deprecated. Using {0} instead of {0}-project'.format(
- plugin_name))
-
if 'after' in properties:
self.after_requests[part_name] = properties.pop('after')