Skip to content
Snippets Groups Projects
Commit 7c9213f7 authored by David Huss's avatar David Huss :speech_balloon:
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# common-config
This is a common configuration library for eigenservice
\ No newline at end of file
__version__ = '0.1.0'
import common_config.common
\ No newline at end of file
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import os, getpass, sys
import logging
import toml
from pathlib import Path
from logging.config import dictConfig
from typing import List, Optional, Union, MutableMapping, Any, Mapping
import collections.abc
APPLICATION_NAME = ""
SUFFIX = ""
DEFAULT_CONFIG = ""
def this_or_else(this: Optional[str], other: str) -> str:
"""
Return this appended with the application name
if this is a non-empty string otherwise return other
"""
if this is None or this.strip() == "":
return other
return f"{this}/{APPLICATION_NAME}"
def get_home() -> Optional[str]:
"""
Get the home directory from the environment variable
"""
return os.environ.get("HOME")
def get_config_directories() -> List[dict]:
"""
Returns a list of potential directories where the config could be stored.
Existence of the directories is _not_ checked
"""
# Generate a etc directory (usually /etc/eigenservice)
etc_directory = f"/etc/{APPLICATION_NAME}"
# Get the default config dir (usually /home/user/.config/eigenservice)
default_config_home = f"{get_home()}/.config/{APPLICATION_NAME}"
# Unless the XDG_CONFIG_HOME environment variable has been set, then use this instead
default_config_home = this_or_else(os.environ.get("XDG_CONFIG_HOME"), default_config_home)
# Create the list of directories
config_directories = [
{ "path": Path(etc_directory), "kind": "default", "source": None },
{ "path": Path(default_config_home), "kind": "default", "source": None }
]
# If the EIGENSERVICE_CONFIG_PATH environment variable exists append to list
key = "{}_CONFIG_DIR".format(APPLICATION_NAME.upper()).replace("-", "_").replace(" ", "_")
env_key = os.getenv(key)
if env_key is not None:
env_dir = { "path": Path(env_key), "kind": "env", "source": key }
config_directories.append(env_dir)
return config_directories
def get_potential_config_file_paths(suffix: str) -> List[dict]:
"""
Returns a list of config file paths in reverse order of importance
(last overrides first, non-existing paths may be contained)
"""
config_paths = []
for directory in get_config_directories():
for path in sorted(directory["path"].glob(f'*{suffix}.toml')):
path = { "path": path, "kind": "default", "source": None }
config_paths.append(path)
# If the EIGENSERVICE_CONFIG_PATH environment variable exists append to list
key = "{}_CONFIG_PATH".format(APPLICATION_NAME.upper()).replace("-", "_").replace(" ", "_")
env_key = os.getenv(key)
if env_key is not None:
env_path = { "path": Path(env_key), "kind": "env", "source": key }
config_paths.append(env_path)
# Add information about a paths existence
for p in config_paths:
p["exists"] = p["path"].is_file()
return config_paths
def get_existing_config_file_paths(suffix: str) -> List[Path]:
"""
Returns a list of existing config file paths in reverse order of importance
(last overrides first)
"""
return [p["path"] for p in get_potential_config_file_paths(suffix) if p["path"].is_file()]
def has_no_existing_config(suffix: str) -> bool:
"""
Returns true if there is no existing config
"""
return len(get_existing_config_file_paths(suffix)) == 0
def merge(this: Union[dict, MutableMapping], that: Union[dict, MutableMapping, Mapping]) -> Union[dict, MutableMapping[str, Any]]:
"""
Merge dict this in to dict that
"""
for key, value in that.items():
if isinstance(value, collections.abc.Mapping):
this[key] = merge(this.get(key, {}), value)
else:
this[key] = value
return this
def initialize_config(logger=None) -> MutableMapping[str, Any]:
"""
Initialize a configuration. If none exists, create a default one
"""
config = toml.loads(DEFAULT_CONFIG)
# Return if there is no other config
if has_no_existing_config(SUFFIX):
if logger is not None:
logger.warning("Using default configuration, create an override by running \"config create\"")
logger = set_loglevel(config, logger)
else:
print("Using default configuration, create an override by running config create")
return config
if logger is not None:
logger.info("Reading Configs in this order:")
logger.info("Config [1]: DEFAULT_CONFIG (hardcoded)")
else:
print("Reading Configs in this order:")
print("Config [1]: DEFAULT_CONFIG (hardcoded)")
# Read all existing configs in order and merge/override the default one
for i, p in enumerate(get_existing_config_file_paths(SUFFIX)):
next_config = read_config(str(p))
config = merge(dict(config), dict(next_config))
if logger is not None:
logger.info(f"Config [{i+2}]: {p} (overrides previous configs)")
else:
print(f"Config [{i+2}]: {p} (overrides previous configs)")
if logger is not None:
logger = set_loglevel(config, logger)
return config
def read_config(config_path: str) -> MutableMapping[str, Any]:
"""
Read a config.toml from the given path,
return a dict containing the config
"""
with open(str(config_path), "r", encoding="utf-8") as f:
config = toml.load(f)
return config
def set_loglevel(config, logger: logging.Logger) -> logging.Logger:
"""
Set the loglevel based on the config settings
"""
level = config["application"]["loglevel"].lower().strip()
if level == "debug":
logger.info(f"Set loglevel to {level.upper()}")
logger.setLevel(logging.DEBUG)
elif level == "info":
logger.info(f"Set loglevel to {level.upper()}")
logger.setLevel(logging.INFO)
elif level == "warning":
logger.info(f"Set loglevel to {level.upper()}")
logger.setLevel(logging.WARNING)
elif level == "error":
logger.info(f"Set loglevel to {level.upper()}")
logger.setLevel(logging.ERROR)
elif level == "critical":
logger.info(f"Set loglevel to {level.upper()}")
logger.setLevel(logging.CRITICAL)
else:
logger.critical(f"The loglevel \"{config['application']['loglevel']}\" set in config.toml is invalid use one of the following: \"Debug\", \"Info\", \"Warning\", \"Error\" or \"Critical\"")
exit(1)
return logger
def main():
"""
Gets run only if config.py is called directly or via `poetry run config`
Entry point for the CLI application
"""
# List of available commands and their respective functions
commands = {
"default" : print_default,
"paths": print_paths,
"directories": print_directories,
"create": create_config,
"test": test
}
# List of available options
availaible_options = [
["-h", "--help"]
]
# If no argument has been passed display the help and exit
if len(sys.argv) == 1:
print_help()
exit()
# Extract the command arguments
command_args = [c for c in sys.argv[1:] if not c.strip().startswith("-")]
# Extract the short_options
short_options = [c.lstrip("-") for c in sys.argv[1:] if c.strip().startswith("-") and not c.strip().startswith("--")]
# Flatten the short_options to e.g. so -1234 will result in ["1", "2", "3", "4"]
short_options = [item for sublist in short_options for item in sublist]
# Extract the long options
long_options = [c.lstrip("--") for c in sys.argv[1:] if c.strip().startswith("--")]
errored = False
# Short Options
for o in short_options:
if o not in [a[0].lstrip("-") for a in availaible_options]:
print(f"Error: the option \"-{o}\" does not exist.", file=sys.stderr)
errored = True
# Long Options
for o in long_options:
if o not in [a[0].lstrip("--") for a in availaible_options]:
print(f"Error: the option \"--{o}\" does not exist.", file=sys.stderr)
errored = True
# If any of the above errored, exit. This allows to display all errors at once
if errored:
print("\nCheck the available commands and options below:")
print()
print_help()
exit()
# Currently we only handle a single command
if len(command_args) == 1:
command = sys.argv[1]
# Short commands are allowed if they are not ambigous. E.g "te" will trigger "test"
if not any([c.startswith(command.strip().lower()) for c in commands.keys()]):
# No fitting command has been found, print helpt and exit
print_help()
exit()
elif len([c for c in commands.keys() if c.startswith(command.strip().lower())]) > 1:
# More than one fitting command has been found, display this message
print("Ambiguous Input: There are {} commands starting with \"{}\": {}".format(
len([c for c in commands.keys() if c.startswith(command.strip().lower())]),
command,
", ".join([c for c in commands.keys() if c.startswith(command.strip().lower())])
))
else:
# A command has been found:
choice = [c for c in commands.keys() if c.startswith(command.strip().lower())][0]
# If there is a -h or --help option, display the function's docstring
# otherwise execute the function
if "h" in short_options or "help" in long_options:
print("Help: config {}".format(commands[choice].__name__))
print(commands[choice].__doc__)
else:
commands[choice]()
else:
# If more than one command is given, display the help
print_help()
def test():
"""
Reads all configs like it would in production, prints out the order in which the config files are read and spits out the final resulting toml config
"""
import pprint
config = initialize_config()
print("\nvvvvvvvvvvvvv Below is the resulting config vvvvvvvvvvvvv\n")
print(toml.dumps(config))
def print_default():
"""
Prints the default config.toml
"""
print(DEFAULT_CONFIG)
def print_paths():
"""
Prints the potential paths where a config could or should be. If environment variables are used to specify said path, this will be mentioned. If a file doesn't exist, it will be mentioned as well.
"""
paths = get_potential_config_file_paths()
if paths is not None:
for p in paths:
if p["kind"] == "env":
if p["exists"]:
print(f"{p['path']} (set by environment variable {p['source']})")
else:
print(f"{p['path']} (set by environment variable {p['source']}, but doesn't exist)")
else:
if p["exists"]:
print(f"{p['path']}")
else:
print(f"{p['path']} (doesn't exist yet)")
else:
print("There are no paths..")
def print_directories():
"""
Prints a list of directories where configs are searched for.
Lower directories override higher directories.
"""
directories = get_config_directories()
if directories is not None:
for d in directories:
if d["kind"] == "env":
print(f"{d['path']} (set by environment variable {d['source']})")
else:
print(f"{d['path']}")
else:
print("There are no directories..")
def create_config():
"""
Interactivally create a config directory at a choice of different places with a default config in it.
"""
helptext = f"""Configs are read from the following directories (later overrides earlier):
1. DEFAULT_CONFIG (use config default to inspect)
2. /etc/eigenservice/*{SUFFIX}.toml (in alphabetical order)
3. $XDG_CONFIG_HOME/eigenservice/*{SUFFIX}.toml (in alphabetical order)
4. $EIGENSERVICE_CONFIG_DIR/*{SUFFIX}.toml (in alphabetical order)
5. $EIGENSERVICE_CONFIG_PATH (final override)
"""
print(helptext)
print()
print("Select one of the following options to create a new config:")
config_directories = get_config_directories()
for i, p in enumerate(config_directories):
# Create a source string describing the origin of the directory
if p["kind"] == "env":
source = "set via environment variable {}, ".format(p["source"])
else:
source = ""
# Display some options
if p["path"].is_dir():
config_path = Path(f"{p}/00-{SUFFIX}.toml")
if not config_path.is_file():
print(f" [{i}] {p['path']} ({source}create 00-{SUFFIX}.toml there)")
else:
print(f" [{i}] {p['path']} ({source}override existing 00-{SUFFIX}.toml!)")
elif p["path"].is_file():
pass
else:
print(f" [{i}] {p['path']} ({source}dir doesn't exist: create, then write 00-{SUFFIX}.toml there)")
print(" [x] Do nothing")
print()
# Collect the selection input
selection = None
while selection is None or not selection in [str(i) for i, p in enumerate(config_directories)]:
selection = input("Select one of the above: ")
if selection.lower() in ["x"]:
break
# If nothing has been selected, exit
if selection.lower() == "x":
exit()
# Store the selected directory here
selection = config_directories[int(selection)]
# Create the directory if it doesn't exist yet
try:
selection["path"].mkdir(mode=0o755, parents=True, exist_ok=True)
except PermissionError:
print()
print("Error: Didn't have the permissions to create the config directory at {}".format(selection["path"]), file=sys.stderr)
print("Hint: Change the owner of the directory temporarily to {} or run {} config create with more permissions".format(getpass.getuser(), APPLICATION_NAME))
exit()
config_path = Path(f"{selection['path']}/00-{SUFFIX}.toml")
# If the 00-frontend.toml already exists, ask whether it shall be moved to 00-frontend.toml.old
if config_path.is_file():
# Create an alternate config path, incrementing up if .old already exists
alt_config_path = None
i = 1
while alt_config_path is None or alt_config_path.exists():
if i == 1:
alt_config_path = Path("{}.old".format(config_path))
else:
alt_config_path = Path("{}.old{}".format(config_path, i))
i += 1
# Ask for confirmation
confirmation = None
while confirmation is None or not confirmation.lower().strip() in ["y", "n"]:
confirmation = input(f"Move existing file at \"{config_path}\" to \"{alt_config_path}\"? [Y/n]:\t")
if confirmation.lower().strip() != "y":
exit()
else:
config_path.rename(alt_config_path)
print(f"Moved existing file \"{config_path}\" to \"{alt_config_path}\"")
# Create the config.toml or display a hint if the permissions don't suffice
try:
config_path.write_text(DEFAULT_CONFIG)
except PermissionError as e:
print()
print(f"Error: Didn't have the permissions to write the file to {config_path}", file=sys.stderr)
print(f" Directory \"{selection['path']}\" belongs to user {selection['path'].owner()} (was running as user {getpass.getuser()})", file=sys.stderr)
print()
print(f"Hint: Change the owner of the directory temporarily to {getpass.getuser()} or run {APPLICATION_NAME} config create with more permissions")
exit()
print(f"Default Config has been written to {config_path}")
def print_help():
"""
Print the help
"""
helptext = f"""========= {APPLICATION_NAME.upper()} CONFIG ({SUFFIX.upper()}) =========
Helper tool for managing and installing a eigenservice config.
Configs are read from the following directories (later overrides earlier):
1. DEFAULT_CONFIG (see below)
2. /etc/eigenservice/*{SUFFIX}.toml (in alphabetical order)
3. $XDG_CONFIG_HOME/eigenservice/*{SUFFIX}.toml (in alphabetical order)
4. $EIGENSERVICE_CONFIG_DIR/*{SUFFIX}.toml (in alphabetical order)
5. $EIGENSERVICE_CONFIG_PATH (final override)
Commands:
create . . . . . Interactivly create a default config file
default . . . . . Prints default {SUFFIX}.toml to stdout
directories . . . Prints which config directories are read
paths . . . . . . Prints which config files are read
test . . . . . . Read in the configs and print the resulting combined toml
Options:
-h, --help . . . Display the help message of a command
"""
print(helptext)
[[package]]
name = "atomicwrites"
version = "1.4.0"
description = "Atomic file writes."
category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
[[package]]
name = "attrs"
version = "21.2.0"
description = "Classes Without Boilerplate"
category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
[package.extras]
dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit"]
docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"]
tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"]
tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"]
[[package]]
name = "colorama"
version = "0.4.4"
description = "Cross-platform colored terminal text."
category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
[[package]]
name = "more-itertools"
version = "8.10.0"
description = "More routines for operating on iterables, beyond itertools"
category = "dev"
optional = false
python-versions = ">=3.5"
[[package]]
name = "packaging"
version = "21.2"
description = "Core utilities for Python packages"
category = "dev"
optional = false
python-versions = ">=3.6"
[package.dependencies]
pyparsing = ">=2.0.2,<3"
[[package]]
name = "pluggy"
version = "0.13.1"
description = "plugin and hook calling mechanisms for python"
category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
[package.extras]
dev = ["pre-commit", "tox"]
[[package]]
name = "py"
version = "1.10.0"
description = "library with cross-python path, ini-parsing, io, code, log facilities"
category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
[[package]]
name = "pyparsing"
version = "2.4.7"
description = "Python parsing module"
category = "dev"
optional = false
python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
[[package]]
name = "pytest"
version = "5.4.3"
description = "pytest: simple powerful testing with Python"
category = "dev"
optional = false
python-versions = ">=3.5"
[package.dependencies]
atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""}
attrs = ">=17.4.0"
colorama = {version = "*", markers = "sys_platform == \"win32\""}
more-itertools = ">=4.0.0"
packaging = "*"
pluggy = ">=0.12,<1.0"
py = ">=1.5.0"
wcwidth = "*"
[package.extras]
checkqa-mypy = ["mypy (==v0.761)"]
testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"]
[[package]]
name = "toml"
version = "0.10.2"
description = "Python Library for Tom's Obvious, Minimal Language"
category = "main"
optional = false
python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
[[package]]
name = "wcwidth"
version = "0.2.5"
description = "Measures the displayed width of unicode strings in a terminal"
category = "dev"
optional = false
python-versions = "*"
[metadata]
lock-version = "1.1"
python-versions = "^3.8"
content-hash = "8d053f67784f83194a2fc92816ce53a2962947428d27e1ccbdcd7b1fcba469e2"
[metadata.files]
atomicwrites = [
{file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"},
{file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"},
]
attrs = [
{file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"},
{file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"},
]
colorama = [
{file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"},
{file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"},
]
more-itertools = [
{file = "more-itertools-8.10.0.tar.gz", hash = "sha256:1debcabeb1df793814859d64a81ad7cb10504c24349368ccf214c664c474f41f"},
{file = "more_itertools-8.10.0-py3-none-any.whl", hash = "sha256:56ddac45541718ba332db05f464bebfb0768110111affd27f66e0051f276fa43"},
]
packaging = [
{file = "packaging-21.2-py3-none-any.whl", hash = "sha256:14317396d1e8cdb122989b916fa2c7e9ca8e2be9e8060a6eff75b6b7b4d8a7e0"},
{file = "packaging-21.2.tar.gz", hash = "sha256:096d689d78ca690e4cd8a89568ba06d07ca097e3306a4381635073ca91479966"},
]
pluggy = [
{file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"},
{file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"},
]
py = [
{file = "py-1.10.0-py2.py3-none-any.whl", hash = "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"},
{file = "py-1.10.0.tar.gz", hash = "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3"},
]
pyparsing = [
{file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"},
{file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"},
]
pytest = [
{file = "pytest-5.4.3-py3-none-any.whl", hash = "sha256:5c0db86b698e8f170ba4582a492248919255fcd4c79b1ee64ace34301fb589a1"},
{file = "pytest-5.4.3.tar.gz", hash = "sha256:7979331bfcba207414f5e1263b5a0f8f521d0f457318836a7355531ed1a4c7d8"},
]
toml = [
{file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"},
{file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"},
]
wcwidth = [
{file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"},
{file = "wcwidth-0.2.5.tar.gz", hash = "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"},
]
[tool.poetry]
name = "common-config"
version = "0.1.0"
description = "A config library for eigenservice"
authors = ["David Huss <dh@atoav.com>"]
[tool.poetry.dependencies]
python = "^3.8"
toml = "^0.10.2"
[tool.poetry.dev-dependencies]
pytest = "^5.2"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
from common_config import __version__
def test_version():
assert __version__ == '0.1.0'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment