Registry / devops / setenvironment

setenvironment

JSON →
library2.0.3pypypi✓ verified 80d ago

A cross-platform library for setting environment variables in the current process and launching subprocesses with modified environments. Version 2.0.3 requires Python >=3.7 and is hosted on GitHub by zackees. Release cadence is sporadic.

pip install setenvironment
INSTALL
IMPORT
SIG · SETENVIRONMENT
S
setenvironment
devopspythonv2.0.3
Install
1.7s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Environment
from setenvironment import Environment
from setenvironment import set_env
setenv
from setenvironment import setenv
from setenvironment import set_env
get_env
from setenvironment import get_env
from setenvironment import set_env

Set an environment variable in the current process, then run a subprocess with an overridden environment.

from setenvironment import set_env, run_with_env set_env('MY_VAR', 'hello') run_with_env(['echo', '$MY_VAR'], {'MY_VAR': 'world'})
Debug
Known issues
gotcha`set_env` modifies the current process environment (os.environ). It does NOT affect the parent shell or persist after Python exits.
fix
Use `run_with_env` to spawn subprocesses with desired environment, or rely on `os.environ` modifications within the same Python session.
affects: all
deprecatedIn version 1.x, `set_env` accepted keyword arguments like `name=value`. In 2.x, only positional arguments are supported.
fix
Use `set_env('NAME', 'value')` instead of `set_env(NAME='value')`.
affects: >=2.0.0
breakingIn version 2.0.0, the function `export_env` was removed. Use `set_env` instead.
fix
Replace `export_env(...)` with `set_env(...)`.
affects: >=2.0.0
Upgrade
Version history
2.0.3latest on PyPI · released Oct 15, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
setenvironment — pip install setenvironment · libregistry