Bug 263956 - textproc/py-mistune0: Add CONFLICTS with text/py-mistune
Summary: textproc/py-mistune0: Add CONFLICTS with text/py-mistune
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Po-Chuan Hsieh
URL:
Keywords: easy, needs-patch
Depends on:
Blocks: 267188
  Show dependency treegraph
 
Reported: 2022-05-13 18:22 UTC by John Hein
Modified: 2023-06-30 15:39 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2022-05-13 18:22:17 UTC
If both textproc/py-mistune0 and textproc/py-mistune are installed, the latter masks the former.  Doing 'import mistune' loads the newer mistune instead of mistune0.
Comment 1 John Hein 2022-05-13 21:43:11 UTC
The problem is that for textproc/mistune0, site-packages/mistune.py exists.

For textproc/mistune, it is site-packages/mistune/__init__.py (and other .py files in that mistune/subdir).

This is not a file conflict, but it is a sort of conflict when it comes to importing the module in python code.  When you do 'import mistune', python picks the second way (mistune/__init__.py) and ignores the existence of the mistune0 way (lone mistune.py file).

This would be a good candidate for a CONFLICTS_INSTALL marker perhaps.

To work around this issue, one could modify the mistune0 port to install mistune0.py and update all consumers in the ports tree to import mistune0.  This doesn't help consumers that are not in the ports tree that were dependent on the older mistune.  A note in UPDATING might be warranted to explain this.
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2022-05-16 23:13:50 UTC
(In reply to John Hein from comment #1)

Multiple versions of python packages installed at the same time is a broad and non freebsd specific  (python ecosystem) issue that we can currently only handled (scalably) by adding CONFLICTS. In fact, given that this is expected behaviour, we should probably handle it in some automated manner. Unfortauntely the current method of version suffixing separately named ports (with unique package names) is not trivially amenable to this.
Comment 3 p5B2EA84B3 2022-09-14 23:13:20 UTC
This problem needs to be worked on. Installation of www/lektor breaks jupiter notebook:

     File "/usr/local/lib/python3.9/site-packages/nbconvert/exporters/html.py", line 26, in <module>
        from nbconvert.filters.markdown_mistune import IPythonRenderer, MarkdownWithMath
      File "/usr/local/lib/python3.9/site-packages/nbconvert/filters/markdown_mistune.py", line 24, in <module>
        from mistune import BlockParser, HTMLRenderer, InlineParser, Markdown
    ImportError: cannot import name 'BlockParser' from 'mistune' (/usr/local/lib/python3.9/site-packages/mistune.py)
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-06-30 07:24:26 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=36a2aa69d4205e5a9f6fd2804e75399188a42cad

commit 36a2aa69d4205e5a9f6fd2804e75399188a42cad
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-06-30 07:08:24 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-06-30 07:08:24 +0000

    devel/py-mrkd: Allow build with py-mistune installed

    - Bump PORTREVISION for package change

    PR:             263956

 devel/py-mrkd/Makefile                  |  3 +--
 devel/py-mrkd/files/patch-mistune (new) | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 2 deletions(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-06-30 07:24:27 UTC
A commit in branch main references this bug:

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

commit 2ceae76cdadfe9823c92051904a6f9929a02181f
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-06-30 07:08:52 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-06-30 07:08:52 +0000

    textproc/lookatme: Allow build with py-mistune installed

    - Bump PORTREVISION for package change

    PR:             263956

 textproc/lookatme/Makefile                  |  1 +
 textproc/lookatme/files/patch-mistune (new) | 32 +++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
Comment 6 commit-hook freebsd_committer freebsd_triage 2023-06-30 07:24:29 UTC
A commit in branch main references this bug:

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

commit a5789ccf779d5adcb9e384f0c5e4712b6acc6d37
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-06-30 07:08:57 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-06-30 07:08:57 +0000

    textproc/py-m2r: Allow build with py-mistune installed

    - Bump PORTREVISION for package change

    PR:             263956

 textproc/py-m2r/Makefile                  |  1 +
 textproc/py-m2r/files/patch-mistune (new) | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
Comment 7 commit-hook freebsd_committer freebsd_triage 2023-06-30 07:24:30 UTC
A commit in branch main references this bug:

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

commit d208a99b094e8a040a533fdd38d649ab5e4d15c3
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-06-30 07:09:05 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-06-30 07:09:05 +0000

    www/py-lektor: Allow build with py-mistune installed

    - Bump PORTREVISION for package change

    PR:             263956

 www/py-lektor/Makefile                  |  1 +
 www/py-lektor/files/patch-mistune (new) | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-06-30 07:24:31 UTC
A commit in branch main references this bug:

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

commit e62ba962ba4d0186ab1dbdbef7863d9fab1dfd46
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-06-30 07:05:10 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-06-30 07:05:10 +0000

    textproc/py-mistune0: Avoid runtime conflict with py-mistune

    - Build and install mistune as mistune0
    - Bump PORTREVISION for package change

    PR:             263956

 textproc/py-mistune0/Makefile                   |  4 ++++
 textproc/py-mistune0/files/patch-setup.py (new) | 29 +++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
Comment 9 Po-Chuan Hsieh freebsd_committer freebsd_triage 2023-06-30 08:45:18 UTC
There are 5 consumers of py-mistune0 and 4 of them are fixed to use py-mistune0 correctly. math/sage was left untouched because of the following reasons:
- It is broken now.
- Its dependency list, including both py-mistune and py-mistune0, seems to be incorrect.

I believe the issue is fixed now.