You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by bo...@apache.org on 2022/11/12 15:01:27 UTC
[incubator-streampipes] 12/18: tmp
This is an automated email from the ASF dual-hosted git repository.
bossenti pushed a commit to branch feature/STREAMPIPES-607
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit 49830cae572016474a6dc56d07101bfffcc1d427
Author: bossenti <bo...@posteo.de>
AuthorDate: Thu Nov 10 21:31:08 2022 +0100
tmp
---
streampipes-client-python/.gitignore | 3 ++-
streampipes-client-python/README.md | 2 ++
streampipes-client-python/githooks/pre-commit | 10 ----------
streampipes-client-python/setup.py | 4 +++-
.../endpoints => streampipes_client}/__init__.py | 0
.../streampipes_client/__version__.py | 2 +-
.../streampipes_client/client/__init__.py | 5 ++++-
.../client/client.py | 6 +++---
.../client/credentials.py | 0
.../streampipes_client/endpoint/data_lake_measure.py | 13 +++++++++++++
.../endpoint}/endpoint.py | 5 ++---
.../model/common.py | 0
.../model/container/__init__.py | 0
.../model/container/data_lake_measures.py | 4 ++--
.../model/container/model_container.py | 4 ++--
.../model/element/__init__.py | 0
.../model/element/data_lake_measure.py | 4 ++--
.../model/element/element.py | 2 +-
.../streampipesclient/__init__.py | 18 ------------------
.../streampipesclient/client/__init__.py | 19 -------------------
.../streampipesclient/endpoints/data_lake_measure.py | 18 ------------------
.../streampipesclient/model/__init__.py | 16 ----------------
streampipes-client-python/tests/__init__.py | 0
23 files changed, 37 insertions(+), 98 deletions(-)
diff --git a/streampipes-client-python/.gitignore b/streampipes-client-python/.gitignore
index 0cd13ceab..3de8f73f6 100644
--- a/streampipes-client-python/.gitignore
+++ b/streampipes-client-python/.gitignore
@@ -186,7 +186,6 @@ cover/
.pybuilder/
target/
-# Jupyter Notebook
# IPython
@@ -216,6 +215,8 @@ venv/
ENV/
env.bak/
venv.bak/
+build
+Scripts
# Spyder project settings
.spyderproject
diff --git a/streampipes-client-python/README.md b/streampipes-client-python/README.md
index 4fbb650c5..c4164d196 100644
--- a/streampipes-client-python/README.md
+++ b/streampipes-client-python/README.md
@@ -43,6 +43,8 @@ and the amazing universe of data analytics libraries in Python.
<br>
**:exclamation::exclamation::exclamation:IMPORTANT:exclamation::exclamation::exclamation:**
+<br>
+
### Get ready for development
1) Set up your Python environment
diff --git a/streampipes-client-python/githooks/pre-commit b/streampipes-client-python/githooks/pre-commit
deleted file mode 100644
index 025fc6455..000000000
--- a/streampipes-client-python/githooks/pre-commit
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-set -e
-
-CHANGED_FILES="$(git --no-pager diff --name-status --no-color --cached --diff-filter=d|awk '$1 !~ /R/ && ( $2 ~ /\.py|\.pyi/ ) {print $2}; $1 ~ /R/ && ( $3 ~ /\.py|\.pyi/ ) {print $3}')"
-
-if [ -z "$CHANGED_FILES" ]; then
- echo "No Python staged files."
- exit 0
-fi;
-
diff --git a/streampipes-client-python/setup.py b/streampipes-client-python/setup.py
index 4c1a74fff..4914564f8 100644
--- a/streampipes-client-python/setup.py
+++ b/streampipes-client-python/setup.py
@@ -31,6 +31,9 @@ REQUIRES_PYTHON = ">=3.8.0"
# Package requirements.
base_packages = [
+ "pandas>=1.5.1",
+ "pydantic>=1.10.2",
+ "requests>=2.28.1"
]
dev_packages = base_packages + [
@@ -79,7 +82,6 @@ setuptools.setup(
"test": dev_packages,
"docs": docs_packages,
"all": dev_packages + docs_packages,
- ":python_version == '3.8'": ["dataclasses"], # todo check if required
},
include_package_data=True,
license="Apache License 2.0",
diff --git a/streampipes-client-python/streampipesclient/endpoints/__init__.py b/streampipes-client-python/streampipes_client/__init__.py
similarity index 100%
rename from streampipes-client-python/streampipesclient/endpoints/__init__.py
rename to streampipes-client-python/streampipes_client/__init__.py
diff --git a/streampipes-client-python/streampipes_client/__version__.py b/streampipes-client-python/streampipes_client/__version__.py
index 3496c1813..492084802 100644
--- a/streampipes-client-python/streampipes_client/__version__.py
+++ b/streampipes-client-python/streampipes_client/__version__.py
@@ -15,6 +15,6 @@
# limitations under the License.
#
-VERSION = (0, 0, 1)
+VERSION = (0, 71, 0)
__version__ = ".".join(map(str, VERSION)) # noqa: F401
diff --git a/streampipes-client-python/streampipes_client/client/__init__.py b/streampipes-client-python/streampipes_client/client/__init__.py
index ecb1860df..a323247a5 100644
--- a/streampipes-client-python/streampipes_client/client/__init__.py
+++ b/streampipes-client-python/streampipes_client/client/__init__.py
@@ -13,4 +13,7 @@
# 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.
-#
\ No newline at end of file
+#
+
+from .client import StreamPipesClient
+from .credentials import StreamPipesApiKeyCredentials
diff --git a/streampipes-client-python/streampipesclient/client/client.py b/streampipes-client-python/streampipes_client/client/client.py
similarity index 93%
rename from streampipes-client-python/streampipesclient/client/client.py
rename to streampipes-client-python/streampipes_client/client/client.py
index 3df75869b..f7948b7c0 100644
--- a/streampipes-client-python/streampipesclient/client/client.py
+++ b/streampipes-client-python/streampipes_client/client/client.py
@@ -17,12 +17,12 @@
import logging
import sys
from dataclasses import dataclass
-from typing import Dict, Optional, Union, Type
+from typing import Dict, Optional
import requests
-from streampipesclient.client.credentials import CredentialProvider
-from streampipesclient.endpoints.data_lake_measure import DataLakeMeasureEndpoint
+from streampipes_client.client.credentials import CredentialProvider
+from streampipesclient.endpoints import DataLakeMeasureEndpoint
logger = logging.getLogger(__name__)
diff --git a/streampipes-client-python/streampipesclient/client/credentials.py b/streampipes-client-python/streampipes_client/client/credentials.py
similarity index 100%
rename from streampipes-client-python/streampipesclient/client/credentials.py
rename to streampipes-client-python/streampipes_client/client/credentials.py
diff --git a/streampipes-client-python/streampipes_client/endpoint/data_lake_measure.py b/streampipes-client-python/streampipes_client/endpoint/data_lake_measure.py
new file mode 100644
index 000000000..6ee4c8403
--- /dev/null
+++ b/streampipes-client-python/streampipes_client/endpoint/data_lake_measure.py
@@ -0,0 +1,13 @@
+from streampipes_client.endpoint.endpoint import APIEndpoint
+from streampipes_client.model.container.data_lake_measures import DataLakeMeasures
+
+
+class DataLakeMeasureEndpoint(APIEndpoint):
+
+ @classmethod
+ def _container_cls(cls):
+ return DataLakeMeasures
+
+ @property
+ def _relative_api_path(self):
+ return "api", "v4", "datalake", "measurements"
diff --git a/streampipes-client-python/streampipesclient/endpoints/endpoint.py b/streampipes-client-python/streampipes_client/endpoint/endpoint.py
similarity index 96%
rename from streampipes-client-python/streampipesclient/endpoints/endpoint.py
rename to streampipes-client-python/streampipes_client/endpoint/endpoint.py
index b0a5c4693..4bc54df19 100644
--- a/streampipes-client-python/streampipesclient/endpoints/endpoint.py
+++ b/streampipes-client-python/streampipes_client/endpoint/endpoint.py
@@ -19,12 +19,11 @@ import logging
from abc import ABC, abstractmethod
from typing import Tuple, Type, Callable
-import requests
from requests import Response
from requests.exceptions import HTTPError
-from streampipesclient.model.container import ModelContainer
-from streampipesclient.model.element import Element
+from streampipes_client.model.container import ModelContainer
+from streampipes_client.model.element import Element
logger = logging.getLogger(__name__)
diff --git a/streampipes-client-python/streampipesclient/model/common.py b/streampipes-client-python/streampipes_client/model/common.py
similarity index 100%
rename from streampipes-client-python/streampipesclient/model/common.py
rename to streampipes-client-python/streampipes_client/model/common.py
diff --git a/streampipes-client-python/streampipesclient/model/container/__init__.py b/streampipes-client-python/streampipes_client/model/container/__init__.py
similarity index 100%
rename from streampipes-client-python/streampipesclient/model/container/__init__.py
rename to streampipes-client-python/streampipes_client/model/container/__init__.py
diff --git a/streampipes-client-python/streampipesclient/model/container/data_lake_measures.py b/streampipes-client-python/streampipes_client/model/container/data_lake_measures.py
similarity index 54%
rename from streampipes-client-python/streampipesclient/model/container/data_lake_measures.py
rename to streampipes-client-python/streampipes_client/model/container/data_lake_measures.py
index 11005510a..758a57a8b 100644
--- a/streampipes-client-python/streampipesclient/model/container/data_lake_measures.py
+++ b/streampipes-client-python/streampipes_client/model/container/data_lake_measures.py
@@ -1,7 +1,7 @@
import pandas as pd
-from streampipesclient.model.container import ModelContainer
-from streampipesclient.model.element.data_lake_measure import DataLakeMeasure
+from streampipes_client.model.container import ModelContainer
+from streampipes_client.model.element.data_lake_measure import DataLakeMeasure
class DataLakeMeasures(ModelContainer):
diff --git a/streampipes-client-python/streampipesclient/model/container/model_container.py b/streampipes-client-python/streampipes_client/model/container/model_container.py
similarity index 93%
rename from streampipes-client-python/streampipesclient/model/container/model_container.py
rename to streampipes-client-python/streampipes_client/model/container/model_container.py
index 666f06ac9..072e590ff 100644
--- a/streampipes-client-python/streampipesclient/model/container/model_container.py
+++ b/streampipes-client-python/streampipes_client/model/container/model_container.py
@@ -23,8 +23,8 @@ from typing import List, Type
from pydantic import ValidationError
-from streampipesclient.model.common import StreamPipesDataModelError
-from streampipesclient.model.element import Element
+from streampipes_client.model.common import StreamPipesDataModelError
+from streampipes_client.model.element import Element
class ModelContainer(ABC):
diff --git a/streampipes-client-python/streampipesclient/model/element/__init__.py b/streampipes-client-python/streampipes_client/model/element/__init__.py
similarity index 100%
rename from streampipes-client-python/streampipesclient/model/element/__init__.py
rename to streampipes-client-python/streampipes_client/model/element/__init__.py
diff --git a/streampipes-client-python/streampipesclient/model/element/data_lake_measure.py b/streampipes-client-python/streampipes_client/model/element/data_lake_measure.py
similarity index 91%
rename from streampipes-client-python/streampipesclient/model/element/data_lake_measure.py
rename to streampipes-client-python/streampipes_client/model/element/data_lake_measure.py
index 7601bc115..444978d3e 100644
--- a/streampipes-client-python/streampipesclient/model/element/data_lake_measure.py
+++ b/streampipes-client-python/streampipes_client/model/element/data_lake_measure.py
@@ -18,8 +18,8 @@ from typing import Optional
from pydantic import StrictStr, StrictBool
-from streampipesclient.model.common import EventSchema
-from streampipesclient.model.element import Element
+from streampipes_client.model.common import EventSchema
+from streampipes_client.model.element import Element
class DataLakeMeasure(Element):
diff --git a/streampipes-client-python/streampipesclient/model/element/element.py b/streampipes-client-python/streampipes_client/model/element/element.py
similarity index 93%
rename from streampipes-client-python/streampipesclient/model/element/element.py
rename to streampipes-client-python/streampipes_client/model/element/element.py
index bff745778..d52f261f7 100644
--- a/streampipes-client-python/streampipesclient/model/element/element.py
+++ b/streampipes-client-python/streampipes_client/model/element/element.py
@@ -16,7 +16,7 @@
#
from abc import ABC
-from streampipesclient.model.common import BasicModel
+from streampipes_client.model.common import BasicModel
class Element(ABC, BasicModel):
diff --git a/streampipes-client-python/streampipesclient/__init__.py b/streampipes-client-python/streampipesclient/__init__.py
deleted file mode 100644
index 43a8ab2c8..000000000
--- a/streampipes-client-python/streampipesclient/__init__.py
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-
-from .client import StreamPipesClient
diff --git a/streampipes-client-python/streampipesclient/client/__init__.py b/streampipes-client-python/streampipesclient/client/__init__.py
deleted file mode 100644
index a323247a5..000000000
--- a/streampipes-client-python/streampipesclient/client/__init__.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-
-from .client import StreamPipesClient
-from .credentials import StreamPipesApiKeyCredentials
diff --git a/streampipes-client-python/streampipesclient/endpoints/data_lake_measure.py b/streampipes-client-python/streampipesclient/endpoints/data_lake_measure.py
deleted file mode 100644
index 09c5e7fab..000000000
--- a/streampipes-client-python/streampipesclient/endpoints/data_lake_measure.py
+++ /dev/null
@@ -1,18 +0,0 @@
-from typing import List
-
-from streampipesclient.endpoints.endpoint import APIEndpoint
-from streampipesclient.model.container import ModelContainer
-from streampipesclient.model.container.data_lake_measures import DataLakeMeasures
-from streampipesclient.model.element import Element
-from streampipesclient.model.element.data_lake_measure import DataLakeMeasure
-
-
-class DataLakeMeasureEndpoint(APIEndpoint):
-
- @classmethod
- def _container_cls(cls):
- return DataLakeMeasures
-
- @property
- def _relative_api_path(self):
- return "api", "v4", "datalake", "measurements"
diff --git a/streampipes-client-python/streampipesclient/model/__init__.py b/streampipes-client-python/streampipesclient/model/__init__.py
deleted file mode 100644
index ecb1860df..000000000
--- a/streampipes-client-python/streampipesclient/model/__init__.py
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
\ No newline at end of file
diff --git a/streampipes-client-python/tests/__init__.py b/streampipes-client-python/tests/__init__.py
new file mode 100644
index 000000000..e69de29bb