Skip to main content

Geomancy validates deployment and development environments

Project description

geomancy logo

pypi version python versions Black formatting Documentation Status

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

Environment checks and tests are helpful for testing external dependencies, like LaTeX, remote dependencies, like AWS buckets or SSM parameters, or for checking environments that use the 12-factor principles.

Features

geomancy can:

  • Environment variables. Check environment variables are properly set and, optionally, check that they have valid values (checkEnv)
  • Paths. Check file and directory path existence (checkPath)
  • Executables. Check executables are available and, optionally, have the minimum or correct versions (checkExec)
  • Python Packages. Check python packages are availabile and, optionally, have the minimum or correct versions (checkPythonPkg)
  • Group Checks. Nested group checks with conditional (all or any) pass criteria (groups of checks)
  • Environment Substitution. Subsitute parameter values from environment variables. ex: checkPath: {HOME}/.geomancy.toml

Quickstart

Create a .geomancy.[toml](https://toml.io/en/) file with checks.

[checks.Environment]
desc = "Check environment variables common to all development environments"

    [checks.Environment.Username]
    desc = "The current username"
    checkEnv = "{USER}"
    regex = "[a-z_][a-z0-9_-]*[$]?"

[checks.Paths]
desc = "Checks the existence of needed files and directories"
subchecks = "any"  # at least one sub-check should pass

    [checks.Paths.Geomancy]
    desc = "Check for 'geomancy.toml' file"
    checkPath = "examples/geomancy.toml"
    type = "file"

    [checks.Paths.Pyproject]
    desc = "Check for 'pyproject.toml' file"
    checkPath = "examples/pyproject.toml"
    type = "file"

[checks.Executables]
desc = "Check the availability of commands and their versions"

    [checks.Executables.Python]
    desc = "Python interpreter"
    checkExec = "python3>=3.11"

[checks.PythonPackages]
desc = "Check the presence and, optional, the version of python packages"

    [checks.PythonPackages.geomancy]
    desc = "Geomancy python package"
    checkPythonPkg = "geomancy>=0.1"

By default, geomancy will search .geomancy.toml, geomancy.toml and pyproject.toml.

Use geo to run the checks

$ geo
=============================== .geomancy.toml ================================
    checks (9 checks)
[]   Environment (1 checks)
[]     Check environment variable '{USER}'...passed
[]   Paths (2 checks)
[]     Check path 'examples/geomancy.toml'...passed
[]     Check path 'examples/pyproject.toml'...passed
[]   Executables (1 checks)
[]     Check executable 'python3>=3.11'...passed
[]   PythonPackages (1 checks)
[]     Check python package 'geomancy>=0.1'...passed
======================= PASSED. 10 checks in 0.01s =======================

Documentation

For full documentation please see https://geomancy.readthedocs.io/en/latest.

Bugs or Requests

Please use the GitHub issue tracker to submit bugs or request features.

License

Copyright Justin Lorieau and others, 2023.

Distributed under the terms of the GPLv3 license. geomancy is free and open source software.

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.8.1.tar.gz (98.9 kB view hashes)

Uploaded Source

Built Distribution

geomancy-0.8.1-py3-none-any.whl (37.4 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