Edgewall Software

Opened 6 years ago

Closed 4 years ago

Last modified 5 months ago

#11901 closed task (fixed)

Remove deprecated code (Trac 1.3.1) — at Version 46

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.3.1
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Removed deprecated functions, classes, attributes and methods.

API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

This ticket lists code that is scheduled for removal in Trac 1.3.1.

  • Removal of ipnr attribute in attachment and wiki modules: #9612.
  • Remove deprecated methods in trac.wiki.formatter: #11539.
  • Remove deprecated notification code (comment:21:ticket:3517).
  • Remove svn_fs.py and svn_prop.py (modules moved in #10712).
  • Remove since strings from code comments and option documentation for features added in Trac < 1.0 (as in [13889])

Other changes:

Building the list will be easier to do as we develop, and the changes can then be removed at the start of the milestone.

TracDev/ApiChanges/1.3 should be updated with the API changes before this ticket is closed.

Change History (47)

comment:1 by Peter Suter, 6 years ago

  • Notify, NotifyEmail, TicketNotifyEmail and BatchTicketNotifyEmail ([13578])
  • get_ticket_notification_recipients ([13609])

comment:2 by Ryan J Ollos, 6 years ago

I was going to make a list of code to remove in this ticket, but it seemed easier to just prepare a branch. I'll periodically rebase the branch against the trunk and commit the changes at the start of milestone:1.3.1. The first revision of the changes will be posted here after #11913 is committed at the start of milestone:1.0.4.

comment:3 by Ryan J Ollos, 6 years ago

Description: modified (diff)

in reply to:  2 comment:4 by Ryan J Ollos, 6 years ago

Replying to rjollos:

I was going to make a list of code to remove in this ticket, but it seemed easier to just prepare a branch.

Some changes have been staged in log:rjollos.git:t11901-remove-deprecated-code-in-1.3.1. I haven't removed all of the deprecated code, in particular the notification module code. The upgrade step for removing the ipnr columns from the database also hasn't been written yet (#11872 could help with that).

Last edited 6 years ago by Ryan J Ollos (previous) (diff)

comment:5 by Ryan J Ollos, 6 years ago

Description: modified (diff)

comment:6 by Ryan J Ollos, 6 years ago

Compatibility code can be removed in 1.3.1 if Python 2.6 support is dropped: [ba3d34ac/rjollos.git].

comment:7 by Ryan J Ollos, 6 years ago

comment:8 by Ryan J Ollos, 5 years ago

Description: modified (diff)

comment:9 by Ryan J Ollos, 5 years ago

Description: modified (diff)

comment:10 by Ryan J Ollos, 5 years ago

Description: modified (diff)
Milestone: next-major-releases1.3.1
Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:11 by Ryan J Ollos, 5 years ago

Description: modified (diff)

comment:12 by Ryan J Ollos, 5 years ago

Description: modified (diff)

comment:13 by Jun Omae, 5 years ago

unit tests failing.

...
  File "./trac/test.py", line 391, in suite
    import tracopt.versioncontrol.svn.tests
  File "/run/shm/6d672f85ac8080ca247cc91cfb140c339863b711/py27-sqlite/tracopt/versioncontrol/svn/tests/__init__.py", line 16, in <module>
    from tracopt.versioncontrol.svn.tests import svn_fs
  File "/run/shm/6d672f85ac8080ca247cc91cfb140c339863b711/py27-sqlite/tracopt/versioncontrol/svn/tests/svn_fs.py", line 42, in <module>
    from trac.versioncontrol import svn_fs, svn_prop
ImportError: cannot import name svn_fs
make: *** [unit-test] Error 1

The svn_fs and svn_prop in trac.versioncontrol is still used from tracopt/versioncontrol/svn/tests/svn_fs.py.

$ git grep -w 'import.*svn_\(fs\|prop\)'
tracopt/versioncontrol/svn/tests/__init__.py:from tracopt.versioncontrol.svn.tests import svn_fs
tracopt/versioncontrol/svn/tests/svn_fs.py:from trac.versioncontrol import svn_fs, svn_prop

in reply to:  13 ; comment:14 by Jun Omae, 5 years ago

Replying to jomae:

The svn_fs and svn_prop in trac.versioncontrol is still used from tracopt/versioncontrol/svn/tests/svn_fs.py.

Ouch. That code is introduced in [12995] by me. I'm wrong. After 1.0.6 release, I'll fix it on 1.0-stable and trunk.

comment:15 by Ryan J Ollos, 5 years ago

in reply to:  14 comment:16 by Jun Omae, 5 years ago

Replying to jomae:

Replying to jomae:

The svn_fs and svn_prop in trac.versioncontrol is still used from tracopt/versioncontrol/svn/tests/svn_fs.py.

Ouch. That code is introduced in [12995] by me. I'm wrong. After 1.0.6 release, I'll fix it on 1.0-stable and trunk.

Fixed in [14101] and merged to trunk in [14102].

comment:17 by Ryan J Ollos, 5 years ago

Should we remove the deprecated cnum (#7145) from Ticket.save_changes in 1.3.1?: tags/trac-1.1.5/trac/ticket/model.py@:313-314#L306.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:18 by Jun Omae, 5 years ago

I agree to removing cnum from Ticket.save_changes() in 1.3.1.

comment:19 by Ryan J Ollos, 5 years ago

comment:20 by Ryan J Ollos, 5 years ago

show_email_addresses was deprecated from the chrome data dictionary in #11474 / [14151#file2] and will be removed in the next set of proposed changes.

comment:21 by Ryan J Ollos, 5 years ago

[3751] may have some compatibility code to be removed, which we might even be able to do on the currently trunk. We'd have to replace HTTPInternalError with HTTPInternalServerError in the half-dozen or so instances that it appears in the Trac codebase. TracDev/Exceptions should be updated if the change is made.

comment:22 by Ryan J Ollos, 5 years ago

#12132 closed as a duplicate.

Latest changes in log:rjollos.git:t11901-remove-deprecated-code-in-1.3.1.7, incorporating changes from #12132 and comment:21.

comment:23 by Ryan J Ollos, 5 years ago

Description: modified (diff)

comment:24 by Ryan J Ollos, 5 years ago

It appears the following built-ins don't need to be passed in the data dictionary any longer: tags/trac-1.1.6/trac/web/chrome.py@:597-598,622,625#L594.

I've also considered that it would be generally useful to pass functools, itertools and operator in the chrome data dictionary. Previously we've discussed passing presentation (comment:15:ticket:8989).

comment:25 by Ryan J Ollos, 5 years ago

Description: modified (diff)

comment:26 by Ryan J Ollos, 5 years ago

Description: modified (diff)

comment:27 by Ryan J Ollos, 5 years ago

Changes rebase and deprecated notification classes removed in log:rjollos.git:t11901-remove-deprecated-code-in-1.3.1.8.

comment:28 by Ryan J Ollos, 5 years ago

comment:29 by Ryan J Ollos, 5 years ago

DONE Consider bumping Pygments minimum version to at least 1.0 and remove regression test added in #7705.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:30 by Ryan J Ollos, 5 years ago

DONE Rebase staged changes after changes in #12206 are committed to the trunk. TicketNotifyEmail.obfuscate_email will be removed.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:31 by Ryan J Ollos, 5 years ago

[1a9ad113/rjollos.git] attempts a minor simplification of Ticket.save_changes. Is there any reason to wait until the end of the method to update self.values['changetime']? I've considered that an exception might be raised in the method, but haven't come up with a scenario in which the change would cause a problem.

comment:32 by Ryan J Ollos, 5 years ago

[de431734/rjollos.git] replaces property() calls with the more readable @property decorator.

Latest changes in log:rjollos.git:t11901-remove-deprecated-code-in-1.3.1.11.

comment:33 by Ryan J Ollos, 5 years ago

Description: modified (diff)

comment:34 by Ryan J Ollos, 5 years ago

Expanding on the changes in #11565 and #11587, I propose in [327fadb1/rjollos.git] to remove the deprecated systeminfo attribute, deprecate ISystemInfoProvider and add a lazily-evaluated system_info property.

This would finally cleanup the Environment class by:

  • Eliminating get_systeminfo which has a name too similar to get_system_info.
  • Forcing plugins to implement the ISystemInfoProvider interface rather than appending to systeminfo.

Rebased changes in log:rjollos.git:t11901-remove-deprecated-code-in-1.3.1.12.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:35 by Ryan J Ollos, 5 years ago

Rebased changes in log:rjollos.git:t11901-remove-deprecated-code-in-1.3.1.13. Environment.get_repository has been removed.

comment:36 by Ryan J Ollos, 5 years ago

Since [4559], the version info is retrieved from an attribute if Pygments is installed from source, or more specifically if the version can't be retrieved from package info: tags/trac-1.0.9/trac/mimeview/pygments.py@:89-91#L85.

I'm not entirely sure what installed from source means, but I assume it means installed in dev mode.

It looks like we can remove the complexity. I've evaluated with Pygments 2.1dev (which is post-2.1, so it appears the version hasn't been bumped after the 2.1 release) and 1.0 (minimum Pygments version bumped to 1.0 in comment:29).

Pygments installed in dev mode from tip of Hg repository:

>>> import pygments
>>> from trac.util import get_pkginfo
>>> pkginfo = get_pkginfo(pygments)
>>> pkginfo['version']
'2.1.dev20160119'
>>> pygments.__version__
'2.1'

Pygments 1.0 installed in dev mode.

>>> import pygments
>>> from trac.util import get_pkginfo
>>> pkginfo = get_pkginfo(pygments)
>>> pkginfo['version']
'1.0'
>>> pygments.__version__
'1.0'
Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:38 by Christian Boos, 5 years ago

Changes look good, I'll probably take a second, more detailed look when 1.3.x starts, but so far I like what I've seen.

comment:40 by Ryan J Ollos, 4 years ago

In Python 2.7 and later, ZipFile can be used as a context manager. Proposed changes in [221c8b5d7/rjollos.git].

comment:41 by Ryan J Ollos, 4 years ago

Owner: set to Ryan J Ollos
Status: newassigned

First set of changes committed in [14880:14895].

Latest proposed changes in log:rjollos.git:t11901-remove-deprecated-code-in-1.3.1.17. I'll work on adding the database upgrade for [e15f0f3d/rjollos.git].

comment:42 by Jun Omae, 4 years ago

In [14879], 2.6 with trunk has been removed from matrix build on trunk/.travis.yml. We should remove Python26 and Python26-x64 with trunk from matrix build of trunk/.appveyor.yml as well as .travis.yml.

by Jun Omae, 4 years ago

Attachment: 94f40c9a9-py27-sqlite.log added

comment:43 by Jun Omae, 4 years ago

Functional tests with [94f40c9a9/rjollos.git] failed. See 94f40c9a9-py27-sqlite.log.

FAILED (failures=15)

comment:44 by Ryan J Ollos, 4 years ago

.appveyor.yml modified in r14896, but cleanup of trunk/contrib/appveyor.ps1 is still needed. Also, .appveyor.yml probably needs to be modified on branches/1.2-stable (comment:35:ticket:12120).

comment:45 by Ryan J Ollos, 4 years ago

Additional changes in [14903:14923,14925:14926].

comment:46 by Ryan J Ollos, 4 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Additional changes in [14930:14941]. I'm discarding [94f40c9a9/rjollos.git] and [e15f0f3d/rjollos.git] will be committed in #9612.

Note: See TracTickets for help on using tickets.