Opened 11 months ago

Closed 11 months ago

Last modified 10 months ago

#68878 closed defect (fixed)

py310-astropy is incompatible with py310-cython

Reported by: cquike Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: Schamschula (Marius Schamschula), stromnov (Andrey Stromnov)
Port: py310-astropy

Description (last modified by ryandesign (Ryan Carsten Schmidt))

I have tried to install py310-astropy in a system which already has py310-cython installed and I get the following error:

% sudo port  install py310-astropy
--->  Computing dependencies for py39-cython-devel
Error: Can't install py310-cython-devel because conflicting ports are active: py310-cython
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port py310-astropy failed

I don't now which are the policies for macports on this, but I guess that depending on a -devel package has the potential to break a number of installations. Would it be possible for astropy not to depend on such devel package?

Change History (9)

comment:1 Changed 11 months ago by cquike

Critically, py310-numpy depends on py310-cython, so this makes py310-astropy installation incompatible with py310-numpy installation. The same is true for py310-pandas, that also depends on py310-cython.

comment:2 Changed 11 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: Schamschula stromnov added
Description: modified (diff)
Port: py310-astropy added
Priority: HighNormal

comment:3 Changed 11 months ago by Schamschula (Marius Schamschula)

Unfortunately, py-cython and py-cython-devel install in the same place.

This situation will persist, until all packages are updated to use cython 3.0.x or higher.

My workaround is to disable py-cython or py-cython-devel when their other is needed for an install. E.g.

sudo port deactivate py-cython

sudo port activate py-cython-devel

or the reverse, and then continue installing.

comment:4 Changed 11 months ago by cquike

I think that the situation is a bit unfortunate since an installation from an empty macports yields an error:

Error: Failed to activate py310-cython: Image error: /opt/local/Library/Frameworks/Python.framework/Versions/3.10/bin/cygdb is being used by the active py310-cython-devel port.  Please deactivate this port first, or use 'port -f activate py310-cython' to force the activation.

This is because both py310-cython and py310-cython-devel are being installed: the first one is a dependency of numpy, which is a dependency of astropy and the second as a direct dependency of astropy.

If the workaround is added then indeed it works. However this is not evident from the failure and users will have to scratch their heads to solve the situation. Additionally, at least in our case, we include the installation of astropy as part of automatic CI procedures which are currently broken.

I don't know how macports handles this kind of transitions between major software versions, but I can imagine that a better mechanism can be devised to avoid breakage of package installations.

Would it be a sensible thing to create a py-astropy-devel port that depends on the new cython version? Other dependants of cython can follow a similar approach. Once there is enough confidence that the dependents are fine with the new version, then cython and all the dependant ports can move to the new version. That of course require some non-trivial coordination between ports, but the current status-quo is to have broken installations.

comment:5 Changed 11 months ago by jmroot (Joshua Root)

See also #68929.

comment:6 in reply to:  4 Changed 11 months ago by Schamschula (Marius Schamschula)

Would it be a sensible thing to create a py-astropy-devel port that depends on the new cython version? Other dependants of cython can follow a similar approach. Once there is enough confidence that the dependents are fine with the new version, then cython and all the dependant ports can move to the new version. That of course require some non-trivial coordination between ports, but the current status-quo is to have broken installations.

No. Upstream requires py-astropy to be built using cython 3.0.x, i.e. py-cython-devel. One could still build the previous version of py-astropy using py-cython.

comment:7 Changed 11 months ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

comment:8 Changed 10 months ago by cquike

Thank you very much for fixing this. Indeed, now astropy seems to install properly. I understand the transition to the new cython wasn't probably easy, so thanks again for the swift fix!

comment:9 Changed 10 months ago by Schamschula (Marius Schamschula)

@jmr has add the py-cython-cython-compat port to deal with packages that have not been updated to cython >= 3.0.0. Hence, we no longer have this issue.

Note: See TracTickets for help on using tickets.