Skip to main content

Geomancy validates deployment and development environments

Project description

geomancy

The geomancy tool makes it easy to check and validate environments, such as development, testing and production.

Currently, geomancy can check that:

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

  1. Create a file containing checks. Either

    • .geomancy.toml in the project root. See the examples directory for examples.

    or

    • pyproject.toml with check in the [tool.geomancy] section.
  2. 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 varaibles 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


Download files

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

Source Distribution

geomancy-0.6.1b0.tar.gz (36.2 kB view hashes)

Uploaded Source

Built Distribution

geomancy-0.6.1b0-py3-none-any.whl (32.1 kB view hashes)

Uploaded Python 3

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