Common Python package development

The standard Python development flow leverages a virtual environment to manage dependencies during development. If you manage your packages for Python with any flavor of Pip, Velocity can include code changes in your remote environment from multiple local Python packages as you develop them – even if one or more of the packages doesn't exist within the Docker build context for the target service.

This works with the following package managers:

For example, if you are developing a service that includes distinct Python packages that are each stored in their own Git repository, you can develop all relevant services locally without needing to manage Git submodules. Velocity will include any code changes you make to any package that's located in your remote service.

To enable this flow with Velocity:

Configure the local interpreter

When working in a virtual environment, you'll first need to configure your IDE to use the same interpreter that is included in your virtual environment.

For example, from PyCharm:

  1. Click the current Python interpreter from the lower right-hand corner of your IDE.

  2. Go to Add New Interpreter=>Add l Interpreter.

  3. Choose the relevant interpreter type from the list and click OK to save and apply:

Install the common package with Pip

Install the common package in your Velocity service in your Velocity service in an "editable" mode via symlinks with the following command:

pip install -e /local/path/to/your/common/package

This enables you to include the additional Python packages that exist outside of your Docker build context in your continually updated Kubernetes environment.

For additional information on "editable installs" with Pip, see the Pip documentation.

Last updated