[MacPorts] #44472: py27-pyphant-imageprocessing @1.0b3 replace py27-pil dependency by py27-Pillow
#44472: py27-pyphant-imageprocessing @1.0b3 replace py27-pil dependency by py27-Pillow ------------------------------+------------------------------------------ Reporter: alexander.held@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Keywords: | Port: py27-pyphant-imageprocessing ------------------------------+------------------------------------------ The path-based approach for removing the py27-pil dependency as suggested in #44285 is not working in a straight-forward way for py27-pyphant- imageprocessing, as PIL is also a dependency on the setuptools level. The runtime plugin mechanism for adding the py27-pyphant-imageprocessing toolbox to py-pyphant will fail when it cannot resolve this dependency as it is based on pkg_resources. The Pillow/PIL fallback mechanism would also have to be implemented on the setuptools level. A possible solution could be to completely remove the py27-pil dependency from py27-pyphant-imageprocessing, replacing it by py27-Pillow and patching the setup.py file to also refer to Pillow instead of PIL. -- Ticket URL: <https://trac.macports.org/ticket/44472> MacPorts <http://www.macports.org/> Ports system for OS X
#44472: py27-pyphant-imageprocessing @1.0b3 replace py27-pil dependency by py27-Pillow -------------------------------------------+--------------------- Reporter: alexander.held@… | Owner: rowue@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: py27-pyphant-imageprocessing | -------------------------------------------+--------------------- Changes (by rowue@…): * owner: macports-tickets@… => rowue@… -- Ticket URL: <https://trac.macports.org/ticket/44472#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#44472: py27-pyphant-imageprocessing @1.0b3 replace py27-pil dependency by py27-Pillow -------------------------------------------+--------------------- Reporter: alexander.held@… | Owner: rowue@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: py27-pyphant-imageprocessing | -------------------------------------------+--------------------- Comment (by rowue@…): One question: migth it be possible to simply work with patches. So if py*-Pillow is present, the config for setup-tools is set to py*-Pillow, otherwise py*-pil is used? -- Ticket URL: <https://trac.macports.org/ticket/44472#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#44472: py27-pyphant-imageprocessing @1.0b3 replace py27-pil dependency by py27-Pillow -------------------------------------------+--------------------- Reporter: alexander.held@… | Owner: rowue@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: py27-pyphant-imageprocessing | -------------------------------------------+--------------------- Comment (by alexander.held@…): Replying to [comment:2 rowue@…]:
One question: migth it be possible to simply work with patches. So if py*-Pillow is present, the config for setup-tools is set to py*-Pillow, otherwise py*-pil is used?
This should also be possible. I will try to prepare a fix for the Portfile using the path-based dependency and a conditional patch. -- Ticket URL: <https://trac.macports.org/ticket/44472#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#44472: py27-pyphant-imageprocessing @1.0b3 replace py27-pil dependency by py27-Pillow -------------------------------------------+--------------------- Reporter: alexander.held@… | Owner: rowue@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: py27-pyphant-imageprocessing | -------------------------------------------+--------------------- Comment (by ionic@…): Not sure... but it seems like that's possible. {{{ if {![catch [set Pillow_installed [lindex [registry_active py27-Pillow] 0]}] } { # patch for Pillow } # else { leave PIL or patch for PIL } }}} Should be doing that. post-patch sounds appropriate as a phase for this. -- Ticket URL: <https://trac.macports.org/ticket/44472#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#44472: py27-pyphant-imageprocessing @1.0b3 replace py27-pil dependency by py27-Pillow -------------------------------------------+--------------------- Reporter: alexander.held@… | Owner: rowue@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: py27-pyphant-imageprocessing | -------------------------------------------+--------------------- Comment (by alexander.held@…): Replying to [comment:4 ionic@…]:
Not sure... but it seems like that's possible.
{{{ if {![catch [set Pillow_installed [lindex [registry_active py27-Pillow] 0]}] } { # patch for Pillow } # else { leave PIL or patch for PIL } }}}
Should be doing that. post-patch sounds appropriate as a phase for this.
I experimented around a bit. My problem is that the patch phase is not run at all, when a pre-built version is fetched from the macports server. So conditional patching would also require to set the revision dynamically before the fetch phase but after it is clear, which dependency is actually used. I don't know, if this is possible. Alternatively, one could maybe patch the egg-info in a later phase and change the dependency in the `requires.txt` file instead of in the setup.py? -- Ticket URL: <https://trac.macports.org/ticket/44472#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#44472: py27-pyphant-imageprocessing @1.0b3 replace py27-pil dependency by py27-Pillow -------------------------------------------+--------------------- Reporter: alexander.held@… | Owner: rowue@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: py27-pyphant-imageprocessing | -------------------------------------------+--------------------- Comment (by mojca@…): Replying to [comment:5 alexander.held@…]:
I experimented around a bit. My problem is that the patch phase is not
run at all, when a pre-built version is fetched from the macports server. Which is why the port should use port variants (one variant for dependency on pil and the other variant for dependency on pillow). You cannot use path-based dependency for that, but it is straightforward to do. You can check whether `Pil` is activated and if so, use `+pil`. Else use `+pillow`. You then define the patching inside the variant. -- Ticket URL: <https://trac.macports.org/ticket/44472#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#44472: py27-pyphant-imageprocessing @1.0b3 replace py27-pil dependency by py27-Pillow -------------------------------------------+--------------------- Reporter: alexander.held@… | Owner: rowue@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: py27-pyphant-imageprocessing | -------------------------------------------+--------------------- Comment (by alexander.held@…): Replying to [comment:6 mojca@…]:
...
Which is why the port should use port variants (one variant for
dependency on pil and the other variant for dependency on pillow).
You cannot use path-based dependency for that, but it is straightforward
to do. You can check whether `Pil` is activated and if so, use `+pil`. Else use `+pillow`. You then define the patching inside the variant. This seems to be a cleaner solution. I'll try to go this way. -- Ticket URL: <https://trac.macports.org/ticket/44472#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#44472: py27-pyphant-imageprocessing @1.0b3 replace py27-pil dependency by py27-Pillow -------------------------------------------+--------------------- Reporter: alexander.held@… | Owner: rowue@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: py27-pyphant-imageprocessing | -------------------------------------------+--------------------- Comment (by alexander.held@…): A solution using only one fallback variant (pil) has been committed in r122800. The default dependency for the "blank" variant is now Pillow. If there is a good reason to have two variants, it should be straight-forward to alter r122800. -- Ticket URL: <https://trac.macports.org/ticket/44472#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#44472: py27-pyphant-imageprocessing @1.0b3 replace py27-pil dependency by py27-Pillow -------------------------------------------+--------------------- Reporter: alexander.held@… | Owner: rowue@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: py27-pyphant-imageprocessing | -------------------------------------------+--------------------- Comment (by ionic@…): I like it. :) -- Ticket URL: <https://trac.macports.org/ticket/44472#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
#44472: py27-pyphant-imageprocessing @1.0b3 replace py27-pil dependency by py27-Pillow -------------------------------------------+--------------------- Reporter: alexander.held@… | Owner: rowue@… Type: enhancement | Status: closed Priority: Normal | Milestone: Component: ports | Version: Resolution: fixed | Keywords: Port: py27-pyphant-imageprocessing | -------------------------------------------+--------------------- Changes (by mojca@…): * status: new => closed * version: 2.3.1 => * resolution: => fixed Comment: Thank you, I'm closing the ticket. I also deleted `files/pyphant` in r122814. It was a leftover from wxGTK and should no longer be needed. (I would merge these two patches into a single one which would only leave you with `patchfiles patch-pillow.diff`, but that's just cosmetics.) -- Ticket URL: <https://trac.macports.org/ticket/44472#comment:10> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts