Code Monkey home page Code Monkey logo

caniusepython3's Introduction

Can I Use Python 3?

This script takes in a set of dependencies and then figures out which of them are holding you up from porting to Python 3.

You can specify your dependencies in multiple ways::

caniusepython3 -r requirements.txt,test-requirement.txt
caniusepython3 -m PKG-INFO
caniusepython3 -p numpy,scipy,ipython
# If your project's setup.py uses setuptools ...
python setup.py caniusepython3

The output of the script will tell you how many (implicit) dependencies you need to transition to Python 3 in order to allow you to make the same transition. It will also list what projects have no explicit dependency blocking their transition so you can ask them consider starting a port to Python 3.

If you prefer a web interface, please use https://caniusepython3.com by Jannis Leidel.

Build Status

How do you tell if a project has been ported to Python 3?

On PyPI each project specifies various trove classifiers. There are various classifiers related to what version of Python a project can run on. E.g.:

Programming Language :: Python :: 3
Programming Language :: Python :: 3.0
Programming Language :: Python :: 3.1
Programming Language :: Python :: 3.2
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4

As long as a trove classifier for some version of Python 3 is specified then the project is considered to support Python 3 (project owners: it is preferred you at least specify Programming Language :: Python :: 3 as that is how you end up listed on the Python3 Packages list on PyPI).

The other way is through a manual override in caniusepython3 itself. This project maintains a hard-coded list of projects which are considered ported because:

  • They are now part of Python's standard library in some release of Python 3
  • Their Python 3 port is under a different name
  • They are missing a Python 3 trove classifier but have actually been ported

If any of these various requirements are met, then a project is considered to support Python 3.

How can I get a project ported to Python 3?

Typically projects which have not switched to Python 3 yet are waiting for:

  • A dependency to be ported to Python 3
  • Someone to volunteer to put in the time and effort to do the port

Since caniusepython3 will tell you what dependencies are blocking a project that you depend on from being ported, you can try to port a project farther down your dependency graph to help a more direct dependency make the transition.

Which brings up the second point: volunteering to do a port. Most projects happily accept help, they just have not done the port yet because they have not had the time. Some projects are simply waiting for people to ask for it, so even speaking up politely and requesting a port can get the process started.

If you are looking for help to port a project, you can always search online for various sources of help. If you want a specific starting point there are HOWTOs in the Python documentation on porting pure Python modules and extension modules.

Secret bonus feature

If you would like to use a different name for the either the script or setuptools command, then change the command_name line in setup.py. Reddit suggests icanhazpython3.

caniusepython3's People

Contributors

b-jazz avatar brettcannon avatar cyrilroelandtenovance avatar jeffpaine avatar jezdez avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.