Geomancy validates deployment and development environments
Project description
The geomancy
tool makes it easy to check and validate environments, such
as development, testing and production.
Currently, geomancy
can check:
- environment variables are properly set
- file and directory paths exist
- executables are available and, optionally, of the correct version
- groups of checks with conditional evaluation
- parameter values with substitution of environment variables.
ex:
checkPath: {HOME}/.geomancy.toml
The following is an example geomancy
run with an example checks file.
$ geo examples/geomancy.toml
========================= examples/geomancy.toml =========================
checks (10 checks)
[✔] Environment (2 checks)
[✔] Check environment variable '{PATH}'...passed
[✔] Check environment variable '{USER}'...passed
Paths (4 checks)
[✔] ChecksFile (3 checks)
[✔] Check path 'examples/geomancy.toml'...passed
[✔] Check path 'examples/pyproject.toml'...passed
[!] Check path '.missing__.txt'...missing
[✔] Executables (1 checks)
[✔] Check executable 'python3>=3.11'...passed
========================= 11 checks passed in 0.00s ======================
Usage
-
Create a file containing checks. Either
.geomancy.toml
in the project root. See theexamples
directory for examples.
or
pyproject.toml
with checks and config in the[tool.geomancy]
section.
-
Run the geo
$ geo
Format
Check Groups
Check groups are sections which contain one or more sub-checks.
name | description |
---|---|
desc | (Optional) The description for the check section |
condition | (Optional) Either 'all' to require that all sub-checks pass or 'any' to require that only one sub-check passes.Default: 'all' |
Examples
The following is a check group ChecksFile
with 2 checks, Geomancy
and
Pyproject
.
[checks.ChecksFile]
desc = "Checks that at least one checks file exists"
condition = "any"
[checks.ChecksFile.Geomancy]
desc = "Check for 'geomancy.toml' file"
checkPath = "examples/geomancy.toml"
type = "file"
[checks.ChecksFile.Pyproject]
desc = "Check for 'pyproject.toml' file"
checkPath = "examples/pyproject.toml"
type = "file"
The following is the same check group, but in abbreviated format.
[checks.ChecksFile]
condition = "any"
Geomancy = {checkPath = "examples/geomancy.toml", type = "file"}
Pyproject = {checkPath = "examples/pyproject.toml", type = "file"}
Checks
checkEnv
Check the existence and, optionally, the value of an environment variable.
name | description |
---|---|
checkEnv | Environment variable to check, wrapped in curly braces for substitution. aliases: checkEnv , CheckEnv |
desc | (Optional) The description for the check |
regex | (Optional) A regular expression to check against the environment variable value |
Examples
[checks.Environment.Username]
desc = "The current username"
checkEnv = "{USER}"
regex = "[a-z_][a-z0-9_-]*[$]?"
checkExec
Check the existence and, optionally, the version of available executables or commands.
name | description |
---|---|
checkExec | Executable to check. Additionally, an optional version check can be added with a test operator. aliases: checkExec , CheckExec |
desc | (Optional) The description for the check |
Examples
[checks.Executables.Ls]
desc = "List files"
checkExec = "ls"
[checks.Executables.Python]
desc = "Python interpreter (version 3.11 or higher)"
checkExec = "python3>=3.11"
checkPath
Check the existence and type of a path.
name | description |
---|---|
checkPath | Path to check, which may include environment variables wrapped in curly braces for substitution. aliases: checkPath , CheckPath |
desc | (Optional) The description for the check |
type | (Optional) Additionally check whether the path corresponds to a valid 'file' or 'dir' . |
Examples
[checks.Environment.Pyproject]
desc = "A project's pyprojectfile"
checkPath = "./pyproject.toml"
path_type = "file"
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.
Source Distribution
Built Distribution
Hashes for geomancy-0.6.3b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55fd68a829bf23191fa3d589afbd946041c7e3dc47b6c7f408c22d937545f6b3 |
|
MD5 | 38bd0cda4cb99a52fa1ecfeb858ef52e |
|
BLAKE2b-256 | aa717456cbd2f24f0aa949b2e750d1d6d9c57ee15f2709e1b81602d04220b644 |