Skip to content

Commit

Permalink
Merge pull request #336 from backtick-se/v0430
Browse files Browse the repository at this point in the history
Version 0.4.30
  • Loading branch information
johanhenriksson authored Nov 1, 2021
2 parents ca1efb9 + 56de090 commit 2a16ac5
Show file tree
Hide file tree
Showing 6 changed files with 411 additions and 295 deletions.
3 changes: 2 additions & 1 deletion cowait/cli/app/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def run(
default=False)
@click.option('--capture',
help='toggle pytest output capture',
type=bool,
type=bool, is_flag=True,
default=True)
@click.pass_context
def test(
Expand Down Expand Up @@ -207,6 +207,7 @@ def ps(ctx, cluster: str):
def kill(ctx, cluster: str, task: str):
cowait.cli.kill(ctx.obj, task, cluster_name=cluster)


@click.command(help='deploy cowait agent')
@click.option('-c', '--cluster',
default=None,
Expand Down
4 changes: 3 additions & 1 deletion cowait/engine/docker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def create_ports(taskdef):

def create_env(cluster, taskdef):
env = base_environment(cluster, taskdef)

# check total length of environment data
length = 0
for key, value in env.items():
Expand All @@ -20,6 +20,8 @@ def create_env(cluster, taskdef):
# try to inherit the setting from the host
if key in os.environ:
value = os.environ[key]
elif 'fallback' in value:
value = value['fallback']
else:
source = value.get('source', '<unset>')
print(f'Warning: unset environment variable {key} with source "{source}"')
Expand Down
11 changes: 8 additions & 3 deletions cowait/types/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,14 @@ def typed_return(func: callable, result: object) -> object:
result_type = guess_type(result)

# serialize & validate
data = result_type.serialize(result)
result_type.validate(data, 'Return')
return data, result_type
try:
data = result_type.serialize(result)
result_type.validate(data, 'Return')
return data, result_type
except TypeError:
expect = type(result_type)
got = type(result)
raise TypeError(f'Expected task to return value of type {expect}, got {got}')


async def typed_call(func: callable, args: dict) -> object:
Expand Down
2 changes: 1 addition & 1 deletion cowait/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.4.29"
version = "0.4.30"
Loading

0 comments on commit 2a16ac5

Please sign in to comment.