Bug 268161 - textproc/py-python-lsp-server: devel/spyder 5.4.0 fails to start: pycodestyle<2.10.0,>=2.9.0
Summary: textproc/py-python-lsp-server: devel/spyder 5.4.0 fails to start: pycodestyle...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Rainer Hurling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-05 03:24 UTC by p5B2EA84B3
Modified: 2022-12-05 17:31 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (yuri)


Attachments
patch to make versions of dependants more tolerant (1.73 KB, patch)
2022-12-05 17:19 UTC, Rainer Hurling
rhurlin: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description p5B2EA84B3 2022-12-05 03:24:31 UTC
> spyder
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 581, in _build_master
    ws.require(__requires__)
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 909, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 800, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pycodestyle 2.10.0 (/usr/local/lib/python3.9/site-packages), Requirement.parse('pycodestyle<2.10.0,>=2.9.0'), {'python-lsp-server'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/spyder", line 33, in <module>
    sys.exit(load_entry_point('spyder==5.4.0', 'gui_scripts', 'spyder')())
  File "/usr/local/bin/spyder", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/local/lib/python3.9/importlib/metadata.py", line 86, in load
    module = import_module(match.group('module'))
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/local/lib/python3.9/site-packages/spyder/app/start.py", line 55, in <module>
    from spyder.utils.external import lockfile
  File "/usr/local/lib/python3.9/site-packages/spyder/utils/external/lockfile.py", line 31, in <module>
    from spyder.utils.programs import is_spyder_process
  File "/usr/local/lib/python3.9/site-packages/spyder/utils/programs.py", line 28, in <module>
    import pkg_resources
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3260, in <module>
    def _initialize_master_working_set():
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3234, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3272, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 596, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 795, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pycodestyle<2.10.0,>=2.9.0' distribution was not found and is required by python-lsp-server

----
Ports have py39-pycodestyle-2.10.0
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2022-12-05 03:55:13 UTC
This is due to the requirement in textproc/py-python-lsp-server (py39-python-lsp-server-1.6.0):

> $ grep 2.10.0 `pkg info -l py39-python-lsp-server`
> /usr/local/lib/python3.9/site-packages/python_lsp_server-1.6.0-py3.9.egg-info/requires.txt:pycodestyle<2.10.0,>=2.9.0
> /usr/local/lib/python3.9/site-packages/python_lsp_server-1.6.0-py3.9.egg-info/requires.txt:pycodestyle<2.10.0,>=2.9.0
Comment 2 Rainer Hurling freebsd_committer freebsd_triage 2022-12-05 17:19:05 UTC
Created attachment 238546 [details]
patch to make versions of dependants more tolerant

Thanks, Yuri, for the report.

The attached patch should relax the version restrictions. So far, I have not noticed any negative effects, even during operation.

I will commit the patch ASAP ;)
Comment 3 Rainer Hurling freebsd_committer freebsd_triage 2022-12-05 17:21:22 UTC
(In reply to Rainer Hurling from comment #2)
And thanks for the report to p5B2EA84B3@t-online.de, of course!
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-12-05 17:30:35 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2a929d082d18841fec71e5d5a9471bc563a2ae38

commit 2a929d082d18841fec71e5d5a9471bc563a2ae38
Author:     Rainer Hurling <rhurlin@FreeBSD.org>
AuthorDate: 2022-12-05 17:22:34 +0000
Commit:     Rainer Hurling <rhurlin@FreeBSD.org>
CommitDate: 2022-12-05 17:29:35 +0000

    textproc/py-python-lsp-server: Relax restrictions

    Lower restrictions for version numbers of dependents. Hopefully without
    restrictions, even during operation.

    PR:             268161
    Reported by:    p5B2EA84B3@t-online.de

 textproc/py-python-lsp-server/Makefile             |  1 +
 .../files/patch-pyproject.toml                     | 22 ++++++++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)
Comment 5 Rainer Hurling freebsd_committer freebsd_triage 2022-12-05 17:31:33 UTC
Committed, thanks again for the report!