generated from linz/template-python-hello-world
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dependabot/pip/mypy-1.10.0
- Loading branch information
Showing
19 changed files
with
235 additions
and
73 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
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
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 |
---|---|---|
|
@@ -25,7 +25,7 @@ ignore_missing_imports = true | |
|
||
[tool.poetry] | ||
name = "topo-imagery" | ||
version = "4.5.0" | ||
version = "4.6.0" | ||
description = "A collection of scripts for processing imagery" | ||
authors = [ | ||
"Blayne Chard <[email protected]>", | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from shutil import rmtree | ||
from tempfile import mkdtemp | ||
from typing import Generator | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture(name="setup", autouse=True) | ||
def fixture_setup() -> Generator[str, None, None]: | ||
""" | ||
This function creates a temporary directory and deletes it after each test. | ||
See following link for details: | ||
https://docs.pytest.org/en/stable/fixture.html#yield-fixtures-recommended | ||
""" | ||
target = mkdtemp() | ||
yield target | ||
rmtree(target) |
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import json | ||
from typing import Any, Dict | ||
|
||
|
||
def dict_to_json_bytes(input_dict: Dict[str, Any]) -> bytes: | ||
""" | ||
Try to convert a `dict` into UTF-8 encoded `bytes` representing a JSON dictionary | ||
Examples: | ||
>>> dict_to_json_bytes({}) | ||
b'{}' | ||
>>> dict_to_json_bytes({"ā": "😀"}) # Unicode code points U+0101 and U+1F600 | ||
b'{"\xc4\x81": "\xf0\x9f\x98\x80"}' | ||
>>> json.loads(dict_to_json_bytes({"ā": "😀"})) | ||
{'ā': '😀'} | ||
""" | ||
return json.dumps(input_dict, ensure_ascii=False).encode("utf-8") |
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
Oops, something went wrong.