[Bug 295730] misc/py-smdebug-rulesconfig, devel/py-mutmut: resolve conflict on site-packages/tests

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 30 May 2026 20:30:32 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295730

            Bug ID: 295730
           Summary: misc/py-smdebug-rulesconfig, devel/py-mutmut: resolve
                    conflict on site-packages/tests
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: yuri@freebsd.org
          Reporter: milios@ccsys.com
             Flags: maintainer-feedback?(yuri@freebsd.org)
          Assignee: yuri@freebsd.org

i stumbled upon these two ports trying to claim ${PYTHON_SITELIBDIR}/tests with
these three files in conflict

/usr/local/lib/python3.12/site-packages/tests/__init__.py
/usr/local/lib/python3.12/site-packages/tests/__pycache__/__init__.cpython-312.opt-1.pyc
/usr/local/lib/python3.12/site-packages/tests/__pycache__/__init__.cpython-312.pyc

so at my sites i went with this (in both ports):

post-install:
    cd ${STAGEDIR}${PYTHON_SITELIBDIR} && ${MV} tests ${PORTNAME:S/-/_/g}/

pre-package:
    ${REINPLACE_CMD} -e 's|/tests/|/${PORTNAME:S/-/_/g}&|' ${TMPPLIST}

-but-
1. i dont know all the ramifications of that (i dont think ive ever pytested
from WRKDIR or PREFIX in my life so im not familiar with how its supposed to go
down, if at all post-install)
-and-
2. i couldnt figure out if theres a more appropriate target to use for that
first part (mv) so that the second part (sed) becomes unnecessary. will anyone
please point me to the mostly-done-with-install-but-prior-to-autoplist target?

btw: __init__.py is the same zero bytes but the 154-byte empty husk pyc files
produced differ by one or two bytes. embedded timestamp maybe?

on a side note: i vaguely recall years ago an idea was proposed that pkg should
compare, reference count and let packages "share" identical files at otherwise
would-be conflicting locations. did anything come of that? has it been working
this way right under my nose for years? so is there a knob by which we could be
compiling pyc files deterministically? just general curiosities (in this case
i'm guessing no one should be claiming such a generic spot as
${PYTHON_SITELIBDIR}/tests so this particular conflict a minor oversight to be
resolved simply rather than cleverly)

fyi: i just checked and see {121,35} other site-packages/*/test{s,} directories
here. after modifying the two subject ports no site-packages/tests dir remains.
meanwhile, misc/py-palettable is holding onto a few files in site-packages/test
but i've encountered no complaints so far on that one

-- 
You are receiving this mail because:
You are the assignee for the bug.