Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
102 lines (84 sloc) 4.27 KB
Feature name Start date Pull request Authors Contributors


Remove Python 2 (Legacy Python) support from scikit-bio in favor of Python 3 support only.


We propose removing Python 2 (Legacy Python) support from scikit-bio for the following reasons:

  1. The scientific Python community is in favor of dropping support for Python 2 as soon as possible (e.g., see recent discussion at DS4DS). Dropping Python 2 support in scikit-bio will force Python 2 and Python 2/3 packages depending on scikit-bio to also drop Python 2 support if they continue depending on scikit-bio, encouraging adoption of this critical change.
  2. Dropping Python 2 support will reduce development and maintenance burden on scikit-bio developers. For example, we can remove the hacks in necessary for Python 2 compatibility. These hacks were particularly time-consuming to put in place in order to support Python 2 and 3. For example, this hack was non-trivial and required reading CPython's source code.
  3. Supporting Python 3 only will allow us to start using new features of the language, ultimately making scikit-bio a better package. Python 3 contains new and useful features which are not backported to Python 2, including function annotations, type-hinting, the matrix multiplication operator, and asynchronous programming support.
  4. Given that scikit-bio is still in beta and has relatively few users (e.g., compared to a package like numpy), making this switch now would be better than waiting and could set a precedent for other scientific Python packages. Switching sooner is also less of a developer burden because the codebase is relatively small.

Detailed design


We will drop Python 2 support in scikit-bio 0.5.0 (milestone). We will have at least one more release in the 0.4.x series that includes Python 2 and 3 support.


Changes to support Python 3-only include:

  1. Remove Python 2 tests from Travis-CI build matrix.
  2. Remove future and six dependencies from scikit-bio.
  3. Update documentation to indicate Python 3-only, including (but not limited to) and Make it very clear on the scikit-bio front page that scikit-bio only supports Python 3 and link to resources describing why.
  4. Modify doc/source/development/py3.rst to be a guide for helping Python 2 developers become proficient Python 3 developers (e.g., documenting common gotchas or new language features that apply to scikit-bio).
  5. Update PyPI classifiers in to indicate Python 3-only.
  6. Search codebase for references to Python 2 and remove/update accordingly. This includes comments and actual code modifications.
  7. Removes hacks in necessary for Python 2 compatibility.
  8. Test against latest release and nightly build of Python 3 on Travis-CI. Allow failure against nightly Python 3 build.

Note: scikit-bio's doctests are already Python 3-only, so no updates necessary there! :shipit:


Packages/tools supporting Python 2 (including those supporting Python 2 and 3) will not be able to depend on scikit-bio.

Excludes Python 2 user and developer communities.


We could continue supporting Python 2 and 3 but this requires substantial developer effort (see Motivation 2 above). Given our limited developer bandwidth and free (as in 🍺) software model, supporting Python 2 and 3 is not feasible.

Python 3 has been available for 7 years. This transition must happen at some point because Python 3 is here to stay and Python 2 will eventually not be supported by other systems and tools. By not making the switch now (or soonish), we are delaying the inevitable and will affect more users as our userbase increases in size. It would be good form to make this change now while we are still in beta.

Unresolved questions