# HG changeset patch # User Aurelien Campeas # Date 1377526350 -7200 # Node ID 46f41c3e14435e30641c6f732261a712cc50be79 # Parent e1369f2dba79b3e74762f34219e5c51e1b51a502 remove 3.8 bw compat - cwconfig: old keys such as depends_cubes and non-dict dependencies - cwctl: fall back to docstring if no short descr, forget 'short_descr' - dbapi: session_data, get_session_data, set_session_data, del_session_data - dbapi & testlib, session: eid_key is gone - migractions: cachekey is gone - doc/datamodel/definition, schemaserial: BoundConstraint -> BoundaryConstraint - formwidgets: separator - primary view: render_entity_metadata Related to #2782004. diff -r e1369f2dba79 -r 46f41c3e1443 cwconfig.py --- a/cwconfig.py Fri Oct 04 17:05:49 2013 +0200 +++ b/cwconfig.py Mon Aug 26 16:12:30 2013 +0200 @@ -499,21 +499,11 @@ try: gendeps = getattr(pkginfo, key.replace('_cubes', '')) except AttributeError: - # bw compat - if hasattr(pkginfo, oldkey): - warn('[3.8] cube %s: %s is deprecated, use %s dict' - % (cube, oldkey, key), DeprecationWarning) - deps = getattr(pkginfo, oldkey) - else: - deps = {} + deps = {} else: deps = dict( (x[len('cubicweb-'):], v) for x, v in gendeps.iteritems() if x.startswith('cubicweb-')) - if not isinstance(deps, dict): - deps = dict((key, None) for key in deps) - warn('[3.8] cube %s should define %s as a dict' % (cube, key), - DeprecationWarning) for depcube in deps: try: newname = CW_MIGRATION_MAP[depcube] diff -r e1369f2dba79 -r 46f41c3e1443 cwctl.py --- a/cwctl.py Fri Oct 04 17:05:49 2013 +0200 +++ b/cwctl.py Mon Aug 26 16:12:30 2013 +0200 @@ -266,12 +266,7 @@ if tinfo: descr = getattr(tinfo, 'description', '') if not descr: - descr = getattr(tinfo, 'short_desc', '') - if descr: - warn('[3.8] short_desc is deprecated, update %s' - ' pkginfo' % cube, DeprecationWarning) - else: - descr = tinfo.__doc__ + descr = tinfo.__doc__ if descr: print ' '+ ' \n'.join(descr.splitlines()) modes = detect_available_modes(cwcfg.cube_dir(cube)) diff -r e1369f2dba79 -r 46f41c3e1443 dbapi.py --- a/dbapi.py Fri Oct 04 17:05:49 2013 +0200 +++ b/dbapi.py Mon Aug 26 16:12:30 2013 +0200 @@ -422,25 +422,6 @@ req.set_session(self.session, user) return req - @deprecated('[3.8] use direct access to req.session.data dictionary') - def session_data(self): - """return a dictionary containing session data""" - return self.session.data - - @deprecated('[3.8] use direct access to req.session.data dictionary') - def get_session_data(self, key, default=None, pop=False): - if pop: - return self.session.data.pop(key, default) - return self.session.data.get(key, default) - - @deprecated('[3.8] use direct access to req.session.data dictionary') - def set_session_data(self, key, value): - self.session.data[key] = value - - @deprecated('[3.8] use direct access to req.session.data dictionary') - def del_session_data(self, key): - self.session.data.pop(key, None) - # these are overridden by set_log_methods below # only defining here to prevent pylint from complaining info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None @@ -486,7 +467,7 @@ def _txid(self): return self.connection._txid(self) - def execute(self, rql, args=None, eid_key=None, build_descr=True): + def execute(self, rql, args=None, build_descr=True): """execute a rql query, return resulting rows and their description in a :class:`~cubicweb.rset.ResultSet` object @@ -517,10 +498,6 @@ execute('Any X WHERE X eid %(x)s', {'x': 123}) """ - if eid_key is not None: - warn('[3.8] eid_key is deprecated, you can safely remove this argument', - DeprecationWarning, stacklevel=2) - # XXX use named argument for build_descr in case repo is < 3.8 rset = self._repo.execute(self._sessid, rql, args, build_descr=build_descr, **self._txid()) rset.req = self.req diff -r e1369f2dba79 -r 46f41c3e1443 devtools/testlib.py --- a/devtools/testlib.py Fri Oct 04 17:05:49 2013 +0200 +++ b/devtools/testlib.py Mon Aug 26 16:12:30 2013 +0200 @@ -419,13 +419,10 @@ return self.cnx.cursor(req or self.request()) @nocoverage - def execute(self, rql, args=None, eidkey=None, req=None): + def execute(self, rql, args=None, req=None): """executes , builds a resultset, and returns a couple (rset, req) where req is a FakeRequest """ - if eidkey is not None: - warn('[3.8] eidkey is deprecated, you can safely remove this argument', - DeprecationWarning, stacklevel=2) req = req or self.request(rql=rql) return req.execute(unicode(rql), args) @@ -447,10 +444,7 @@ # server side db api ####################################################### - def sexecute(self, rql, args=None, eid_key=None): - if eid_key is not None: - warn('[3.8] eid_key is deprecated, you can safely remove this argument', - DeprecationWarning, stacklevel=2) + def sexecute(self, rql, args=None): self.session.set_cnxset() return self.session.execute(rql, args) @@ -986,15 +980,6 @@ self.assertEqual(len(MAILBOX), nb_msgs) return messages - # deprecated ############################################################### - - @deprecated('[3.8] use self.execute(...).get_entity(0, 0)') - def entity(self, rql, args=None, eidkey=None, req=None): - if eidkey is not None: - warn('[3.8] eidkey is deprecated, you can safely remove this argument', - DeprecationWarning, stacklevel=2) - return self.execute(rql, args, req=req).get_entity(0, 0) - # auto-populating test classes and utilities ################################### diff -r e1369f2dba79 -r 46f41c3e1443 doc/3.18.rst --- a/doc/3.18.rst Fri Oct 04 17:05:49 2013 +0200 +++ b/doc/3.18.rst Mon Aug 26 16:12:30 2013 +0200 @@ -27,3 +27,4 @@ * ``ldapuser`` have been dropped; use ``ldapfeed`` now (see `#2936496 `_) +* all 3.8 backward compat is gone diff -r e1369f2dba79 -r 46f41c3e1443 doc/book/en/devrepo/datamodel/definition.rst --- a/doc/book/en/devrepo/datamodel/definition.rst Fri Oct 04 17:05:49 2013 +0200 +++ b/doc/book/en/devrepo/datamodel/definition.rst Mon Aug 26 16:12:30 2013 +0200 @@ -226,13 +226,13 @@ * `SizeConstraint`: allows to specify a minimum and/or maximum size on string (generic case of `maxsize`) -* `BoundConstraint`: allows to specify a minimum and/or maximum value +* `BoundaryConstraint`: allows to specify a minimum and/or maximum value on numeric types and date .. sourcecode:: python - from yams.constraints import BoundConstraint, TODAY - BoundConstraint('<=', TODAY()) + from yams.constraints import BoundaryConstraint, TODAY + BoundaryConstraint('<=', TODAY()) * `IntervalBoundConstraint`: allows to specify an interval with included values diff -r e1369f2dba79 -r 46f41c3e1443 server/migractions.py --- a/server/migractions.py Fri Oct 04 17:05:49 2013 +0200 +++ b/server/migractions.py Mon Aug 26 16:12:30 2013 +0200 @@ -1461,12 +1461,9 @@ # no result to fetch return - def rqlexec(self, rql, kwargs=None, cachekey=None, build_descr=True, + def rqlexec(self, rql, kwargs=None, build_descr=True, ask_confirm=False): """rql action""" - if cachekey is not None: - warn('[3.8] cachekey is deprecated, you can safely remove this argument', - DeprecationWarning, stacklevel=2) if not isinstance(rql, (tuple, list)): rql = ( (rql, kwargs), ) res = None diff -r e1369f2dba79 -r 46f41c3e1443 server/schemaserial.py --- a/server/schemaserial.py Fri Oct 04 17:05:49 2013 +0200 +++ b/server/schemaserial.py Mon Aug 26 16:12:30 2013 +0200 @@ -77,8 +77,6 @@ def cstrtype_mapping(cursor): """cached constraint types mapping""" map = dict(cursor.execute('Any T, X WHERE X is CWConstraintType, X name T')) - if not 'BoundConstraint' in map: - map['BoundConstraint'] = map['BoundaryConstraint'] return map # schema / perms deserialization ############################################## @@ -344,13 +342,10 @@ cstrtypemap = {} rql = 'INSERT CWConstraintType X: X name %(ct)s' for cstrtype in CONSTRAINTS: - if cstrtype == 'BoundConstraint': - continue # XXX deprecated in yams 0.29 / cw 3.8.1 cstrtypemap[cstrtype] = execute(rql, {'ct': unicode(cstrtype)}, build_descr=False)[0][0] if pb is not None: pb.update() - cstrtypemap['BoundConstraint'] = cstrtypemap['BoundaryConstraint'] # serialize relations for rschema in schema.relations(): # skip virtual relations such as eid, has_text and identity diff -r e1369f2dba79 -r 46f41c3e1443 server/session.py --- a/server/session.py Fri Oct 04 17:05:49 2013 +0200 +++ b/server/session.py Mon Aug 26 16:12:30 2013 +0200 @@ -1176,14 +1176,11 @@ source_from_eid = tx_meth('source_from_eid') - def execute(self, rql, kwargs=None, eid_key=None, build_descr=True): + def execute(self, rql, kwargs=None, build_descr=True): """db-api like method directly linked to the querier execute method. See :meth:`cubicweb.dbapi.Cursor.execute` documentation. """ - if eid_key is not None: - warn('[3.8] eid_key is deprecated, you can safely remove this argument', - DeprecationWarning, stacklevel=2) self.timestamp = time() # update timestamp rset = self._execute(self, rql, kwargs, build_descr) rset.req = self diff -r e1369f2dba79 -r 46f41c3e1443 web/formwidgets.py --- a/web/formwidgets.py Fri Oct 04 17:05:49 2013 +0200 +++ b/web/formwidgets.py Mon Aug 26 16:12:30 2013 +0200 @@ -588,13 +588,7 @@ def _render(self, form, field, renderer): curvalues, attrs = self.values_and_attributes(form, field) domid = attrs.pop('id', None) - # XXX turn this as initializer argument - try: - sep = attrs.pop('separator') - warn('[3.8] separator should be specified using initializer argument', - DeprecationWarning) - except KeyError: - sep = self.separator + sep = self.separator options = [] for i, option in enumerate(field.vocabulary(form)): try: diff -r e1369f2dba79 -r 46f41c3e1443 web/views/primary.py --- a/web/views/primary.py Fri Oct 04 17:05:49 2013 +0200 +++ b/web/views/primary.py Mon Aug 26 16:12:30 2013 +0200 @@ -189,10 +189,6 @@ def render_entity_toolbox(self, entity): self.content_navigation_components('ctxtoolbar') - @deprecated('[3.8] render_entity_metadata method is deprecated') - def render_entity_metadata(self, entity): - entity.view('metadata', w=self.w) - def summary(self, entity): """default implementation return an empty string""" return u'' diff -r e1369f2dba79 -r 46f41c3e1443 web/views/urlrewrite.py --- a/web/views/urlrewrite.py Fri Oct 04 17:05:49 2013 +0200 +++ b/web/views/urlrewrite.py Mon Aug 26 16:12:30 2013 +0200 @@ -140,7 +140,7 @@ return None, None -def build_rset(rql, rgxgroups=None, cachekey=None, setuser=False, +def build_rset(rql, rgxgroups=None, setuser=False, vid=None, vtitle=None, form={}, **kwargs): def do_build_rset(inputurl, uri, req, schema, kwargs=kwargs): @@ -156,7 +156,7 @@ req.form['vid'] = vid if vtitle: req.form['vtitle'] = req._(vtitle) % kwargs - return None, req.execute(rql, kwargs, cachekey) + return None, req.execute(rql, kwargs) return do_build_rset def update_form(**kwargs):