Skip to content
This repository has been archived by the owner on Mar 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #31 from cloudstateio/release/prepare_0.1.0
Browse files Browse the repository at this point in the history
release/prepare 0.1.0. 
thank you @sleipnir!
  • Loading branch information
marcellanz authored May 29, 2020
2 parents 2b018d3 + 81e7135 commit e896bb5
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 28 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ Python 3.7.3

### generate installer
```
./venv/bin/python3 setup.py bdist_wheel
python setup.py bdist_wheel
```

### local install
```
./venv/bin/python3 -m pip install dist/cloudstate-0.5.0-py3-none-any.whl
python -m pip install dist/cloudstate-0.1.0-py3-none-any.whl
```
7 changes: 6 additions & 1 deletion cloudstate/cloudstate.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
Copyright 2020 Lightbend Inc.
Licensed under the Apache License, Version 2.0.
"""

from dataclasses import (dataclass, field)
from typing import List
import os
Expand Down Expand Up @@ -25,7 +30,7 @@ def register_event_sourced_entity(self, entity: EventSourcedEntity):
def start(self):
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
add_EntityDiscoveryServicer_to_server(CloudStateEntityDiscoveryServicer(self.event_sourced_entities), server)
add_EventSourcedServicer_to_server(CloudStateEventSourcedServicer(self.event_sourced_entities),server)
add_EventSourcedServicer_to_server(CloudStateEventSourcedServicer(self.event_sourced_entities), server)
port = os.environ.get('HOST', '127.0.0.1') + ':' + os.environ.get('PORT', '8080')
server.add_insecure_port(port)
pprint('Starting Cloudstate on ' + port)
Expand Down
5 changes: 5 additions & 0 deletions cloudstate/contexts.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
Copyright 2020 Lightbend Inc.
Licensed under the Apache License, Version 2.0.
"""

from dataclasses import dataclass, field
from typing import List

Expand Down
17 changes: 4 additions & 13 deletions cloudstate/discovery_servicer.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
# Copyright 2019 Lightbend Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Copyright 2020 Lightbend Inc.
Licensed under the Apache License, Version 2.0.
"""

import platform
from dataclasses import dataclass
Expand Down
12 changes: 8 additions & 4 deletions cloudstate/evensourced_servicer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
from dataclasses import dataclass
"""
Copyright 2020 Lightbend Inc.
Licensed under the Apache License, Version 2.0.
"""

import logging
from pprint import pprint
from typing import List

from google.protobuf import symbol_database as _symbol_database
from google.protobuf.any_pb2 import Any

from cloudstate.entity_pb2 import Command
Expand All @@ -9,9 +16,6 @@
from cloudstate.event_sourced_pb2 import EventSourcedInit, EventSourcedSnapshot, EventSourcedEvent, EventSourcedReply, \
EventSourcedStreamOut
from cloudstate.event_sourced_pb2_grpc import EventSourcedServicer
from pprint import pprint
from google.protobuf import symbol_database as _symbol_database
import logging

_sym_db = _symbol_database.Default()

Expand Down
5 changes: 5 additions & 0 deletions cloudstate/event_sourced_context.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
Copyright 2020 Lightbend Inc.
Licensed under the Apache License, Version 2.0.
"""

from dataclasses import dataclass, field
from typing import List, Any

Expand Down
5 changes: 5 additions & 0 deletions cloudstate/event_sourced_entity.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
Copyright 2020 Lightbend Inc.
Licensed under the Apache License, Version 2.0.
"""

from dataclasses import dataclass, field
from typing import List, Callable, Any, Mapping, MutableMapping
import inspect
Expand Down
9 changes: 7 additions & 2 deletions cloudstate/tests/test_cloudstate.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# content of test_sample.py
"""
Copyright 2020 Lightbend Inc.
Licensed under the Apache License, Version 2.0.
"""


def inc(x):
return x + 1


def test_answer():
assert inc(3) == 4
assert inc(3) == 4
4 changes: 1 addition & 3 deletions cloudstate/version.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-

"""
Copyright 2020 Lightbend Inc.
Licensed under the Apache License, Version 2.0.
"""

__version__ = "0.5.0"
__version__ = "0.1.0"
4 changes: 2 additions & 2 deletions scripts/fetch-cloudstate-pb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function fetch() {

tag=$1

# CloudState protocol
# Cloudstate protocol
fetch "protocol/cloudstate/entity.proto" $tag
fetch "protocol/cloudstate/event_sourced.proto" $tag
fetch "protocol/cloudstate/function.proto" $tag
Expand All @@ -24,7 +24,7 @@ fetch "protocol/cloudstate/crdt.proto" $tag
fetch "example/shoppingcart/shoppingcart.proto" $tag
fetch "example/shoppingcart/persistence/domain.proto" $tag

# CloudState frontend
# Cloudstate frontend
fetch "frontend/cloudstate/entity_key.proto" $tag

# dependencies
Expand Down
2 changes: 1 addition & 1 deletion shoppingcart/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.8.0-slim

COPY ./dist /dist
RUN pip install /dist/cloudstate-0.5.0-py3-none-any.whl
RUN pip install /dist/cloudstate-0.1.0-py3-none-any.whl

WORKDIR /app
COPY ./shoppingcart ./shoppingcart
Expand Down
5 changes: 5 additions & 0 deletions shoppingcart/shopping_cart.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
Copyright 2020 Lightbend Inc.
Licensed under the Apache License, Version 2.0.
"""

from cloudstate.cloudstate import CloudState
from shoppingcart.shopping_cart_entity import entity as shopping_cart_entity
import logging
Expand Down
5 changes: 5 additions & 0 deletions shoppingcart/shopping_cart_entity.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
Copyright 2020 Lightbend Inc.
Licensed under the Apache License, Version 2.0.
"""

from dataclasses import dataclass, field
from typing import MutableMapping

Expand Down

0 comments on commit e896bb5

Please sign in to comment.