Bug 272629 - irc/py-sopel: Fix: The 'maxminddb<3.0.0,>=2.3.0' distribution was not found and is required by geoip2
Summary: irc/py-sopel: Fix: The 'maxminddb<3.0.0,>=2.3.0' distribution was not found a...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Muhammad Moinur Rahman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-20 22:07 UTC by Jesús Daniel Colmenares Oviedo
Modified: 2023-11-20 13:28 UTC (History)
1 user (show)

See Also:


Attachments
sopel.patch (3.10 KB, patch)
2023-07-20 22:07 UTC, Jesús Daniel Colmenares Oviedo
DtxdF: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesús Daniel Colmenares Oviedo 2023-07-20 22:07:45 UTC
Created attachment 243512 [details]
sopel.patch

Today I installed sopel on a jail and the following error appears:

```
# sopel
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: (maxminddb 2.2.0 (/usr/local/lib/python3.9/site-packages), Requirement.parse('maxminddb<3.0.0,>=2.3.0'), {'geoip2'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/sopel", line 33, in <module>
    sys.exit(load_entry_point('sopel==7.1.9', 'console_scripts', 'sopel')())
  File "/usr/local/bin/sopel", 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 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  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/sopel/__init__.py", line 20, 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 'maxminddb<3.0.0,>=2.3.0' distribution was not found and is required by geoip2
```

I had a similar problem when porting sopel [1] which has been fixed, but it persists again with another dependency.

I have tried the current patch and it works fine, but I think it is a hack, any recommendations are welcome.

[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265807#c2
Comment 1 commit-hook freebsd_committer freebsd_triage 2023-11-20 13:27:36 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=24104f31e4d4d0ecadca630027d8fb28bef6ca6d

commit 24104f31e4d4d0ecadca630027d8fb28bef6ca6d
Author:     Jesús Daniel Colmenares Oviedo <DtxdF@disroot.org>
AuthorDate: 2023-11-20 13:23:58 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-11-20 13:26:49 +0000

    irc/py-sopel: Runtime fix

    Bump portrevision

    PR:             272629
    Approved by:    Submitter is maintainer

 irc/py-sopel/Makefile                            |  6 ++++
 irc/py-sopel/files/patch-requirements.txt (gone) | 37 ------------------------
 irc/py-sopel/files/sopel-config.py (new +x)      |  6 ++++
 irc/py-sopel/files/sopel-plugins.py (new +x)     |  6 ++++
 irc/py-sopel/files/sopel.py (new +x)             |  6 ++++
 5 files changed, 24 insertions(+), 37 deletions(-)