diff --git a/.gitignore b/.gitignore index c4cf926..c1a80f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] +/.venv +/.ruff_cache # Distribution / packaging .Python diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7c8d0c7..f685a09 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,21 +8,6 @@ exclude: | default_language_version: python: python3 repos: - - repo: https://github.com/myint/autoflake - rev: v1.6.1 - hooks: - - id: autoflake - args: - - --expand-star-imports - - --ignore-init-module-imports - - --in-place - - --remove-all-unused-imports - - --remove-duplicate-keys - - --remove-unused-variables - - repo: https://github.com/psf/black - rev: 22.8.0 - hooks: - - id: black - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 hooks: @@ -37,19 +22,9 @@ repos: - id: check-merge-conflict - id: mixed-line-ending args: ["--fix=lf"] - - repo: https://github.com/asottile/pyupgrade - rev: v3.3.2 - hooks: - - id: pyupgrade - args: ["--keep-percent-format"] - - repo: https://github.com/PyCQA/isort - rev: 5.12.0 - hooks: - - id: isort - exclude: /__init__\.py$ - - repo: https://github.com/PyCQA/flake8 - rev: 3.9.2 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.3 hooks: - - id: flake8 - name: flake8 - additional_dependencies: ["flake8-bugbear==21.9.2"] + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + - id: ruff-format diff --git a/oca_port/__init__.py b/oca_port/__init__.py index d0f067c..58d8c9b 100644 --- a/oca_port/__init__.py +++ b/oca_port/__init__.py @@ -1 +1,3 @@ +__all__ = ["App"] + from .app import App diff --git a/oca_port/utils/__init__.py b/oca_port/utils/__init__.py index 98a0343..b827abb 100644 --- a/oca_port/utils/__init__.py +++ b/oca_port/utils/__init__.py @@ -1,5 +1,7 @@ +__all__ = ["cache", "git", "github", "misc", "storage"] + +from . import cache from . import git from . import github from . import misc from . import storage -from . import cache diff --git a/oca_port/utils/misc.py b/oca_port/utils/misc.py index 4ff4b67..395861f 100644 --- a/oca_port/utils/misc.py +++ b/oca_port/utils/misc.py @@ -70,7 +70,7 @@ class SmartDict(dict): def __getattr__(self, attrib): val = self.get(attrib) - return self.__class__(val) if type(val) is dict else val + return self.__class__(val) if isinstance(val, dict) else val REF_REGEX = r"((?P[\w-]+)/)?((?P[\w-]+)#)?(?P.*)" diff --git a/tests/common.py b/tests/common.py index 54a214f..1c9568b 100644 --- a/tests/common.py +++ b/tests/common.py @@ -10,7 +10,6 @@ class CommonCase(unittest.TestCase): - _settings = { "branch1": "15.0", "remote_branch1": "origin/15.0",