Commit 0836cebf authored by xa's avatar xa

Merge branch 'versioneer' into 'master'

Release to pypi



See merge request !1
parents 575a893b 130e033b
Pipeline #184 passed with stage
[run]
omit = overdub/_version.py
overdub/_version.py export-subst
......@@ -22,3 +22,15 @@ python3.4 tests:
- py.test --cov overdub --cov-report term-missing tests/
tags:
- python3.4
publish to pypi:
type: deploy
script:
- python -m pip install twine
- python setup.py sdist bdist_wheel
- twine upload -u $PYPI_USER -p $PYPI_PASSWORD dist/*
tags:
- python2.7
only:
- /^v[\d\.]+.*$/
allow_failure: true
include versioneer.py
include overdub/_version.py
Overdub
=======
Load configurations from multiple yaml files.
Load and merge nested configurations.
Usage
-----
Installation::
python -m pip install overdub
With these structures::
from overdub import MutableOverdub
a = {'foo': 1, 'bar': {'baz': 2}, 'qux': {'one': 1}}
b = {'foo': 3, 'bar': {'baz': 4}, 'qux': {'two': 2}}
Update::
overdubbed = MutableOverdub(a)
overdubbed.update(b)
assert overdubbed.foo == 3
assert overdubbed.bar.baz == 4
assert overdubbed.qux == {'two': 2}
Merge::
overdubbed = MutableOverdub(a)
overdubbed.merge(b)
assert overdubbed.foo == 3
assert overdubbed.bar.baz == 4
assert overdubbed.qux == {'one': 1, 'two': 2}
Rebase::
overdubbed = MutableOverdub(a)
overdubbed.rebase(b)
assert overdubbed.foo == 1
assert overdubbed.bar.baz == 2
assert overdubbed.qux == {'one': 1, 'two': 2}
Freeze configuration::
overdubbed = overdubbed.frozen()
YAML files
----------
It can also read configuration from yaml files, for this install::
python -m pip install overdub[yaml]
And then, merge all files::
from overdub import yaml
overdubbed = yaml.load_from_file('a.yml', b.yml')
assert overdubbed.foo == 3
assert overdubbed.bar.baz == 4
assert overdubbed.qux == {'one': 1, 'two': 2}
from .bases import MutableOverdub, Overdub
from ._version import get_versions
__all__ = ['MutableOverdub', 'Overdub']
__version__ = get_versions()['version']
del get_versions
This diff is collapsed.
try:
try: # pragma: no cover
from collections.abc import Mapping
except ImportError:
except ImportError: # pragma: no cover
# python < 3.0
from collections import Mapping
from copy import deepcopy
......
[versioneer]
VCS = git
style = pep440
versionfile_source = overdub/_version.py
tag_prefix = v
[metadata]
description-file = README.rst
[flake8]
exclude = _version.py
max-complexity = 10
#!/usr/bin/env python
from setuptools import setup, find_packages
with open('README.rst') as file:
content = file.read()
import versioneer
setup(
name='overdub',
version='0.1',
version=versioneer.get_version(),
author='Xavier Barbosa',
author_email='clint.northwood@gmail.com',
description='layered configuration loading',
long_description=content,
description='layered configuration aggregator',
packages=find_packages(),
install_requires=[],
extras_require={
......@@ -33,4 +30,5 @@ setup(
keywords=['configuration', 'layer', 'yaml'],
url='http://lab.errorist.xyz/abc/overdub',
license='MIT',
cmdclass=versioneer.get_cmdclass()
)
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment