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 2023/08/07 17:20:36 UTC

[streampipes] 09/12: tmp

This is an automated email from the ASF dual-hosted git repository.

bossenti pushed a commit to branch exp/poetry
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit d6c4ec5b2b9a5ec1160d4a36006a56087e57939a
Author: bossenti <bo...@posteo.de>
AuthorDate: Thu Aug 3 18:33:09 2023 +0200

    tmp
    
    Signed-off-by: bossenti <bo...@posteo.de>
---
 streampipes-client-python/.pre-commit-config.yaml    |  4 ++--
 streampipes-client-python/Makefile                   |  6 +++---
 streampipes-client-python/pyproject.toml             | 20 ++++++++++++++++++++
 .../tests/client/test_client.py                      |  2 --
 .../tests/client/test_data_lake_series.py            |  1 -
 5 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/streampipes-client-python/.pre-commit-config.yaml b/streampipes-client-python/.pre-commit-config.yaml
index 2fad19e78..3c27eede8 100644
--- a/streampipes-client-python/.pre-commit-config.yaml
+++ b/streampipes-client-python/.pre-commit-config.yaml
@@ -40,7 +40,7 @@ repos:
         name: interrogate
         language: python
         types: [ python ]
-        entry:  interrogate -vv --fail-under 100 --omit-covered-files --ignore-init-method --ignore-module --ignore-magic --ignore-regex test_* --ignore-regex Test*
+        entry:  interrogate
 
       - id: pyupgrade
         name: pyupgrade
@@ -81,7 +81,7 @@ repos:
         name: mypy
         language: python
         types: [ python ]
-        entry: mypy --warn-unused-ignores --warn-redundant-casts --pretty
+        entry: mypy
         verbose: true
 
       - id: flake8
diff --git a/streampipes-client-python/Makefile b/streampipes-client-python/Makefile
index 6102d18f0..ea91c4cc5 100644
--- a/streampipes-client-python/Makefile
+++ b/streampipes-client-python/Makefile
@@ -17,7 +17,7 @@
 
 .PHONY: check
 check: mypy lint unit-tests
-	interrogate -vv --fail-under 100 --omit-covered-files --ignore-init-method --ignore-module --ignore-magic --ignore-regex test_* --ignore-regex Test* --generate-badge ./docs/img --badge-format svg --badge-style flat
+	interrogate -c pyproject.toml
 
 .PHONY: doc
 doc:
@@ -33,7 +33,7 @@ livedoc: doc
 
 .PHONY: mypy
 mypy:
-	mypy streampipes --warn-unused-ignores --warn-redundant-casts --pretty
+	mypy streampipes --config-file pyproject.toml
 
 .PHONY: rebase
 rebase:
@@ -43,7 +43,7 @@ rebase:
 reformat-all:
 	pyupgrade --py38 --keep-runtime-typing
 	autoflake -r --remove-all-unused-imports --expand-star-imports --in-place streampipes tests
-	isort --profile black streampipes tests
+	isort --settings-file pyproject.toml
 	black --line-length=120 streampipes tests
 
 .PHONY: pre-commit
diff --git a/streampipes-client-python/pyproject.toml b/streampipes-client-python/pyproject.toml
index 0862e2d50..49c9ca71c 100644
--- a/streampipes-client-python/pyproject.toml
+++ b/streampipes-client-python/pyproject.toml
@@ -93,6 +93,26 @@ twine = "4.0.2"
 name = "PyPI"
 priority = "primary"
 
+[tool.interrogate]
+ignore-init-method = true
+ignore-magic = true
+ignore-module = true
+fail-under = 100
+ignore-regex = ["test_*", "Test*", ".*BaseClass.*"]
+verbose = 2 # possible values: 0 (minimal output), 1 (-v), 2 (-vv)
+omit-covered-files = true
+generate-badge = "./streampipes-client-python/docs/img"
+badge-style = "flat"
+
+[tool.isort]
+profile = "black"
+src_paths = ["streampipes", "tests"]
+
+[tool.mypy]
+pretty = true
+warn_redundant_casts = true
+warn_unused_ignores = true
+
 [build-system]
 requires = ["poetry-core"]
 build-backend = "poetry.core.masonry.api"
diff --git a/streampipes-client-python/tests/client/test_client.py b/streampipes-client-python/tests/client/test_client.py
index 19a898833..a9c1ffc26 100644
--- a/streampipes-client-python/tests/client/test_client.py
+++ b/streampipes-client-python/tests/client/test_client.py
@@ -15,11 +15,9 @@
 # limitations under the License.
 #
 import json
-from collections import namedtuple
 from unittest import TestCase
 from unittest.mock import patch, MagicMock, call
 
-from requests import Response
 
 from streampipes.client import StreamPipesClient
 from streampipes.client.config import StreamPipesClientConfig
diff --git a/streampipes-client-python/tests/client/test_data_lake_series.py b/streampipes-client-python/tests/client/test_data_lake_series.py
index f6ebf41ee..fb16750f1 100644
--- a/streampipes-client-python/tests/client/test_data_lake_series.py
+++ b/streampipes-client-python/tests/client/test_data_lake_series.py
@@ -14,7 +14,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-import json
 from unittest import TestCase
 from unittest.mock import MagicMock, call, patch