[MacPorts] #67055: python portgroup overwrites PYTHONPATH in test.env
MacPorts
noreply at macports.org
Tue Mar 14 23:44:39 UTC 2023
#67055: python portgroup overwrites PYTHONPATH in test.env
----------------------+------------------------
Reporter: dgilman | Owner: reneeotten
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: |
----------------------+------------------------
Comment (by reneeotten):
Replying to [comment:9 jmroot]:
> My suggested fix would be something like this:
> {{{#!diff
> --- a/_resources/port1.0/group/python-1.0.tcl
> +++ b/_resources/port1.0/group/python-1.0.tcl
> @@ -572,5 +572,8 @@ pre-livecheck {
>
> pre-test {
> # set PYTHONPATH
> - test.env-append PYTHONPATH=[join [glob -nocomplain
${worksrcpath}/build/lib*] :]
> + set libdirs [glob -nocomplain -directory ${worksrcpath}/build lib*]
> + if {$libdirs ne "" && [lsearch ${test.env} PYTHONPATH=*] == -1} {
> + test.env-append PYTHONPATH=[join $libdirs :]
> + }
> }
>
> }}}
thanks Josh for refreshing my memory on the order of which Portfiles are
executed - that does ring a bell now, but I clearly didn't get that in the
beginning... I appreciated your suggested fix as well, that makes total
sense the {{{lsearch}}} is indeed useful as well so that people can set
PYTHONPATH different than the "default" set by the python PG.
Since this is your change anyway do you just want to commit this directly?
--
Ticket URL: <https://trac.macports.org/ticket/67055#comment:10>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list