No project description provided
Project description
tox-envfile
A tox plugin that loads environment variables from env files into your tox envs.
Reads environment variables from a file named .devdata.env
in the same
directory as your tox.ini
file and adds them to the environment that tox runs
your commands in.
This is a pretty dumb plugin for now: all of the environment variables in
.devdata.env
will be loaded into the environment for every tox env that you
run, unconditionally. Any existing envvars with conflicting names will be
overwritten.
TODO:
- [ ] Support env file names other than
.devdata.env
(which just happens to be the filename I'm using in my projects) - [ ] Support some kind of conditional loading where you can specify in the
tox.ini
file which tox envs the env file should be loaded for, and which not. And load different env files for different tox envs. Something like:env = {toxinidir}/.env
(orreadenv
) intox.ini
.
Usage
Just add this to your tox.ini
file:
requires = tox-envfile
env File Format
python-dotenv is used for the env file parsing.
The .devdata.env
file should be an env file with contents that look like
this:
# a comment that will be ignored. REDIS_ADDRESS=localhost:6379 MEANING_OF_LIFE=42 MULTILINE_VAR="hello\nworld"
Or like this:
export S3_BUCKET=YOURS3BUCKET export SECRET_KEY=YOURSECRETKEYGOESHERE
POSIX variable expansion works, using variables from the environment or from earlier lines in the env file:
CONFIG_PATH=${HOME}/.config/foo DOMAIN=example.org EMAIL=admin@${DOMAIN}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size tox_envfile-0.0.2-py3-none-any.whl (2.5 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Filename, size tox-envfile-0.0.2.tar.gz (2.1 kB) | File type Source | Python version None | Upload date | Hashes View |
Hashes for tox_envfile-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1d083972cdbedaf80ab854d4be43f5a8a779c729f93c365cd4c4e8e83301f98 |
|
MD5 | 9f4943ec7879e2ea2b2a4fb01a0175fe |
|
BLAKE2-256 | 3a3d4f397f6dfdeb8706ff2927bd3d5c51b0938fc6fa86efbefb423cdf595df0 |