-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
84 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include yamlenv/py.typed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.PHONY: develop | ||
|
||
develop: | ||
@pip install -qe . | ||
|
||
test: tox mypy flake8 | ||
|
||
tox: requirements_tests | ||
tox | ||
|
||
mypy: requirements_tests | ||
mypy yamlenv | ||
|
||
flake8: requirements_tests | ||
flake8 yamlenv | ||
|
||
requirements_tests: develop | ||
@pip install -qUr requirements_tests.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[mypy] | ||
python_version = 3.6 | ||
# strict mode | ||
disallow_subclassing_any = True | ||
disallow_any_generics = True | ||
disallow_untyped_calls = True | ||
disallow_untyped_defs = True | ||
disallow_incomplete_defs = True | ||
check_untyped_defs = True | ||
disallow_untyped_decorators = True | ||
no_implicit_optional = True | ||
warn_redundant_casts = True | ||
warn_unused_ignores = True | ||
warn_return_any = True | ||
|
||
[mypy-setuptools] | ||
ignore_missing_imports = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
flake8 | ||
mypy | ||
tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# pylint: disable=no-self-use | ||
import os | ||
import unittest | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# pylint: disable=no-self-use | ||
import tempfile | ||
import unittest | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import typing as T | ||
import yaml | ||
|
||
from . import env, loader | ||
from yamlenv import env, loader | ||
from yamlenv.types import Stream | ||
|
||
|
||
__version__ = '0.6.0' | ||
|
||
|
||
def load(stream): | ||
# type: (Stream) -> T.Any | ||
data = yaml.load(stream, loader.Loader) | ||
return env.interpolate(data) | ||
|
||
|
||
def load_all(stream): | ||
# type: (Stream) -> T.Iterator[T.Any] | ||
for data in yaml.load_all(stream, loader.Loader): | ||
yield env.interpolate(data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from typing import Any, Callable, IO, Iterator, Set, Tuple, Union | ||
|
||
Obj = Any | ||
Path = Tuple[Any, ...] | ||
WalkType = Iterator[Tuple[Path, Obj]] | ||
Cache = Set[int] | ||
ObjI = Iterator[Tuple[Any, Any]] | ||
ObjIFunc = Callable[[Obj], ObjI] | ||
Stream = Union[str, IO[str]] |