Skip to content
This repository was archived by the owner on Nov 17, 2022. It is now read-only.

Drop Python 2.7 support #301

Open
12 tasks done
hayfield opened this issue Mar 19, 2018 · 0 comments
Open
12 tasks done

Drop Python 2.7 support #301

hayfield opened this issue Mar 19, 2018 · 0 comments
Labels
awaiting-deployment The changes are complete, in `dev`, and waiting to be merged to `master` and released. code-features Makes use of more capabilities in Python, or enables features such as iteration on a class. repo-management Changes relating to management of the repository.

Comments

@hayfield
Copy link
Contributor

hayfield commented Mar 19, 2018

pyIATI should drop support for Python 2.7.

2.7 support should be dropped because:

  • The original reasons for supporting it have not been met, or shown to be untrue:
    • Reason: It won't be much of a maintenance burden.
      • Current State: It requires a notable amount of effort to maintain compatibility.
      • Note: This was the main reason support was originally included, the idea being that if the maintenance burden became too high, support would be dropped. The other reasons for support were noted as secondary benefits rather than standalone reasons to support 2.7.
    • Reason: It will allow pyIATI to be seamlessly integrated into old tools.
      • Current State: The tools where it has been integrated have involved major revisions. Where it is yet to be integrated, it is reasonably practicable that the pyIATI functionality could be separated from the legacy parts of the system. The legacy systems could even be updated to work with Python 3.
    • Reason: There will be lots of other people using this to integrate with Python 2.7 code.
      • Current State: There have not been a large number of people doing this. Also, people should be encouraged to transition away from Python 2, not stick with it!
  • It is going EoL at the start of 2020.
  • It restricts the use of beneficial language features introduced with Python 3. This makes the pyIATI codebase:
    • More confusing (2 ways of doing the same thing)
    • Harder to maintain (more lines of code, more conditionals, fewer modern language features)
    • Less specific (unable to use capabilities such as the improved builtin exception hierarchy)
    • More error prone (certain language features and library calls in Python 3 make particular categories of bug less likely)
  • lxml (the underlying XML-handling library used by pyIATI) differs in functionality between Python 2 and Python 3.
  • The longer support is maintained, the more legacy code there will be that needs migrating away. It's a change that will need to happen eventually, so the sooner the better.

  • Remove from Travis
  • Remove from setup.py
  • Remove from other places it's mentioned
  • Replace instances where six is used with the Python 3 equivalent
  • Replace instances where future is used with the Python 3 equivalent
  • Do a global search for the following terms and remove / update code as appropriate to remove custom workarounds for 2.7:
    • compatibility
    • python2/3
    • python2
    • python 2
    • sys.version
    • Skim through all the code to see if there are any other keywords to look for, or compatibility lines that have no notes against them
@hayfield hayfield added code-features Makes use of more capabilities in Python, or enables features such as iteration on a class. repo-management Changes relating to management of the repository. labels Mar 19, 2018
hayfield added a commit that referenced this issue Mar 22, 2018
The reasons for removal are detailed in #301
The tests no longer pass when run with Python 2.7.

Further work could be undertaken to utilise a greater range of Python 3 features. This commit merely removes attempts to test at 2.7, as well as the shims to enable this.
@hayfield hayfield added the awaiting-deployment The changes are complete, in `dev`, and waiting to be merged to `master` and released. label Mar 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting-deployment The changes are complete, in `dev`, and waiting to be merged to `master` and released. code-features Makes use of more capabilities in Python, or enables features such as iteration on a class. repo-management Changes relating to management of the repository.
Projects
None yet
Development

No branches or pull requests

1 participant