diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2e87833..7c32b0b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,7 +11,7 @@ jobs: fetch-depth: 1024 - uses: actions/setup-python@v4 with: - python-version: 3.6 + python-version: 3.11 - name: pre-commit env: BASE_SHA: ${{ github.event.pull_request.base.sha}} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e7e4ad6..a19020b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,12 +2,12 @@ default_stages: [commit, push] fail_fast: false repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.4.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/myint/autoflake - rev: v1.4 + rev: v2.1.1 hooks: - id: autoflake args: @@ -16,27 +16,27 @@ repos: - --remove-all-unused-imports - --ignore-init-module-imports # TODO: remove this - repo: https://github.com/pycqa/isort - rev: 5.10.1 + rev: 5.12.0 hooks: - id: isort - repo: https://github.com/psf/black - rev: 22.8.0 + rev: 23.3.0 hooks: - id: black - language_version: python3.6 + language_version: python3.11 args: - - --target-version=py36 + - --target-version=py311 - --line-length=120 - --skip-string-normalization - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v2.5.1" + rev: v2.7.1 hooks: - id: prettier additional_dependencies: - - prettier@2.2.1 + - prettier@2.7.1 exclude: node_modules types_or: [javascript, ts] - repo: https://github.com/PyCQA/flake8 - rev: 4.0.1 + rev: 6.0.0 hooks: - id: flake8 diff --git a/data_spec_validator/decorator/decorators.py b/data_spec_validator/decorator/decorators.py index 2a89cf9..8f4a91a 100644 --- a/data_spec_validator/decorator/decorators.py +++ b/data_spec_validator/decorator/decorators.py @@ -58,7 +58,6 @@ def _is_view(obj): def _combine_named_params(data, **kwargs): def combine_params(_data, params): - raise_if(bool(set(_data.keys()) & set(params.keys())), RuntimeError('Data and URL named param have conflict')) if isinstance(_data, QueryDict): diff --git a/data_spec_validator/spec/features.py b/data_spec_validator/spec/features.py index aafd654..4f90402 100644 --- a/data_spec_validator/spec/features.py +++ b/data_spec_validator/spec/features.py @@ -34,7 +34,6 @@ def __repr__(self): def _process_class( cls: Type, strict: bool, any_keys_set: Union[Set[Tuple[str, ...]], None], err_mode: ErrorMode ) -> Type: - setattr(cls, _FEAT_PARAMS, _DSVFeatureParams(strict, any_keys_set, err_mode)) return cls diff --git a/setup.cfg b/setup.cfg index 5907007..93d43f6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,8 +1,11 @@ [flake8] extend-ignore= - E203, # See https://github.com/PyCQA/pycodestyle/issues/373 - E501, # style related, follow black - W503, # style related, follow black + # See https://github.com/PyCQA/pycodestyle/issues/373 + E203, + # style related, follow black + E501, + # style related, follow black + W503, max-line-length = 120 per-file-ignores = # imported but unused diff --git a/test/test_spec.py b/test/test_spec.py index f3e7cbc..726948d 100644 --- a/test/test_spec.py +++ b/test/test_spec.py @@ -1115,6 +1115,7 @@ def test_optional_conditional_existence_other_check_fail(self): dict(c=1) dict(d=1) """ + # ========================== class _CondExistOtherFailAOBOCOSpec: a = Checker([STR, COND_EXIST], optional=True, COND_EXIST=dict(WITHOUT=['c']))