Package Details: python-pylsp-mypy 0.6.9-1

Git Clone URL: https://aur.archlinux.org/python-lsp-mypy.git (read-only, click to copy)
Package Base: python-lsp-mypy
Description: Static type checking for python-lsp-server with mypy
Upstream URL: https://github.com/python-lsp/pylsp-mypy
Licenses: MIT
Conflicts: python-lsp-mypy
Provides: python-lsp-mypy
Replaces: python-lsp-mypy
Submitter: wuestengecko
Maintainer: wuestengecko
Last Packager: wuestengecko
Votes: 7
Popularity: 0.001905
First Submitted: 2021-08-19 13:12 (UTC)
Last Updated: 2024-09-03 17:23 (UTC)

Latest Comments

wuestengecko commented on 2023-12-08 15:49 (UTC)

Seems it's the same known issue with a user-wide .config/mypy/config file again, the unit tests don't really like that.

I've pushed an updated PKGBUILD that just ignores this failure.

emilylime commented on 2023-12-08 14:13 (UTC)

The package fails to build with this output: https://pastebin.com/mXTFPuuY (specifically, tests are failing)

wuestengecko commented on 2023-04-05 12:56 (UTC)

This is weird. I've also seen this error when installing another package (python-sexpdata). But is solved by pip install "fastjsonschema>=2.16.2".

This could actually exactly be caused by the pip install – I presume that at some point you pip install-ed something which pulled in fastjsonschema with the then-current version, but that's outside of pacman's control and so cannot be updated by it. When pacman later installed python-fastjsonschema-2.16.3 system-wide, it was "hidden" by your earlier, user-specific pip install. Take a look at your ~/.local/lib/python3.10, you probably have quite a few packages installed there by now. (This is a similar reason to why "sudo pip install" without a virtualenv warns you, but there's no such warning without sudo.)

Then it fails during building stage

That's an issue with the unit test. I've reported it upstream: https://github.com/python-lsp/pylsp-mypy/issues/59

For the time being, you can ignore the error with makepkg --nocheck.

doct0rhu commented on 2023-04-04 02:34 (UTC) (edited on 2023-04-04 02:47 (UTC) by doct0rhu)

See the following error

ERROR Missing dependencies:
    setuptools>=40.8.0
    validate-pyproject -> fastjsonschema<=3,>=2.16.2
==> ERROR: A failure occurred in build().
    Aborting...
error: failed to build 'python-lsp-mypy-0.6.6-1 (python-pylsp-mypy)':
error: packages failed to build: python-lsp-mypy-0.6.6-1 (python-pylsp-mypy)

This is weird. I've also seen this error when installing another package (python-sexpdata). But is solved by pip install "fastjsonschema>=2.16.2".


Then it fails during building stage:

==> 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/_version.py -> build/lib/pylsp_mypy
copying pylsp_mypy/__init__.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/_version.py -> 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/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.6-py3.10.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/pylsp_mypy-0.6.6.dist-info/WHEEL
creating '/home/lucius/.cache/paru/clone/python-lsp-mypy/src/pylsp-mypy-0.6.6/dist/.tmp-taqqore8/pylsp_mypy-0.6.6-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.6.dist-info/LICENSE'
adding 'pylsp_mypy-0.6.6.dist-info/METADATA'
adding 'pylsp_mypy-0.6.6.dist-info/WHEEL'
adding 'pylsp_mypy-0.6.6.dist-info/entry_points.txt'
adding 'pylsp_mypy-0.6.6.dist-info/top_level.txt'
adding 'pylsp_mypy-0.6.6.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Successfully built pylsp_mypy-0.6.6-py3-none-any.whl
==> Starting check()...
========================================================================== test session starts ==========================================================================
platform linux -- Python 3.10.10, pytest-7.2.2, pluggy-1.0.0
rootdir: /home/lucius/.cache/paru/clone/python-lsp-mypy/src/pylsp-mypy-0.6.6
plugins: anyio-3.6.2, flake8-1.1.1
collected 14 items

test/test_plugin.py ..........F...                                                                                                                                [100%]

=============================================================================== FAILURES ================================================================================
______________________________________________________________________ test_option_overrides_dmypy ______________________________________________________________________

last_diagnostics_monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f9bec25a9b0>, workspace = <pylsp.workspace.Workspace object at 0x7f9becbe3b20>

    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-column-numbers",
            document.path,
        ]
