diff --git a/README.md b/README.md index b28f20c..c51f161 100644 --- a/README.md +++ b/README.md @@ -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 ``` \ No newline at end of file diff --git a/cloudstate/cloudstate.py b/cloudstate/cloudstate.py index 23dd86a..a341696 100644 --- a/cloudstate/cloudstate.py +++ b/cloudstate/cloudstate.py @@ -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 @@ -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) diff --git a/cloudstate/contexts.py b/cloudstate/contexts.py index fa8b9a7..6860216 100644 --- a/cloudstate/contexts.py +++ b/cloudstate/contexts.py @@ -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 diff --git a/cloudstate/discovery_servicer.py b/cloudstate/discovery_servicer.py index eb8c7a0..ac3e9e7 100755 --- a/cloudstate/discovery_servicer.py +++ b/cloudstate/discovery_servicer.py @@ -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 diff --git a/cloudstate/evensourced_servicer.py b/cloudstate/evensourced_servicer.py index 6bc9211..6e54104 100644 --- a/cloudstate/evensourced_servicer.py +++ b/cloudstate/evensourced_servicer.py @@ -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 @@ -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() diff --git a/cloudstate/event_sourced_context.py b/cloudstate/event_sourced_context.py index a6763e1..8e7d871 100644 --- a/cloudstate/event_sourced_context.py +++ b/cloudstate/event_sourced_context.py @@ -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 diff --git a/cloudstate/event_sourced_entity.py b/cloudstate/event_sourced_entity.py index b0d9d78..37cf697 100644 --- a/cloudstate/event_sourced_entity.py +++ b/cloudstate/event_sourced_entity.py @@ -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 diff --git a/cloudstate/tests/test_cloudstate.py b/cloudstate/tests/test_cloudstate.py index 6098302..9630c91 100644 --- a/cloudstate/tests/test_cloudstate.py +++ b/cloudstate/tests/test_cloudstate.py @@ -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 \ No newline at end of file + assert inc(3) == 4 diff --git a/cloudstate/version.py b/cloudstate/version.py index 1a42a57..bdb07aa 100644 --- a/cloudstate/version.py +++ b/cloudstate/version.py @@ -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" diff --git a/scripts/fetch-cloudstate-pb.sh b/scripts/fetch-cloudstate-pb.sh index 1484904..bf5873f 100644 --- a/scripts/fetch-cloudstate-pb.sh +++ b/scripts/fetch-cloudstate-pb.sh @@ -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 @@ -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 diff --git a/shoppingcart/Dockerfile b/shoppingcart/Dockerfile index 228185c..96cea7a 100644 --- a/shoppingcart/Dockerfile +++ b/shoppingcart/Dockerfile @@ -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 diff --git a/shoppingcart/shopping_cart.py b/shoppingcart/shopping_cart.py index b41582b..077034a 100644 --- a/shoppingcart/shopping_cart.py +++ b/shoppingcart/shopping_cart.py @@ -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 diff --git a/shoppingcart/shopping_cart_entity.py b/shoppingcart/shopping_cart_entity.py index 067aac3..2553cd7 100644 --- a/shoppingcart/shopping_cart_entity.py +++ b/shoppingcart/shopping_cart_entity.py @@ -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