2

I have developed a Django (v1.7) app on Python 3.4.1. I wish to deploy the script with Fabric.

But as I have read on the official documentation and another StackOverflow question, Fabric is only python 2.5-2.7 compatible for the moment.

I know that this means that even though Fabric can only be run with a Python 2.5-2.7 interpreter, it can still execute all the commands (e.g. I can tell a Python 2 script to make and compile a Python 3 interpreter). But here's what's bothering me.

What will happen when the deploy script will have to create a python 3 virtual environment and try to execute Python 3 commands inside it ? Will it fail ? Or will Fabric consider the commands as any other shell command and launch a Python 3 interpreter to execute the Python 3 commands ?

Am I over-complicating this ?

Community
  • 1
  • 1
achedeuzot
  • 4,164
  • 4
  • 41
  • 56

1 Answers1

1

You only need Python 2 to run fabric; it can execute any script on the remote host; including those having nothing to do with Python at all. At its heart, fabric is just a ssh automator.

So you can write a fabfile that executes commands on the remote (target) using Python3, as long as the source (host) can run fabric correctly.

Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284