>       m.assert_called_with(expected, capture_output=True, **windows_flag, encoding="utf-8")

test/test_plugin.py:232:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Mock id='140307658635440'>, 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-column-numbers...us/.cache/paru/clone/python-lsp-mypy/src/pylsp-mypy-0.6.6/test/test_plugin.py'], capture_output=True, encoding='utf-8')
actual = call(['dmypy', '--status-file', '.dmypy.json', 'run', '--', '--python-executable', '/tmp/fake', '--show-column-numbers...us/.cache/paru/clone/python-lsp-mypy/src/pylsp-mypy-0.6.6/test/test_plugin.py'], capture_output=True, encoding='utf-8')
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7f9bec1f2ef0>, 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-column-numbers', '//home/lucius/.cache/paru/clone/python-lsp-mypy/src/pylsp-mypy-0.6.6/test/test_plugin.py'], capture_output=True, encoding='utf-8')
E           Actual: mock(['dmypy', '--status-file', '.dmypy.json', 'run', '--', '--python-executable', '/tmp/fake', '--show-column-numbers', '--config-file', '/home/lucius/.config/mypy/config', '//home/lucius/.cache/paru/clone/python-lsp-mypy/src/pylsp-mypy-0.6.6/test/test_plugin.py'], capture_output=True, encoding='utf-8')

/usr/lib/python3.10/unittest/mock.py:929: AssertionError
=========================================================================== warnings summary ============================================================================
../../../../../../../../usr/lib/python3.10/site-packages/pkg_resources/__init__.py:121
  /usr/lib/python3.10/site-packages/pkg_resources/__init__.py:121: DeprecationWarning: pkg_resources is deprecated as an API
    warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)

../../../../../../../../usr/lib/python3.10/site-packages/pkg_resources/__init__.py:2870
  /usr/lib/python3.10/site-packages/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('mpl_toolkits')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

../../../../../../../../usr/lib/python3.10/site-packages/pkg_resources/__init__.py:2870
../../../../../../../../usr/lib/python3.10/site-packages/pkg_resources/__init__.py:2870
  /usr/lib/python3.10/site-packages/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('ruamel')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

../../../../../../../../usr/lib/python3.10/site-packages/pkg_resources/__init__.py:2870
../../../../../../../../usr/lib/python3.10/site-packages/pkg_resources/__init__.py:2870
../../../../../../../../usr/lib/python3.10/site-packages/pkg_resources/__init__.py:2870
../../../../../../../../usr/lib/python3.10/site-packages/pkg_resources/__init__.py:2870
  /usr/lib/python3.10/site-packages/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

test/test_plugin.py::test_settings
  /usr/lib/python3.10/site-packages/yapf/yapflib/errors.py:16: PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+
    from lib2to3.pgen2 import tokenize

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================================== short test summary info ========================================================================
FAILED test/test_plugin.py::test_option_overrides_dmypy - AssertionError: expected call not found.
=============================================================== 1 failed, 13 passed, 9 warnings in 54.48s ===============================================================
==> ERROR: A failure occurred in check().
    Aborting...
error: failed to build 'python-lsp-mypy-0.6.6-1 (python-pylsp-mypy)':
error: packages failed to build: python-lsp-mypy-0.6.6-1 (python-pylsp-mypy)

wuestengecko commented on 2022-04-22 14:24 (UTC)

The upstream URL seems to have changed to https://github.com/python-lsp/pylsp-mypy.

Thanks, changed it.

Also the package seems to be named pylsp-mypy not lsp-mypy.

You're right, it makes the most sense to just directly follow upstream with this.

rnestler commented on 2022-03-16 14:05 (UTC)

The upstream URL seems to have changed to https://github.com/python-lsp/pylsp-mypy.

Also the package seems to be named pylsp-mypy not lsp-mypy.