Skip to content

Commit f874e3b

Browse files
committed
release
1 parent 0e7fc36 commit f874e3b

File tree

7 files changed

+19
-16
lines changed

7 files changed

+19
-16
lines changed

MANIFEST.in

Lines changed: 0 additions & 6 deletions
This file was deleted.

metablock/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from .spaces import Block, Service, Space, SpaceExtension
66
from .user import User
77

8-
__version__ = "0.6.1"
8+
__version__ = "0.6.2"
99

1010
__all__ = [
1111
"Metablock",

metablock/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ async def _apply(path: str, space_name: str, token: str) -> None:
5050
block = by_name.get(name)
5151
if block:
5252
# update
53-
click.echo(f"update block {name}")
5453
await mb.services.update(block.id, **config)
54+
click.echo(f"updated block {name}")
5555
else:
5656
# create
57-
click.echo(f"create new block {name}")
5857
await space.services.create(name=name, **config)
58+
click.echo(f"created new block {name}")
5959

6060

6161
if __name__ == "__main__":

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "metablock"
3-
version = "0.6.1"
3+
version = "0.6.2"
44
description = "Metablock cloud python client"
55
authors = ["Luca <[email protected]>"]
66
license = "BSD"

readme.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,9 @@ cli = Metablock()
2828
user = await cli.get_user()
2929
```
3030

31-
For the authentication token you can create the `METABLOCK_API_TOKEN` environment variable.
31+
For the authentication token, you can use the `METABLOCK_API_TOKEN` environment variable,
32+
alternatively, you can pass it to the client constructor:
33+
34+
```python
35+
cli = Metablock(auth_key="your-token")
36+
```

tests/blocks/test.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
html: false
2-
upstream: http://metablock.prod.svc
31
tags:
42
- test
53
routes:
64
- name: main
75
protocols:
8-
- http
96
- https
107
paths:
11-
- /
8+
- /test
129
tags:
13-
- public
10+
- test

tests/test_cli.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,10 @@ def test_cli_apply_no_space():
1414
result = runner.invoke(cli, ["apply", "tests/blocks"])
1515
assert result.exit_code == 1
1616
assert result.output.startswith("metablock space is required")
17+
18+
19+
def test_cli_apply():
20+
runner = CliRunner()
21+
result = runner.invoke(cli, ["apply", "tests/blocks", "--space", "mblock"])
22+
assert result.exit_code == 0
23+
assert result.output.endswith("updated block test\n")

0 commit comments

Comments
 (0)