Python Pulumi: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 7: Line 7:
The SDK is available as a [[pip]] package.
The SDK is available as a [[pip]] package.
=Python Pulumi and Virtual Environments=
=Python Pulumi and Virtual Environments=
A new Python project created with <code>[[Pulumi_Operations#New_Project|pulumi new]]</code> will have a [[Python_Language#Environment|virtual environment]] created in a <code>venv</code> directory with required dependencies from <code>[[pip#requirements.txt|requirements.txt]]</code> installed in it.
A new Python project created with <code>[[Pulumi_Operations#New_Project|pulumi new]]</code> will have a [[Python_Language#Environment|virtual environment]] created in a <code>venv</code> directory with required dependencies from <code>[[pip#requirements.txt|requirements.txt]]</code> installed in it. This behavior is controlled by the <code> virtualenv</code> runtime option in Pulumi.yaml:
<syntaxhighlight lang='yaml'>
runtime:
  name: python
  options:
    virtualenv: venv
</syntaxhighlight>

Revision as of 04:23, 11 January 2022

External

Internal

Pulumi Python SDK

https://www.pulumi.com/docs/reference/pkg/python/pulumi/

The SDK is available as a pip package.

Python Pulumi and Virtual Environments

A new Python project created with pulumi new will have a virtual environment created in a venv directory with required dependencies from requirements.txt installed in it. This behavior is controlled by the virtualenv runtime option in Pulumi.yaml:

runtime:
  name: python
  options:
    virtualenv: venv