From e31e60ae220ea8140c060594a4c8ca559c8c505c Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 7 Apr 2021 09:15:19 +0200 Subject: [PATCH 1/7] [package] Add pyproject.toml This follows bob packages new standard --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9787c3b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" -- GitLab From f5aad5a5ea9025d04cffbf0c33f134f9b39cd06f Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 7 Apr 2021 13:45:23 +0200 Subject: [PATCH 2/7] [pre-commit] Update configuration files Pre-commit and isort --- .isort.cfg | 6 ++++++ .pre-commit-config.yaml | 15 +++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.isort.cfg b/.isort.cfg index 8d7af1d..91f3180 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,4 +1,10 @@ [settings] +multi_line_output=3 +include_trailing_comma=true +force_grid_wrap=0 +use_parentheses=true +ensure_newline_before_comments=true line_length=88 +force_single_line=true order_by_type=true lines_between_types=1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b8be7b7..255d304 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,17 +2,17 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/timothycrosley/isort - rev: 4.3.21-2 + rev: 5.0.5 hooks: - id: isort args: [-sl] - repo: https://github.com/psf/black - rev: stable + rev: 19.10b0 hooks: - id: black exclude: beat/backend/python/test/prefix/.*/syntax_error - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.0.0 + rev: v3.1.0 hooks: - id: check-ast exclude: beat/backend/python/test/prefix/.*/syntax_error @@ -23,12 +23,15 @@ repos: exclude: beat/backend/python/test/prefix/.*/syntax_error - id: check-added-large-files - id: check-docstring-first - - id: flake8 - exclude: beat/backend/python/test/prefix/.*/(.*crash|syntax_error) - id: check-yaml exclude: conda/meta.yaml + - repo: https://github.com/PyCQA/flake8/ + rev: 3.8.3 + hooks: + - id: flake8 + exclude: beat/backend/python/test/prefix/.*/(.*crash|syntax_error) - repo: https://github.com/PyCQA/bandit - rev: 'master' # Update me! + rev: 1.6.2 hooks: - id: bandit exclude: beat/backend/python/test/prefix/.*/syntax_error -- GitLab From dfc22b4992079c6b36b69c3495163495995be23d Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 7 Apr 2021 13:49:20 +0200 Subject: [PATCH 3/7] [dataformat] Fix docstrings --- beat/backend/python/dataformat.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/beat/backend/python/dataformat.py b/beat/backend/python/dataformat.py index 2d030fd..de44081 100644 --- a/beat/backend/python/dataformat.py +++ b/beat/backend/python/dataformat.py @@ -255,7 +255,9 @@ class DataFormat(object): @property def name(self): - """Name of this object, either from the filename or composed from the hierarchy it belongs.""" + """Name of this object, either from the filename or composed from the hierarchy + it belongs. + """ if self.parent and self._name is None: return self.parent[0].name + "." + self.parent[1] + "_type" else: @@ -353,7 +355,8 @@ class DataFormat(object): @property def description(self): - "Short description string, loaded from the JSON file if one was set""" + """Short description string, loaded from the JSON file if one was set""" + return self.data.get("#description", None) @description.setter -- GitLab From a149c4e6695704506c8a5a03fba117e3a39c0afc Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 7 Apr 2021 13:50:06 +0200 Subject: [PATCH 4/7] [algorithm] Fix docstrings --- beat/backend/python/algorithm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beat/backend/python/algorithm.py b/beat/backend/python/algorithm.py index ee6c448..883c7e7 100644 --- a/beat/backend/python/algorithm.py +++ b/beat/backend/python/algorithm.py @@ -785,7 +785,9 @@ class Algorithm(object): @property def uses(self): - "Mapping object defining the required library import name (keys) and the full-names (values)""" + """Mapping object defining the required library import name (keys) and the + full-names (values) + """ return self.data.get("uses") -- GitLab From 4f3bf291536f340c1ae20b2dc4b1b96c8da38277 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 7 Apr 2021 13:50:43 +0200 Subject: [PATCH 5/7] [test][prefix] Black for python fixes --- beat/backend/python/test/prefix/databases/syntax_error/1.py | 1 - 1 file changed, 1 deletion(-) diff --git a/beat/backend/python/test/prefix/databases/syntax_error/1.py b/beat/backend/python/test/prefix/databases/syntax_error/1.py index 9a616fa..22c785c 100755 --- a/beat/backend/python/test/prefix/databases/syntax_error/1.py +++ b/beat/backend/python/test/prefix/databases/syntax_error/1.py @@ -36,7 +36,6 @@ from beat.backend.python.database import View - class SyntaxError(View); # <-- syntax error! def get(self, output, index): -- GitLab From 9d210f4d897317609d49798ba431bdbb4cc845b8 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 7 Apr 2021 13:51:26 +0200 Subject: [PATCH 6/7] [doc][conf] Pre-commit cleanup --- doc/conf.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 23be1f6..b886e51 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -6,14 +6,15 @@ import time import pkg_resources -# For inter-documentation mapping: -from bob.extension.utils import link_documentation -from bob.extension.utils import load_requirements - # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. import sphinx_rtd_theme + +# For inter-documentation mapping: +from bob.extension.utils import link_documentation +from bob.extension.utils import load_requirements + # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. @@ -229,10 +230,10 @@ rst_epilog = """ autoclass_content = "class" autodoc_member_order = "bysource" autodoc_default_options = { - "members": True, - "undoc-members": True, - "show-inheritance": True, - } + "members": True, + "undoc-members": True, + "show-inheritance": True, +} if "BOB_DOCUMENTATION_SERVER" not in os.environ: # notice we need to overwrite this for BEAT projects - defaults from Bob are -- GitLab From d46e667628f00562b6a8b685a84198b0b9af11a6 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 7 Apr 2021 13:52:50 +0200 Subject: [PATCH 7/7] [global] Pre-commit cleanup --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 7228995..e18dfc8 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.7.13b0 \ No newline at end of file +1.7.13b0 -- GitLab