Skip to content

Drop support for Python 2.7 #1818

@ghost

Description

Python will drop support for 2.7 in January 1st, 2020, I think DVC should too, it will ease the maintenance (spending less time dealing with str/unicode issues, default support for type checking syntax, access to a more robust standard library, etc.).

Countdown for Python 2.7 EOL: https://pythonclock.org/

I don't know how many users are currently running on Python 2.7, but we can get a clue by analyzing pypi stats with BigQuery or using pypinfo.

There are some maintenance tasks to migrate to a Python 3.x only codebase:

  • Remove 2.7 and 3.4 from our conda package
  • Remove Python 2.7 from TravisCI (EDIT(30 Dec) removed from travis.yaml already, but need to cleanup scripts/ci/* from py2 code)
  • Upgrade AppVeyor's Python version
  • Modify python_requires and explicit version classifiers (kudos to @hugovk !)
  • Update the package
  • Remove all calls/dependencies to future
  • Remove all code linked to utils.compat
  • Refactor code with comments about python 2 backwards compatibility
  • Update super() to new syntax
  • Refactor DvcExceptions to use default traceback instead of custom one
    • Refactor logger.py. Remove logging formatter parse_exc logic and use formatException and formatStack instead
  • Refactor system.py module to use the default os methods for linking, as they include Windows support
  • Make keyword params kwonly in dvc.api. Consider the same in other places. (api: use only kwargs #3108)

Feel free to edit this comment, modifying the list of tasks that should happen to make a clean transition.

NOTE: This issue was created to keep track of what should be done. I'm not implying that this will happen in a near future, neither expressing the ideas of the rest of the maintainers.
It would be great if you can write down your opinion so we reach a consensus between the maintainers and the community.

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactoringFactoring and re-factoring

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions