Common Python package 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 your targeted service's Docker build context.

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 both services locally without needing to manage Git submodules, and Velocity will include any code changes you make to any such package in your remote service.

Developing in a virtual environment

Velocity's common Python package development feature aligns with the standard Python development flow, which leverages a virtual environment to manage dependencies during development.

Configuring your local interpreter

If you're working in a virtual env, you'll first need to configure your IDE to use the interpreter included in your virtual environment. To do so in PyCharm, click on your current Python interpreter in the lower right hand corner of your IDE.

Then, select "Add New Interpreter," and then "Add l Interpreter," and finally, select your interpreter type from the list provided, and click "OK."

Installing the common package with Pip

Then, you can install the common package in your Velocity service with the following command:

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

This will install the package in your Velocity service in an "editable" mode via symlinks, which will allow you to include your 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, you can refer to the Pip documentation.

Last updated