Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python 3 support for fabric

Does fabric (http://docs.fabfile.org/en/1.7/) support Python 3 yet. As per Python 3 Wall of Superpowers it does not yet. If not what is the best alternative if using Django 1.5 with Python 3.

like image 639
jethar Avatar asked Sep 11 '13 08:09

jethar


People also ask

Does fabric work with Python3?

Fabric3 is a fork of Fabric to provide compatability with Python 3.4+. The port still works with Python 2.7.

How do you run a fabric in Python?

x) The most common ways of installing Fabric is via, pip, easy_install or via the operating system's package manager: pip install fabric sudo easy_install fabric sudo apt-get install fabric # (the package is typically called fabric or python-fabric.)

What is fabric in coding?

The Fabric programming language is an extension of the Jif programming language [5], which is in turn a version of Java extended with security labels that govern the confidentiality and integrity of information used in the program, and ensure that information flows in the programs respect those security policies.


2 Answers

Current advice

It seems there is already official support for Python 3.4+ in Fabric v2+ and I guess it should be preferred although there may be some incompatible changes. So in an ideal world, nobody should have this problem anymore :)

pip3 install -U "fabric>2.0" 

Maintained old API in Python 3

Because some people were happy with the old API of the Fabric, there is a maintained fork supporting Python 3 called fab-classic. See also discussion in the Github issue Recreating the Fabric 1 API in Fabric 2?


The previous advice

There is Python3 port of Fabric named Fabric3 which supports Python 2.7 and 3.4+ (dropped support for Python <2.7). I use it some time as a replacement and it works for me without any issues.

pip3 install fabric3 
like image 171
Mišo Avatar answered Sep 20 '22 13:09

Mišo


Current Answer which has already been done by @miso.belica

pip install -U "fabric>2.0.0" 

OLD Answer (as of 2013)

From the docs:

Please note that all documentation is currently written with Python 2.5 users in mind, but with an eye for eventual Python 3.x compatibility

Or to be more specific:

eventual Python 3.x compatibility

It looks like Python3 support for fabric is a little sticky and depends upon another open source library, paramiko being compatible with python3. As of now, the master version supports python 3.

It might be worth messing around with and then building your fabric instance on top of that instead of getting it from pip.

like image 23
Greg Avatar answered Sep 24 '22 13:09

Greg