Bug 259426 - www/py-lektor: 3.2.2_1 fails to run: Requirement.parse('Jinja2<3.0,>=2.10.1'), {'Flask'})
Summary: www/py-lektor: 3.2.2_1 fails to run: Requirement.parse('Jinja2<3.0,>=2.10.1')...
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: Vinícius Zavam
Keywords: regression
Depends on:
Reported: 2021-10-25 01:56 UTC by p5B2E9A8F
Modified: 2021-11-15 20:30 UTC (History)
1 user (show)

See Also:
egypcio: maintainer-feedback+


Note You need to log in before you can comment on or make changes to this bug.
Description p5B2E9A8F 2021-10-25 01:56:00 UTC
> lektor quickstart
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 568, in _build_master
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 886, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (Jinja2 3.0.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('Jinja2<3.0,>=2.10.1'), {'Flask'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/lektor", line 33, in <module>
    sys.exit(load_entry_point('Lektor==3.2.2', 'console_scripts', 'lektor')())
  File "/usr/local/bin/lektor", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/local/lib/python3.8/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.8/site-packages/lektor/cli.py", line 9, in <module>
    import pkg_resources
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3243, in <module>
    def _initialize_master_working_set():
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 570, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 583, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (Jinja2 3.0.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('Jinja2<3.0,>=2.10.1'), {'Flask'})
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2021-10-25 22:46:42 UTC
Jinja2 port is at 3.0.1, www/py-lektor doesnt correctly match the version-spec declared by the package (Jinja2<3.0,>=2.10.1, missing <3.0)
Comment 2 Vinícius Zavam freebsd_committer 2021-11-15 20:15:38 UTC
we managed to fix it, by revisiting upstream's requirements properly. diff being applied in a few. thanks for reporting it -- luckly it wasn't failing for other use cases, like mine.

root@poudriere:~ # lektor --version
Lektor, version 3.2.2

root@poudriere:~ # pkg info -x lektor

root@poudriere:~ # cd `mktemp -d`
root@poudriere:/tmp/tmp.IvQ9OUEN # lektor quickstart
Lektor Quickstart

This wizard will generate a new basic project with some sensible defaults for
getting started quickly.  We just need to go through a few questions so that
the project is set up correctly for you.

Step 1:
| A project needs a name.  The name is primarily used for the admin UI and
| some other places to refer to your project to not get confused if multiple
| projects exist.  You can change this at any later point.
> Project Name: foo

Step 2:
| Your name.  This is used in a few places in the default template to refer to
| in the default copyright messages.
> Author Name [Charlie &]: bar

Step 3:
| This is the path where the project will be located.  You can move a project
| around later if you do not like the path.  If you provide a relative path it
| will be relative to the working directory.
> Project Path [/tmp/tmp.IvQ9OUEN/foo]:

Step 4:
| Do you want to generate a basic blog module?  If you enable this the models
| for a very basic blog will be generated.
> Add Basic Blog [Y/n]:

That's all. Create project? [Y/n]
root@poudriere:/tmp/tmp.IvQ9OUEN # ls -l foo/
total 23
drwxr-xr-x  3 root  wheel   3 Nov 15 18:44 assets
drwxr-xr-x  5 root  wheel   6 Nov 15 18:44 content
-rw-r--r--  1 root  wheel  21 Nov 15 18:44 foo.lektorproject
drwxr-xr-x  2 root  wheel   5 Nov 15 18:44 models
drwxr-xr-x  3 root  wheel   7 Nov 15 18:44 templates
Comment 3 commit-hook freebsd_committer 2021-11-15 20:27:58 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=576702c6a176c1603ef26a32a16cbb6357b5a14f

commit 576702c6a176c1603ef26a32a16cbb6357b5a14f
Author:     Vinícius Zavam <egypcio@FreeBSD.org>
AuthorDate: 2021-11-15 20:13:02 +0000
Commit:     Vinícius Zavam <egypcio@FreeBSD.org>
CommitDate: 2021-11-15 20:13:02 +0000

    www/py-lektor: fix "3.2.2_1 fails to run: Requirement.parse"

      * visit upstream again to sync depends;
        - github.com/lektor/lektor/blob/v3.2.2/setup.py
      * while here, properly sort out RUN_DEPENDS.

    Reported by:    p5B2E9A8F % t-online.de
    PR:             259426
    Sponsored by:   TorBSD Diversity Project (TDP)
    Sponsored by:   The Tor Project

 www/py-lektor/Makefile | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)