Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ==> Making package: python-lsp-mypy 0.6.8-1 (Fri 08 Dec 2023 15:58:37 IST)
- ==> Retrieving sources...
- -> Found pylsp-mypy-0.6.8.tar.gz
- ==> Validating source files with sha256sums...
- pylsp-mypy-0.6.8.tar.gz ... Passed
- ==> Making package: python-lsp-mypy 0.6.8-1 (Fri 08 Dec 2023 15:58:37 IST)
- ==> Checking runtime dependencies...
- ==> Checking buildtime dependencies...
- ==> Retrieving sources...
- -> Found pylsp-mypy-0.6.8.tar.gz
- ==> Validating source files with sha256sums...
- pylsp-mypy-0.6.8.tar.gz ... Passed
- ==> Removing existing $srcdir/ directory...
- ==> Extracting sources...
- -> Extracting pylsp-mypy-0.6.8.tar.gz with bsdtar
- ==> Sources are ready.
- python-lsp-mypy-0.6.8-1 (python-pylsp-mypy): parsing pkg list...
- ==> Making package: python-lsp-mypy 0.6.8-1 (Fri 08 Dec 2023 15:58:39 IST)
- ==> Checking runtime dependencies...
- ==> Checking buildtime dependencies...
- ==> WARNING: Using existing $srcdir/ tree
- ==> Removing existing $pkgdir/ directory...
- ==> Starting build()...
- * Getting build dependencies for wheel...
- running egg_info
- creating pylsp_mypy.egg-info
- writing pylsp_mypy.egg-info/PKG-INFO
- writing dependency_links to pylsp_mypy.egg-info/dependency_links.txt
- writing entry points to pylsp_mypy.egg-info/entry_points.txt
- writing requirements to pylsp_mypy.egg-info/requires.txt
- writing top-level names to pylsp_mypy.egg-info/top_level.txt
- writing manifest file 'pylsp_mypy.egg-info/SOURCES.txt'
- reading manifest file 'pylsp_mypy.egg-info/SOURCES.txt'
- reading manifest template 'MANIFEST.in'
- adding license file 'LICENSE'
- writing manifest file 'pylsp_mypy.egg-info/SOURCES.txt'
- * Building wheel...
- running bdist_wheel
- running build
- running build_py
- creating build
- creating build/lib
- creating build/lib/pylsp_mypy
- copying pylsp_mypy/__init__.py -> build/lib/pylsp_mypy
- copying pylsp_mypy/_version.py -> build/lib/pylsp_mypy
- copying pylsp_mypy/plugin.py -> build/lib/pylsp_mypy
- installing to build/bdist.linux-x86_64/wheel
- running install
- running install_lib
- creating build/bdist.linux-x86_64
- creating build/bdist.linux-x86_64/wheel
- creating build/bdist.linux-x86_64/wheel/pylsp_mypy
- copying build/lib/pylsp_mypy/__init__.py -> build/bdist.linux-x86_64/wheel/pylsp_mypy
- copying build/lib/pylsp_mypy/_version.py -> build/bdist.linux-x86_64/wheel/pylsp_mypy
- copying build/lib/pylsp_mypy/plugin.py -> build/bdist.linux-x86_64/wheel/pylsp_mypy
- running install_egg_info
- running egg_info
- writing pylsp_mypy.egg-info/PKG-INFO
- writing dependency_links to pylsp_mypy.egg-info/dependency_links.txt
- writing entry points to pylsp_mypy.egg-info/entry_points.txt
- writing requirements to pylsp_mypy.egg-info/requires.txt
- writing top-level names to pylsp_mypy.egg-info/top_level.txt
- reading manifest file 'pylsp_mypy.egg-info/SOURCES.txt'
- reading manifest template 'MANIFEST.in'
- adding license file 'LICENSE'
- writing manifest file 'pylsp_mypy.egg-info/SOURCES.txt'
- Copying pylsp_mypy.egg-info to build/bdist.linux-x86_64/wheel/pylsp_mypy-0.6.8-py3.11.egg-info
- running install_scripts
- creating build/bdist.linux-x86_64/wheel/pylsp_mypy-0.6.8.dist-info/WHEEL
- creating '/home/emilylime/.cache/paru/clone/python-lsp-mypy/src/pylsp-mypy-0.6.8/dist/.tmp-9z_9us2s/pylsp_mypy-0.6.8-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
- adding 'pylsp_mypy/__init__.py'
- adding 'pylsp_mypy/_version.py'
- adding 'pylsp_mypy/plugin.py'
- adding 'pylsp_mypy-0.6.8.dist-info/LICENSE'
- adding 'pylsp_mypy-0.6.8.dist-info/METADATA'
- adding 'pylsp_mypy-0.6.8.dist-info/WHEEL'
- adding 'pylsp_mypy-0.6.8.dist-info/entry_points.txt'
- adding 'pylsp_mypy-0.6.8.dist-info/top_level.txt'
- adding 'pylsp_mypy-0.6.8.dist-info/RECORD'
- removing build/bdist.linux-x86_64/wheel
- Successfully built pylsp_mypy-0.6.8-py3-none-any.whl
- ==> Starting check()...
- ===================================================== test session starts =====================================================
- platform linux -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0
- rootdir: /home/emilylime/.cache/paru/clone/python-lsp-mypy/src/pylsp-mypy-0.6.8
- collected 19 items
- test/test_plugin.py .F..F..F..........F [100%]
- ========================================================== FAILURES ===========================================================
- _________________________________________________________ test_plugin _________________________________________________________
- workspace = <pylsp.workspace.Workspace object at 0x7fc5c80b1a90>
- last_diagnostics_monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fc5c739f4d0>
- def test_plugin(workspace, last_diagnostics_monkeypatch):
- doc = Document(DOC_URI, workspace, DOC_TYPE_ERR)
- plugin.pylsp_settings(workspace._config)
- diags = plugin.pylsp_lint(workspace._config, workspace, doc, is_saved=False)
- assert len(diags) == 1
- diag = diags[0]
- > assert re.fullmatch(TYPE_ERR_MSG_REGEX, diag["message"])
- E assert None
- E + where None = <function fullmatch at 0x7fc5c8c1c040>('"Dict\\[(?:(?:<nothing>)|(?:Never)), (?:(?:<nothing>)|(?:Never))\\]" has no attribute "append"', '"dict[Never, Never]" has no attribute "append"')
- E + where <function fullmatch at 0x7fc5c8c1c040> = re.fullmatch
- test/test_plugin.py:75: AssertionError
- __________________________________________________ test_multiple_workspaces ___________________________________________________
- tmpdir = local('/tmp/pytest-of-emilylime/pytest-3/test_multiple_workspaces0')
- last_diagnostics_monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fc5c73f2d90>
- def test_multiple_workspaces(tmpdir, last_diagnostics_monkeypatch):
- DOC_SOURCE = """
- def foo():
- return
- unreachable = 1
- """
- DOC_ERR_MSG = "Statement is unreachable"
- # Initialize two workspace folders.
- folder1 = tmpdir.mkdir("folder1")
- folder2 = tmpdir.mkdir("folder2")
- # Create configuration file for workspace folder 1.
- mypy_config = folder1.join("mypy.ini")
- mypy_config.write("[mypy]\nwarn_unreachable = True\ncheck_untyped_defs = True")
- ws1 = Workspace(uris.from_fs_path(str(folder1)), Mock())
- ws1._config = Config(ws1.root_uri, {}, 0, {})
- ws2 = Workspace(uris.from_fs_path(str(folder2)), Mock())
- ws2._config = Config(ws2.root_uri, {}, 0, {})
- # Initialize settings for both folders.
- plugin.pylsp_settings(ws1._config)
- plugin.pylsp_settings(ws2._config)
- # Test document in workspace 1 (uses mypy.ini configuration).
- doc1 = Document(DOC_URI, ws1, DOC_SOURCE)
- diags = plugin.pylsp_lint(ws1._config, ws1, doc1, is_saved=False)
- assert len(diags) == 1
- diag = diags[0]
- assert diag["message"] == DOC_ERR_MSG
- assert diag["code"] == "unreachable"
- # Test document in workspace 2 (without mypy.ini configuration)
- doc2 = Document(DOC_URI, ws2, DOC_SOURCE)
- diags = plugin.pylsp_lint(ws2._config, ws2, doc2, is_saved=False)
- > assert len(diags) == 0
- E AssertionError: assert 2 == 0
- E + where 2 = len([{'code': 'no-untyped-def', 'message': 'Function is missing a return type annotation', 'range': {'end': {'character': ...rn a value', 'range': {'end': {'character': 19, 'line': 3}, 'start': {'character': 0, 'line': 1}}, 'severity': 3, ...}])
- test/test_plugin.py:140: AssertionError
- _________________________________________________ test_option_overrides_dmypy _________________________________________________
- last_diagnostics_monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fc5c6f10550>
- workspace = <pylsp.workspace.Workspace object at 0x7fc5c7396e10>
- def test_option_overrides_dmypy(last_diagnostics_monkeypatch, workspace):
- overrides = ["--python-executable", "/tmp/fake", True]
- last_diagnostics_monkeypatch.setattr(
- FakeConfig,
- "plugin_settings",
- lambda _, p: {
- "overrides": overrides,
- "dmypy": True,
- "live_mode": False,
- }
- if p == "pylsp_mypy"
- else {},
- )
- m = Mock(wraps=lambda a, **_: Mock(returncode=0, **{"stdout": ""}))
- last_diagnostics_monkeypatch.setattr(plugin.subprocess, "run", m)
- document = Document(DOC_URI, workspace, DOC_TYPE_ERR)
- config = FakeConfig(uris.to_fs_path(workspace.root_uri))
- plugin.pylsp_settings(config)
- plugin.pylsp_lint(
- config=config,
- workspace=workspace,
- document=document,
- is_saved=False,
- )
- expected = [
- "dmypy",
- "--status-file",
- ".dmypy.json",
- "run",
- "--",
- "--python-executable",
- "/tmp/fake",
- "--show-error-end",
- "--no-error-summary",
- document.path,
- ]
- > m.assert_called_with(expected, capture_output=True, **windows_flag, encoding="utf-8")
- test/test_plugin.py:234:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- self = <Mock id='140487441455760'>
- args = (['dmypy', '--status-file', '.dmypy.json', 'run', '--', '--python-executable', ...],)
- kwargs = {'capture_output': True, 'encoding': 'utf-8'}
- expected = call(['dmypy', '--status-file', '.dmypy.json', 'run', '--', '--python-executable', '/tmp/fake', '--show-error-end', '-...me/.cache/paru/clone/python-lsp-mypy/src/pylsp-mypy-0.6.8/test/test_plugin.py'], capture_output=True, encoding='utf-8')
- actual = call(['dmypy', '--status-file', '.dmypy.json', 'run', '--', '--python-executable', '/tmp/fake', '--show-error-end', '-...me/.cache/paru/clone/python-lsp-mypy/src/pylsp-mypy-0.6.8/test/test_plugin.py'], capture_output=True, encoding='utf-8')
- _error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7fc5c73d25c0>, cause = None
- def assert_called_with(self, /, *args, **kwargs):
- """assert that the last call was made with the specified arguments.
- Raises an AssertionError if the args and keyword args passed in are
- different to the last call to the mock."""
- if self.call_args is None:
- expected = self._format_mock_call_signature(args, kwargs)
- actual = 'not called.'
- error_message = ('expected call not found.\nExpected: %s\nActual: %s'
- % (expected, actual))
- raise AssertionError(error_message)
- def _error_message():
- msg = self._format_mock_failure_message(args, kwargs)
- return msg
- expected = self._call_matcher(_Call((args, kwargs), two=True))
- actual = self._call_matcher(self.call_args)
- if actual != expected:
- cause = expected if isinstance(expected, Exception) else None
- > raise AssertionError(_error_message()) from cause
- E AssertionError: expected call not found.
- E Expected: mock(['dmypy', '--status-file', '.dmypy.json', 'run', '--', '--python-executable', '/tmp/fake', '--show-error-end', '--no-error-summary', '//home/emilylime/.cache/paru/clone/python-lsp-mypy/src/pylsp-mypy-0.6.8/test/test_plugin.py'], capture_output=True, encoding='utf-8')
- E Actual: mock(['dmypy', '--status-file', '.dmypy.json', 'run', '--', '--python-executable', '/tmp/fake', '--show-error-end', '--no-error-summary', '--config-file', '/home/emilylime/.config/mypy/config', '//home/emilylime/.cache/paru/clone/python-lsp-mypy/src/pylsp-mypy-0.6.8/test/test_plugin.py'], capture_output=True, encoding='utf-8')
- /usr/lib/python3.11/unittest/mock.py:939: AssertionError
- _____________________________________________________ test_config_exclude _____________________________________________________
- tmpdir = local('/tmp/pytest-of-emilylime/pytest-3/test_config_exclude0')
- workspace = <pylsp.workspace.Workspace object at 0x7fc5c73bf390>
- def test_config_exclude(tmpdir, workspace):
- """When exclude is set in config then mypy should not run for that file."""
- doc = Document(DOC_URI, workspace, DOC_TYPE_ERR)
- plugin.pylsp_settings(workspace._config)
- workspace.update_config({"pylsp": {"plugins": {"pylsp_mypy": {}}}})
- diags = plugin.pylsp_lint(workspace._config, workspace, doc, is_saved=False)
- > assert re.search(TYPE_ERR_MSG_REGEX, diags[0]["message"])
- E assert None
- E + where None = <function search at 0x7fc5c8c1c220>('"Dict\\[(?:(?:<nothing>)|(?:Never)), (?:(?:<nothing>)|(?:Never))\\]" has no attribute "append"', '"dict[Never, Never]" has no attribute "append"')
- E + where <function search at 0x7fc5c8c1c220> = re.search
- test/test_plugin.py:374: AssertionError
- =================================================== short test summary info ===================================================
- FAILED test/test_plugin.py::test_plugin - assert None
- FAILED test/test_plugin.py::test_multiple_workspaces - AssertionError: assert 2 == 0
- FAILED test/test_plugin.py::test_option_overrides_dmypy - AssertionError: expected call not found.
- FAILED test/test_plugin.py::test_config_exclude - assert None
- ================================================ 4 failed, 15 passed in 20.51s ================================================
- ==> ERROR: A failure occurred in check().
- Aborting...
- error: failed to build 'python-lsp-mypy-0.6.8-1 (python-pylsp-mypy)':
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement