Home » Support » Index of All Documentation » Wing IDE Reference Manual » Project Manager »

Each project has a set of top-level properties that can be accessed and edited via the Properties item in the Project menu. These can be used to configure the Python environment used when debugging, executing, or testing code, and for the source code analysis engine, which drives Wing's auto completion, source index, and other capabilities. Project properties are also provided to set options for the project and to enable and configure extensions for revision control, Zope, and other tools.

Any string value for a property may contain environment and special variable references, as described in Environment Variable Expansion.

Environment

To get the most out of Wing, it is important to set these values in the Environment tab correctly for your project:

Python Executable -- When the Custom radio button is checked and the entered field is non-blank, this can be used to set the full path to the Python executable that should be used when debugging source code in this project. When Use default is selected, Wing tries to use the default Python obtained by typing python on the command line. On OS X, Wing prefers the latest Apple-provided Python. If this fails, Wing will search for Python in /usr/local and /usr (on Linux and OS X) or in the registry (on Windows). To use Wing with virtualenv just set this property to the Python executable provided by virtualenv. An easy way to get the full path to use here is to type the following in the Python that you wish to use: import sys; print(sys.executable). This can also be typed into the IDLE that is associated with the Python installation.

Python Path -- The PYTHONPATH is used by Python to locate modules that are imported at runtime with the import statement. When the Use default checkbox in this area is checked, the inherited PYTHONPATH environment variable is used for debug sessions. Otherwise, when Custom is selected, the specified PYTHONPATH is used.

Environment -- This is used to specify values that should be added, modified, or removed from the environment that is inherited by debug processes started from Wing IDE and is used to expand environment variable references used in other properties. Each entry is in var=value form and must be specified one per line in the provided entry area. An entry in the form var= (without a value) will remove the given variable so it is undefined. Note that you are operating on the environment inherited by the IDE when it started and not modifying an empty environment. When the Use inherited environment choice is set, any entered values are ignored and the inherited environment is used without changes.

Debug

The following properties are defined in the Debug tab:

Main Entry Point -- This defines where execution starts when the debugger is launched from the IDE. The default is to start debugging in the current editor file. Alternatively, use this property to define a project-wide main entry point so that debug always started in that file regardless of which file is current in the editor. The entry point can either be a selected file in order to debug that files with the environment specified in its File Properties, or a named entry point to select a file and use a different environment to debug it.

Initial Directory -- When the Use default radio button is checked, the initial working directory set for each debug session will be the directory where the debugged file is located. When Custom is selected, the specified directory is used instead (use $(WING:PROJECT_DIR) for the project's directory). This property also sets the initial directory for the Python Shell, determines how Wing resolves partial paths on the Python Path for the purposes of static analysis, and is used for other features in the IDE that require a starting directory for a sub-process. For these, Wing will use the directory of the main debug file in the project as the default initial directory, or the directory of the project file if there is no main debug file defined.

Build Command -- This command will be executed before starting debug on any source in this project. This is useful to make sure that C/C++ extension modules are built, for example in conjunction with an external Makefile or distutils script, before execution is started. The build is configured through and takes place in the OS Commands tool.

Python Options -- This is used to select the command line options sent to the Python interpreter while debugging. The default of -u sets Python into unbuffered I/O mode, which ensures that the debug process output, including prompts shown for keyboard input, will appear in a timely fashion.

Debug Server Port -- This can be used to alter the TCP/IP port on which the debugger listens, on a per-project basis. In this way, multiple instances of Wing using different projects can concurrently accept externally initiated debug connections. See Advanced Debugging Topics for details.

Automatic Perspectives -- When enabled, Wing will create and automatically switch between Edit and Debug perspectives when debugging is stopped and started. See Perspectives for details.

Options

These project options are provided:

Project Type -- This can be used to select whether or not the project will be shared among several developers. When shared, the project will be written to two files, one of which can be shared with other developers. See Project Types for details.

Default Encoding sets the default text encoding to use for files when the encoding cannot be determined from the contents of the file. This applies to all files opened when the project is open, whether or not they are part of the project. By default, this falls back to the value set by the Default Encoding preference.

Project Home Directory sets the base directory for the project. This overrides the project file location as the directory on which to base relative paths shown in the Project view and elsewhere. It is also used as the directory in which the Python Shell subprocess is launched and for the starting directory when the Default Directory Policy preference is set to Current Project.

Preferred Line Ending and Line Ending Policy control whether or not the project prefers a particular line ending style (line feed, carriage return, or carriage return + line feed), and how to enforce that style, if at all. By default, projects do not enforce a line ending style but rather insert new lines to match any existing line endings in the file.

Preferred Indent Style and Indent Style Policy control whether or not the project prefers a particular type of indentation style for files (spaces only, tabs only, or mixed tabs and spaces), and how to enforce that style, if at all. By default, projects do not enforce an indent style but rather insert new lines to match any existing indentation in the file.

Strip Trailing Whitespace controls whether or not to automatically remove whitespace at the ends of lines when saving a file to disk.

Extensions

The Extensions tab of Project Properties is used to control add-ons on a per-project basis:

Enable Django Template Debugging enables Django-specific functionality that makes it possible for Wing's debugger to stop at breakpoints and step through Django template files.

Matplotlib Event Loop Support enabled Matplotlib-specific functionality that updates plots continuously when working interactively in the Python Shell.

Enable Zope2/Plone Support, Zope2 Instance Home, and Zope2 Host enable legacy support for older Zope installations. They are needed because Zope 2.x implements import magic that works differently from Python's default import and thus adding the instance home directory to PYTHONPATH is not sufficient. Wing's source analyzer needs this extra clue to properly find and process the Zope instance-specific sources.

When this option is activated, Wing will also offer to add the relevant Zope2/Plone files to the project, and to install the control panel for configuring and initiating debug in Zope2/Plone. See the Zope How-To for details.

Testing

Test File Pattern can be used to specify which files in the project should be shown in the Testing tool. See the Testing chapter for details.

Default Test Framework defines the testing framework to use by default, unless another is chosen using File Properties on the test file.

Environment can be used to select environment for running unit tests that differs from the Project-wide settings, and for setting any command line arguments to send to unit tests.

« 3.5. Sharing ProjectsTable of Contents3.6.0. Environment Variable Expansion »

Section Contents

3.6.0. Environment Variable Expansion

Project-wide Properties