Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies and pre-commit hooks #1848

Merged
merged 8 commits into from Oct 21, 2023
Merged

Conversation

rytilahti
Copy link
Owner

@rytilahti rytilahti commented Oct 20, 2023

  • Disables doc8 due to myst_parser issues
  • Disables docformatter due too large diffs that make json payload examples unreadable

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/doc8/__main__.py", line 20, in <module>
    sys.exit(main.main())
             ^^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/doc8/main.py", line 534, in main
    result = doc8(args)
             ^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/doc8/main.py", line 409, in doc8
    error_counts = validate(args, files, result=result)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/doc8/main.py", line 271, in validate
    for line_num, code, message in c.report_iter(f):
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/doc8/checks.py", line 131, in report_iter
    for error in parsed_file.errors:
                 ^^^^^^^^^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/doc8/parser.py", line 46, in errors
    self._errors = rl.lint(self.contents, filepath=self.filename)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/restructuredtext_lint/lint.py", line 72, in lint
    reader.parser.parse(content, document)
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/docutils/parsers/rst/__init__.py", line 184, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/docutils/parsers/rst/states.py", line 169, in run
    results = StateMachineWS.run(self, input_lines, input_offset,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/docutils/statemachine.py", line 233, in run
    context, next_state, result = self.check_line(
                                  ^^^^^^^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/docutils/statemachine.py", line 445, in check_line
    return method(match, context, next_state)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/docutils/parsers/rst/states.py", line 2357, in explicit_markup
    self.explicit_list(blank_finish)
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/docutils/parsers/rst/states.py", line 2382, in explicit_list
    newline_offset, blank_finish = self.nested_list_parse(
                                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/docutils/parsers/rst/states.py", line 316, in nested_list_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/docutils/statemachine.py", line 233, in run
    context, next_state, result = self.check_line(
                                  ^^^^^^^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/docutils/statemachine.py", line 445, in check_line
    return method(match, context, next_state)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/docutils/parsers/rst/states.py", line 2660, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/docutils/parsers/rst/states.py", line 2367, in explicit_construct
    return method(self, expmatch)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/docutils/parsers/rst/states.py", line 2104, in directive
    return self.run_directive(
           ^^^^^^^^^^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/docutils/parsers/rst/states.py", line 2154, in run_directive
    result = directive_instance.run()
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/docutils/parsers/rst/directives/misc.py", line 193, in run
    parser.parse('\n'.join(include_lines), document)
  File "<precommit cache dir>/reponpelfppa/py_env-python3/lib/python3.11/site-packages/myst_parser/parsers/sphinx_.py", line 58, in parse
    config: MdParserConfig = document.settings.env.myst_config
                             ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Values' object has no attribute 'env'
Storing example responses in docstrings is dumb, but there is no nice way
to keep it on while avoiding formatting that makes them incomprehensible like:

-        """
-        Response of Yeelight Dual Control Module
-        {
-            'id': 1,
-            'result': [
-                {'did': 'switch_1_state', 'siid': 2, 'piid': 1, 'code': 0, 'value': False},
-                {'did': 'switch_1_default_state', 'siid': 2, 'piid': 2, 'code': 0, 'value': True},
-                {'did': 'switch_1_off_delay', 'siid': 2, 'piid': 3, 'code': 0, 'value': 300},
-                {'did': 'switch_2_state', 'siid': 3, 'piid': 1, 'code': 0, 'value': False},
-                {'did': 'switch_2_default_state', 'siid': 3, 'piid': 2, 'code': 0, 'value': False},
-                {'did': 'switch_2_off_delay', 'siid': 3, 'piid': 3, 'code': 0, 'value': 0},
-                {'did': 'interlock', 'siid': 4, 'piid': 1, 'code': 0, 'value': False},
-                {'did': 'flex_mode', 'siid': 4, 'piid': 2, 'code': 0, 'value': True},
-                {'did': 'rc_list', 'siid': 4, 'piid': 2, 'code': 0, 'value': '[{"mac":"9db0eb4124f8","evtid":4097,"pid":339,"beaconkey":"3691bc0679eef9596bb63abf"}]'},
-            ]
-        }
-        """
+        """Response of Yeelight Dual Control Module { 'id': 1, 'result': [ {'did':
+        'switch_1_state', 'siid': 2, 'piid': 1, 'code': 0, 'value': False}, {'did':
+        'switch_1_default_state', 'siid': 2, 'piid': 2, 'code': 0, 'value': True},
+        {'did': 'switch_1_off_delay', 'siid': 2, 'piid': 3, 'code': 0, 'value': 300},
+        {'did': 'switch_2_state', 'siid': 3, 'piid': 1, 'code': 0, 'value': False},
+        {'did': 'switch_2_default_state', 'siid': 3, 'piid': 2, 'code': 0, 'value':
+        False}, {'did': 'switch_2_off_delay', 'siid': 3, 'piid': 3, 'code': 0, 'value':
+        0}, {'did': 'interlock', 'siid': 4, 'piid': 1, 'code': 0, 'value': False},
+        {'did': 'flex_mode', 'siid': 4, 'piid': 2, 'code': 0, 'value': True}, {'did':
+        'rc_list', 'siid': 4, 'piid': 2, 'code': 0, 'value': '[{"mac":"9db0eb4124f8","ev
+        tid":4097,"pid":339,"beaconkey":"3691bc0679eef9596bb63abf"}]'}, ] }"""

Somewhat related to PyCQA/docformatter#144
@codecov
Copy link

codecov bot commented Oct 21, 2023

Codecov Report

Merging #1848 (500efa1) into master (72880ae) will increase coverage by 0.01%.
Report is 1 commits behind head on master.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #1848      +/-   ##
==========================================
+ Coverage   81.34%   81.35%   +0.01%     
==========================================
  Files         193      193              
  Lines       18555    18555              
  Branches     4023     4023              
==========================================
+ Hits        15094    15096       +2     
+ Misses       3186     3184       -2     
  Partials      275      275              
Files Coverage Δ
miio/integrations/lumi/gateway/gateway.py 43.87% <0.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rytilahti rytilahti changed the title Update dependencies Update dependencies and pre-commit hooks Oct 21, 2023
@rytilahti rytilahti merged commit fb8128f into master Oct 21, 2023
18 of 19 checks passed
@rytilahti rytilahti deleted the janitor/update_deps branch October 21, 2023 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant