Bug 2148622

Summary: python-lsp-server: FTBFS in Fedora Rawhide (F38) and F37
Product: [Fedora] Fedora Reporter: Ben Beasley <code>
Component: python-lsp-serverAssignee: Ben Beasley <code>
Status: CLOSED ERRATA QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: nonamedotc
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://koschei.fedoraproject.org/package/python-lsp-server
Whiteboard:
Fixed In Version: python-lsp-server-1.4.1-5.fc38 python-lsp-server-1.4.1-5.fc37 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-30 03:34:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ben Beasley 2022-11-26 14:26:09 UTC
Description of problem:
Package python-lsp-server fails to build from source in Fedora Rawhide.

Version-Release number of selected component (if applicable):
1.4.1-3.fc37

Steps to Reproduce:
koji build --scratch f38 python-lsp-server-1.4.1-3.fc37.src.rpm

Additional info:
This package is tracked by Koschei. See:
https://koschei.fedoraproject.org/package/python-lsp-server

This also applies to F37.

> Error: 
>  Problem 1: nothing provides requested (python3dist(flake8) < 4.1~~ with python3dist(flake8) >= 4)
>  Problem 2: nothing provides requested (python3dist(mccabe) < 0.7~~ with python3dist(mccabe) >= 0.6)
>  Problem 3: nothing provides requested (python3dist(pycodestyle) < 2.9~~ with python3dist(pycodestyle) >= 2.8)
>  Problem 4: nothing provides requested (python3dist(pyflakes) < 2.5~~ with python3dist(pyflakes) >= 2.4)

The extras tightly bound the versions of a number of dependencies:

> all = 
>         autopep8>=1.6.0,<1.7.0
>         flake8>=4.0.0,<4.1.0
>         mccabe>=0.6.0,<0.7.0
>         pycodestyle>=2.8.0,<2.9.0
>         pydocstyle>=2.0.0
>         pyflakes>=2.4.0,<2.5.0
>         pylint>=2.5.0
>         rope>=0.10.5
>         yapf
> autopep8 = autopep8>=1.6.0,<1.7.0
> flake8 = flake8>=4.0.0,<4.1.0
> mccabe = mccabe>=0.6.0,<0.7.0
> pycodestyle = pycodestyle>=2.8.0,<2.9.0
> pydocstyle = pydocstyle>=2.0.0
> pyflakes = pyflakes>=2.4.0,<2.5.0
> pylint = pylint>=2.5.0
> rope = rope>0.10.5
> yapf = yapf
> test = 
>         pylint>=2.5.0
>         pytest
>         pytest-cov
>         coverage
>         numpy
>         pandas
>         matplotlib
>         pyqt5
>         flaky

These appear to be “preemptive” SemVer version pins rather than ones reflecting actual incompatibilities. For RPM packaging, I would suggest removing the upper bounds on these dependency versions, as breakage is much more likely to arise from these bounds than from any actual incompatibility.

(Ideally packagers should be checking for bounds like this in dependent packages before building an update, but that doesn’t always happen.)

Comment 1 Ben Cotton 2023-02-07 14:59:55 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 2 Fedora Admin user for bugzilla script actions 2023-08-16 12:55:25 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 3 Fedora Admin user for bugzilla script actions 2023-08-28 00:55:04 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 4 Ben Beasley 2023-09-21 11:15:01 UTC
I am loosening these bounds in F38 and F37 to fix the FTBFS.

In F37, I am also skipping the following test failure without trying to understand it. It’s too close to F37 EOL for me to spend time on it.

=================================== FAILURES ===================================
____________________________ test_numpy_completions ____________________________

config = <pylsp.config.config.Config object at 0x7f9fff252610>
workspace = <pylsp.workspace.Workspace object at 0x7fa006d05710>

    def test_numpy_completions(config, workspace):
        doc_numpy = "import numpy as np; np."
        com_position = {'line': 0, 'character': len(doc_numpy)}
        doc = Document(DOC_URI, workspace, doc_numpy)
>       items = pylsp_jedi_completions(config, doc, com_position)

test/plugins/test_completion.py:283:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pylsp/plugins/jedi_completion.py:47: in pylsp_completions
    completions = document.jedi_script(use_document_path=True).complete(**code_position)
/usr/lib/python3.11/site-packages/jedi/api/helpers.py:487: in wrapper
    return func(self, line, column, *args, **kwargs)
/usr/lib/python3.11/site-packages/jedi/api/__init__.py:214: in complete
    return completion.complete()
/usr/lib/python3.11/site-packages/jedi/api/completion.py:170: in complete  
    cached_name, completion_names = self._complete_python(leaf)
/usr/lib/python3.11/site-packages/jedi/api/completion.py:284: in _complete_python
    cached_name, n = self._complete_trailer(dot.get_previous_leaf())
/usr/lib/python3.11/site-packages/jedi/api/completion.py:399: in _complete_trailer
    return cached_name, self._complete_trailer_for_values(values)
/usr/lib/python3.11/site-packages/jedi/api/completion.py:404: in _complete_trailer_for_values
    return complete_trailer(user_context, values)
/usr/lib/python3.11/site-packages/jedi/api/completion.py:550: in complete_trailer
    completion_names += filter.values()
/usr/lib/python3.11/site-packages/jedi/inference/filters.py:117: in values 
    return self._convert_names(
/usr/lib/python3.11/site-packages/jedi/inference/filters.py:114: in _convert_names
    return [self.name_class(self.parent_context, name) for name in names]  
/usr/lib/python3.11/site-packages/jedi/inference/filters.py:114: in <listcomp>
    return [self.name_class(self.parent_context, name) for name in names]  
/usr/lib/python3.11/site-packages/jedi/inference/filters.py:120: in <genexpr>
    for name in self._filter(
/usr/lib/python3.11/site-packages/jedi/inference/filters.py:144: in _filter
    names = [n for n in names if self._is_name_reachable(n)]
/usr/lib/python3.11/site-packages/jedi/inference/filters.py:144: in <listcomp>
    names = [n for n in names if self._is_name_reachable(n)]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <StubFilter: StubModuleContext(<StubModuleValue: numpy@1-4411 is_stub=True>)>
name = <Name: NDArray@4410,50>

    def _is_name_reachable(self, name):
        if not super()._is_name_reachable(name):
            return False

        # Imports in stub files are only public if they have an "as"
        # export.
        definition = name.get_definition()
>       if definition.type in ('import_from', 'import_name'):
E       AttributeError: 'NoneType' object has no attribute 'type'

/usr/lib/python3.11/site-packages/jedi/inference/gradual/stub_value.py:89: AttributeError

Comment 5 Fedora Update System 2023-09-21 11:30:59 UTC
FEDORA-2023-a796c5bab7 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-a796c5bab7

Comment 6 Fedora Update System 2023-09-21 11:47:12 UTC
FEDORA-2023-5239346231 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-5239346231

Comment 7 Fedora Update System 2023-09-22 02:03:54 UTC
FEDORA-2023-5239346231 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-5239346231`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-5239346231

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2023-09-22 02:30:07 UTC
FEDORA-2023-a796c5bab7 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-a796c5bab7`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-a796c5bab7

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2023-09-30 03:34:23 UTC
FEDORA-2023-a796c5bab7 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2023-09-30 03:34:39 UTC
FEDORA-2023-5239346231 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.