Wing Tips: Remote Development with Wing Pro

May 23, 2019


In this issue of Wing Tips we take a quick look at Wing Pro's remote development capabilities.

Setting up SSH Access

Wing Pro's remote development support requires using an SSH public/private key pair and SSH agent rather than entering a password each time you connect. This is more secure and convenient, and it allows Wing to seamlessly re-establish the remote connection as needed over time. If you currently enter a password (other than a 2-factor authentication card selector) each time you ssh to the remote host, then please see SSH Setup Details for instructions.

Creating a Remote Project

To create a Wing Pro project that works with a remote host, select New Project from the Project menu and use Connect to Remote Host via SSH as the project type. You will need to choose an Identifier` that Wing uses to refer to the host, and enter the Host Name either as an IP address or name (optionally in username@hostname form).

If python is not on the PATH on your remote host, or is not the Python you want to use, then you will also need to paste the full path to Python into the Python Executable field. This is typically the value printed by import sys; print(sys.executable) in the Python that you want to use.

You will only rarely need to specify any of the other values in a remote host configuration. For now, leave them set to their default values. For example:

/images/blog/remote-dev-2/new-project.png

Once you submit this dialog, Wing will probe the remote host and install the remote agent. When this is complete, you should see a dialog with some information about the remote host:

/images/blog/remote-dev-2/install-succeeded.png

You can now point Wing to your remotely stored source code with Add Existing Directory in the Project menu. When this is complete, save the project to local disk with Save Project in the Project menu.

That's all there is to it!

At this point all of Wing's features should work with files on the remote host, including editing, debugging, unit testing, working in the Python Shell (after restarting from its Options menu), using version control, searching, code navigation, running processes from the OS Commands tool, and so forth.

How it Works

Using New Project takes care of a few steps that can also be done manually, in the event that a project or remote host connection needs to be reconfigured:

(1) Your remote host configuration can be viewed and edited from Remote Hosts in the Project menu. From here, remote host configurations can also be marked as shared, so they can be reused by multiple projects or used to open projects that are stored on the remote host.

(2) Pointing a project at a remote host is done by changing the Python Executable under the Environment tab in Project Properties to Remote and selecting the remote host configuration. The remote host configuration determines which Python is used on the remote host.

Further Reading

If your code runs in a web server or other framework on the remote host, you will need to initiate debug using Wing's wingdbstub.py module as described in the section Initiating Debug in Remote Web Development, or check out the How-Tos for details on using Wing Pro with specific frameworks and tools.

For detailed documentation on Wing Pro's remote development capabilities see Remote Development in the product manual.

Getting Help

As always, don't hesitate to email support@wingware.com or post on the Q&A Forum for help!



That's it for now! We'll be back next week with more Wing Tips for Wing Python IDE.



Share this article: