Hi everyone,
Following a discussion yesterday at the coordination meeting related to compiled extensions (C, Cython, potentially rust in future) in the core astropy package, Clément and I both independently had an idea which I thought it would be good to discuss here, and which could lead to an APE if there is consensus.
In short: what if we moved all compiled extensions out of the core astropy package into a separate package or separate packages?
Let's not worry for now about whether this separate package would be one or multiple packages, or what it would be called. Let's also assume for now that this package was explicitly advertised as not having any API that should be used by users directly
Why would we want to do this? There are several reasons
Faster builds/testing
Every single time someone or CI builds astropy, we compile again and again and again the same extensions which don't change much. This is a huge waste of computational resources, as well as a waste of human time waiting for astropy to build.
If astropy had no compiled extensions, then installing a developer version of astropy would be extremely fast, and it would then be easier to be able to just quickly run tests directly with e.g.
pytest astropy/wcs/wcsapi
during development without having to make sure the extensions are built.
In addition, running tox would also be faster since we wouldn't need to worry about the build time.
Faster release process
If we did this, astropy would become a pure Python package. This means only having to build a single wheel and source distribution.
Easier for contributors
The average contributor, who does not need to mess with any of the compiled extensions, would not need to even need a compiler installed to contribute to astropy. Running tests and building the documentation would be faster as it would not require building all the extensions first.
Possibility of adopting rust for some extensions
There has been a desire by some to include rust extensions in astropy. However, it would be very difficult to do this with the core package as it is at the moment because we would then require any astronomer who wants to contribute to astropy to install rust. I think we can agree the bar to contributing is already high enough that we don't need this.
With compiled extensions in a separate package or packages, we could more easily adopt rust. The developers who would likely be dealing with the compiled extensions would be far fewer and it would be easier to require just them to install rust.
Prior experience
We've already done this partially before: pyerfa was split out and most people don't need to worry about compiling erfa again and again. I think we can now say in hindsight the transition to a separate pyerfa went very smoothly, and most users haven't noticed. This proposal would just be a generalization of what we did with pyerfa.
Anyway I'm curious to hear what people think! If there are no strong objections, then I think the next step would be an APE so we can actually start discussing the details.
Cheers,
Tom