Introduction¶
VSGenPTVS is a plugin to the VSGen that generates Python Tools for Visual Studio projects.
Install¶
The package is designed to work with pip.
To install the package:
pip install vsgenptvs
To uninstall the package:
pip uninstall vsgenptvs
To upgrade the package:
pip install --upgrade vsgenptvs
Starting with Python 2.7.9, pip is included by default with the Python binary installers.
Quick Start¶
VSGenPTVS adds the ptvs
type to VSGen’s auto
command:
vsgen auto ptvs <type options>
For example, to create a PTVS solution and project pointing at path S:\project
named demo
:
vsgen auto ptvs --root S:\project --name demo
Usage¶
There are two ways to use vsgenptvs:
- Creating objects explicitly using Python code and the vsgen base application.
- Defining vsgenptvs objects using one or more configuration file and processing it with VSGen on the command line.
Execution¶
VSGenPTVS extends the VSGen command line but also creates an entry point for itself.
You can run it as a module:
$ python -m vsgenptvs ...
which is equivalent to:
$ python -m vsgen auto ptvs ...
Or, when installed with setuptools, run the auto generated entry point in Scripts:
$ vsgen-ptvs ...
which is equivalent to:
$ vsgen auto ptvs ...
Command Line Reference¶
VSGenPTVS extends the existing VSGen command line but also provides its own command line handling.
VSGenPTVS Standalone¶
When the vsgenptvs
package is executed it passes the arguments to the command vsgen auto ptvs
and presents the command line of that command as its own:
usage: vsgenptvs [-h] [--root PATH] [--name NAME] [--filename PATH]
[--search_path [PATH [PATH ...]]] [--output_path PATH]
[--working_directory PATH] [--root_namespace NAME]
[--project_home PATH] [--startup_file PATH]
[--compile_in_filter [FILTER [FILTER ...]]]
[--compile_ex_filter [FILTER [FILTER ...]]]
[--content_in_filter [FILTER [FILTER ...]]]
[--content_ex_filter [FILTER [FILTER ...]]]
[--directory_in_filter [FILTER [FILTER ...]]]
[--directory_ex_filter [FILTER [FILTER ...]]]
[--is_windows_application FLAG]
[--environment_variable [PAIR [PAIR ...]]]
[--python_interpreter_args [ARG [ARG ...]]]
Named Arguments¶
--root | the project’s root path |
--name | name of the solution and project |
--filename | absolute path to the project’s filename location |
--search_path | one or more absolute paths to be added to the python search path |
--output_path | absolute path to the project’s output directory |
--working_directory | |
absolute path to the project’s working directory | |
--root_namespace | |
the root namespace of the project | |
--project_home | absolute path to the project’s home directory |
--startup_file | absolute path to the project’s startup file |
--compile_in_filter | |
one or more fnmatch expressions to match included compile files | |
--compile_ex_filter | |
one or more fnmatch expressions to match excluded compile files | |
--content_in_filter | |
one or more fnmatch expressions to match included content files | |
--content_ex_filter | |
one or more fnmatch expressions to match excluded content files | |
--directory_in_filter | |
one or more fnmatch expressions to match included directories | |
--directory_ex_filter | |
one or more fnmatch expressions to match excluded directories | |
--is_windows_application | |
switch to use console python.exe or pythonw.exe. | |
--environment_variable | |
additional environment variables and values stored with the project | |
--python_interpreter_args | |
additional python interpreter arguments |
VSGen Command Line Integration¶
When vsgenptvs
is installed, vsgen
’s command line is modified accordingly:
usage: vsgen [-h] {generate,auto} ...
Positional Arguments¶
suite_commands | Possible choices: generate, auto Available commands. |
Sub-commands:¶
generate¶
Generates solutions and projects based on one or more configuration files.
vsgen generate [-h] file [file ...]
file | The configuration file that contains the [vsgen.*] sections contains the vsgen input. |
auto¶
Automatically generates a solution and project collection from vsgen preset and a single directory.
vsgen auto [-h] {ptvs} ...
suite_type | Possible choices: ptvs Available Project Types. |
Automatically generates a solution and “ptvs” project from a single directory.
vsgen auto ptvs [-h] [--root PATH] [--name NAME] [--filename PATH]
[--search_path [PATH [PATH ...]]] [--output_path PATH]
[--working_directory PATH] [--root_namespace NAME]
[--project_home PATH] [--startup_file PATH]
[--compile_in_filter [FILTER [FILTER ...]]]
[--compile_ex_filter [FILTER [FILTER ...]]]
[--content_in_filter [FILTER [FILTER ...]]]
[--content_ex_filter [FILTER [FILTER ...]]]
[--directory_in_filter [FILTER [FILTER ...]]]
[--directory_ex_filter [FILTER [FILTER ...]]]
[--is_windows_application FLAG]
[--environment_variable [PAIR [PAIR ...]]]
[--python_interpreter_args [ARG [ARG ...]]]
--root | the project’s root path |
--name | name of the solution and project |
--filename | absolute path to the project’s filename location |
--search_path | one or more absolute paths to be added to the python search path |
--output_path | absolute path to the project’s output directory |
--working_directory | |
absolute path to the project’s working directory | |
--root_namespace | |
the root namespace of the project | |
--project_home | absolute path to the project’s home directory |
--startup_file | absolute path to the project’s startup file |
--compile_in_filter | |
one or more fnmatch expressions to match included compile files | |
--compile_ex_filter | |
one or more fnmatch expressions to match excluded compile files | |
--content_in_filter | |
one or more fnmatch expressions to match included content files | |
--content_ex_filter | |
one or more fnmatch expressions to match excluded content files | |
--directory_in_filter | |
one or more fnmatch expressions to match included directories | |
--directory_ex_filter | |
one or more fnmatch expressions to match excluded directories | |
--is_windows_application | |
switch to use console python.exe or pythonw.exe. | |
--environment_variable | |
additional environment variables and values stored with the project | |
--python_interpreter_args | |
additional python interpreter arguments |
Getting help¶
Check out the FAQ or submit a bug report to the Github issue tracker.