Skip to main content

Rez launching environment manager

Project description

rezup

Python package Version

Rez launching environment manager

What is this ?

A cross-platform Rez production virtual environment management tool, which allows safe environment update without any interruption. Plus a convenient virtual environment setup interface.

Install

This installs the rezup full package.

$ pip install rezup

To upgrade, you only need to upgrade the API part. So to avoid re-creating console-script.

$ pip install -U rezup-api

Quick start

By typing rezup in terminal, a container named .main will be created under ~/.rezup by default (the root location can be changed by setting env var REZUP_ROOT_LOCAL). Once that done, a vanilla Rez environment is presented by a subprocess and simply typing exit to escape.

Commands

The command line interface is generated by fire. Please run following commands to see helps.

$ rezup --help
$ rezup -

How it works ?

Container

A container is a Rez environment. And each container holds at least one virtual environment folder named by timestamp, which is revision. With that convention, the latest version of environment can be provided without affecting existing user.

# Container/Revision structure

\.rezup
   |
   + - {container}
   |     |
   :     + - {revision}  # venv and bin tools lives here
   :     |
         + - {revision}  # the folder is named as timestamp, e.g. 1619780350.588625
         |
         + - {revision}  # latest one will be provided when calling `rezup use {container}` in terminal

For centralize management in production, one remote container can be defined with env var REZUP_ROOT_REMOTE. The remote container only contains the venv installation manifest file rezup.toml, and when being asked, a venv revision will be created locally or re-used if same revision exists in local.

Recipe

To customize the container, you can write a ~/rezup.toml to tell what should be installed and what environment variable should have. For example :

description = "My rez setup"

[root]
# Where local container is at, supersede $REZUP_ROOT_LOCAL if set
local = false
# Where remote container is at, supersede $REZUP_ROOT_REMOTE if set
remote = false

# the .env file will be loaded when container revision is being used
[dotenv]
1 = "/to/my.env"    # non platform specific, load firstly, sort by key
2 = "/to/other.env"
[dotenv.linux]
[dotenv.darwin]
[dotenv.windows]
a = "/to/win.env"   # platform specific, load secondly, sort by key

[env]
# these will be loaded when container revision is being used
REZ_CONFIG_FILE = "/path/to/rezconfig.py"
MY_CUSTOMS_ENV = "my value"

[rez]
name = "rez"
url = "rez>=2.83"   # a PyPi version specifier or repository path

[[extension]]
name = "foo"
url = "~/dev/foo"
edit = true         # install this in edit mode (pip --edit)

[[extension]]
name = "bar"
url = "git+git://github.com/get-bar/bar"
isolation = true    # additional venv will be created just for this package
python = 2.7        # the python version for the venv of this package

[shared]
# Packages that will be shared across all revisions in this container,
# except extension that has `isolated` set to true.
name = "production"
requires = [
    "toml",
    "pyside2",
    "Qt5.py",
]

Recipe file name should embed container name (if not default container) so that command rezup add <container> could pick it up when creating corresponding container, for example:

  • ~/rezup.toml for container .main, the default
  • ~/rezup.dev.toml for container dev
  • ~/rezup.test.toml for container test
  • ~/rezup.{name}.toml for container {name}

Environment Variables

Name Description
REZUP_ROOT_LOCAL Local root of all containers and metadata, default is ~/.rezup
REZUP_ROOT_REMOTE Remote root of all containers but only recipe file
REZUP_DEFAULT_SHELL Specify shell to use. See launch/README.
REZUP_PROMPT For customizing shell prompt, optional. See launch/README.
REZUP_CONTAINER Auto set, for customizing shell prompt. See launch/README.
REZUP_TEST_KEEP_TMP Preserve temp dirs in tests.

Shell

Please read launch/README.

Util

from rezup import util

# returns rez lib location from container
util.locate_rez_lib()

# resolve package requests with Rez from container
util.resolve_environ(["pkg_a", "pkg_b"])

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

rezup-api-2.0.1.tar.gz (59.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rezup_api-2.0.1-py2.py3-none-any.whl (50.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file rezup-api-2.0.1.tar.gz.

File metadata

  • Download URL: rezup-api-2.0.1.tar.gz
  • Upload date:
  • Size: 59.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for rezup-api-2.0.1.tar.gz
Algorithm Hash digest
SHA256 b78072e245db67e99e1c800c03b77356bb1a8b1429706a7cffb1f48506400c87
MD5 21e60d6f67b21e1f1824b32d6c430281
BLAKE2b-256 1e87cb149ee17f40334be53c41298ccc5f224aa58c9030f32b83314e993d0240

See more details on using hashes here.

File details

Details for the file rezup_api-2.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: rezup_api-2.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 50.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for rezup_api-2.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f68fae0e287be19ab3607ae4e35f147c17f0999b1159d3aeb969378c78de4b3e
MD5 936e6da102f522969b7267e1cd6e9d82
BLAKE2b-256 d54d7895b65057176ab5448433cc5a94c49478fa0d0005e8c35230fd90d2e2d9

See more details on using hashes here.

Supported by

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