Skip to main content

Stacked environment variable management system.

Reason this release was yanked:

setup is broken

Project description

envstack

Stacked environment variable management system. The lightweight, easy to use "rez" alternative for production pipelines.

Environment variables are declared in namespaced .env files using yaml syntax. The default stack is stack and variables are declared in stack.env files. You can create any new stack by creating new .env files, e.g. creating a new test stack just create test.env files.

Envstack works best combined with siteconf.

Quickstart

To create a new environment stack, create a new namespaced .env file. For example, here is a simple thing.env file (the stack namespace is "thing"):

all: &default
  FOO: bar

To see the resolved environment for the thing environment stack, run:

$ envstack thing
FOO 'bar'

Environment stacks are hierarchical, so values for $FOO defined in .env files lower in the filesystem (lower in scope) override those defined higher up (higher in scope):

/show/thing.env
/show/seq/thing.env
/show/seq/shot/thing.env
/show/seq/shot/task/thing.env

Variables can reference other variables defined elsewhere (but cannot be circular):

all: &default
  BAR: $FOO

Variables can be platform specific (and inherit the defaults):

linux:
  <<: *default
  HELLO: world

Environment files can include other namespaced environments:

include: ['other']

Installation

The easiest way to install:

$ pip install envstack

Usage

To see the default resolved environment for any given scope (directory):

$ envstack

To see the resolved environment for a given namespace.

$ envstack <stack> [OPTIONS]

To resolve a $VAR declaration for a given environment stack:

$ envstack <stack> -r <VAR>

To trace where a $VAR declaration is being set:

$ envstack <stack> -t <VAR>

To see an environment stack on another platform:

$ envstack <stack> -p <platform>

Running Commands

To run any command line executable inside of an environment stack, where <command> is the command to run:

$ enstack <stack> -- <command>

For example, running python in the default stack (reading from the default stack.env file):

$ envstack -- python -c "from envstack.env import environ; print(environ['HELLO'])"
world

Same command but using the "thing" stack"

$ envstack thing -- python -c "from envstack.env import environ; print(environ['FOO'])"
bar

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

envstack-0.2.0.tar.gz (14.4 kB view details)

Uploaded Source

File details

Details for the file envstack-0.2.0.tar.gz.

File metadata

  • Download URL: envstack-0.2.0.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for envstack-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fda9815f722ae2da30b2e311270f8088bc5cdb461527a918eafef18fc3ba1bf4
MD5 3585968841b7a7925773be671091cc7a
BLAKE2b-256 e3728b07a65f0bf05b7ab26e9794004b9e1f1ee0ef67a9152f6683d0643f9eb1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page