[reader] Finally remove long deprecated bits

First removed in 80421d81b547, then brought back in 7ac70945c667. Use of these 2 functions/methods was dropped just before CubicWeb 3.21.0. Adjust dependencies accordingly.

Related to #287000.

authorRémi Cardona <remi.cardona@logilab.fr>
changeset4bd91c0919d0
branchdefault
phasepublic
hiddenno
parent revision#d570c08e89ae Stop injecting '_' into python's builtins
child revision#99b1150d8d5c [schema2sql] Drop module
files modified by this revision
debian/control
python-yams.spec
reader.py
# HG changeset patch
# User Rémi Cardona <remi.cardona@logilab.fr>
# Date 1445002733 -7200
# Fri Oct 16 15:38:53 2015 +0200
# Node ID 4bd91c0919d02a2b249ac3ec7eda706c2e3c23bf
# Parent d570c08e89ae45ef7f4db934ff516f7a27b5a739
[reader] Finally remove long deprecated bits

First removed in 80421d81b547, then brought back in 7ac70945c667. Use
of these 2 functions/methods was dropped just before CubicWeb 3.21.0.
Adjust dependencies accordingly.

Related to #287000.

diff --git a/debian/control b/debian/control
@@ -29,11 +29,12 @@
1   ${python:Depends},
2   ${misc:Depends},
3   python-logilab-common (>= 0.55.2),
4   python-logilab-database (>= 1.11),
5   python-six (>= 1.4.0),
6 -Breaks: cubicweb-common (<< 3.20)
7 +Breaks:
8 + cubicweb-common (<< 3.21),
9  Description: entity / relation schema
10   Yet Another Magic Schema !
11   A simple/generic but powerful entities / relations schema, suitable
12   to represent RDF like data. The schema is readable/writable from/to
13   various formats.
diff --git a/python-yams.spec b/python-yams.spec
@@ -20,10 +20,11 @@
14  Url:            http://www.logilab.org/project/yams
15 
16  Requires:       %{python}, %{python}-logilab-common >= 0.55.2, %{python}-logilab-database >= 1.11
17  Requires:       %{python}-six >= 1.4.0
18  BuildRequires:  %{python}
19 +Conflicts:      cubicweb < 3.21.0
20 
21 
22  %description
23  Yet Another Magic Schema ! A simple/generic but powerful entities / relations
24  schema, suitable to represent RDF like data. The schema is readable/writable
diff --git a/reader.py b/reader.py
@@ -35,18 +35,10 @@
25 
26  from yams import UnknownType, BadSchemaDefinition, BASE_TYPES
27  from yams import constraints, schema as schemamod
28  from yams import buildobjs
29 
30 -def obsolete(cls):
31 -    def wrapped(*args, **kwargs):
32 -        reason = '%s should be explictly imported from %s' % (
33 -            cls.__name__, cls.__module__)
34 -        warn(reason, DeprecationWarning, stacklevel=2)
35 -        return cls(*args, **kwargs)
36 -    return wrapped
37 -
38 
39  CONSTRAINTS = {}
40  # add constraint classes to the context
41  for objname in dir(constraints):
42      if objname[0] == '_':
@@ -205,24 +197,10 @@
43          """
44          if not issubclass(defobject, buildobjs.Definition):
45              raise BadSchemaDefinition(filepath, 'invalid definition object')
46          defobject.expand_type_definitions(self.defined)
47 
48 -    def import_erschema(self, ertype, schemamod=None, instantiate=True):
49 -        warn('import_erschema is deprecated, use explicit import once schema '
50 -             'is turned into a proper python module (eg not expecting '
51 -             'predefined context in globals)', DeprecationWarning, stacklevel=3)
52 -        try:
53 -            erdef = self.defined[ertype]
54 -            name = getattr(erdef, 'name', erdef.__name__)
55 -            if name == ertype:
56 -                assert instantiate, 'can\'t get class of an already registered type'
57 -                return erdef
58 -        except KeyError:
59 -            pass
60 -        assert False, 'ooups'
61 -
62      def exec_file(self, filepath):
63          try:
64              modname = '.'.join(modpath_from_file(filepath, self.extrapath))
65              doimport = True
66          except ImportError: