It seems that Dima Pasechnik's replies are not displaying here, so I will add them:
First message:
Hi,
pyo3 seems to be for calling Python from Rust. You need the opposite, Rust from Python, e.g. as described in https://bheisler.github.io/post/calling-rust-in-python/.
Making a PyPI (pip) package seems to be the most obvious option.
With the current (outdated, I think) policies it will not be possible to make such a package standard part of Sage (but I am gathering support for relaxing these policies - see the thread on standard pip packages - that's what would be needed).
HTH, Dima
Second message:
PS. I realised that pyo3 is an option too.
On Sat, 2024-06-01 at 10:02 -0700, Matthias Koeppe wrote:
> we will soon add support for installing Python packages from
> platform-dependent wheels. This is needed for updating some Jupyter
> components that have started to use Rust (https://github.com/crate-py/rpds,
> a dependency of jsonschema).
The jsonschema package was being replaced by fastjsonschema in its
consumers the last time we ran in to this problem.
Rust is not nearly as portable as C, and has an unstable ABI that makes
shipping compatible versions of packages from multiple sources nearly
impossible.
Likewise, we will soon add support for installing Python packages from platform-dependent wheels. This is needed for updating some Jupyter components that have started to use Rust (https://github.com/crate-py/rpds, a dependency of jsonschema).
There is no need to remove it - it suffices to convert it to a pip package. (yes, for this we need to allow standard pip packages - as I have been proposing).
Yes. I am all for removing "no internet connection" assumption in installing the sage distribution from source.
Unlikely that we would add a package to the Sage distribution that builds a Rust library from source.Not so long ago we added support for installing Python packages from platform-independent wheels. We did this to sidestep the concern of shipping more and more of Javascript (Node.js) infrastructure that is needed for building JupyterLab components.Likewise, we will soon add support for installing Python packages from platform-dependent wheels. This is needed for updating some Jupyter components that have started to use Rust (https://github.com/crate-py/rpds, a dependency of jsonschema).
On Monday, June 3, 2024 at 8:16:30 PM UTC+1 Matthias Koeppe wrote:Unlikely that we would add a package to the Sage distribution that builds a Rust library from source.Not so long ago we added support for installing Python packages from platform-independent wheels. We did this to sidestep the concern of shipping more and more of Javascript (Node.js) infrastructure that is needed for building JupyterLab components.Likewise, we will soon add support for installing Python packages from platform-dependent wheels. This is needed for updating some Jupyter components that have started to use Rust (https://github.com/crate-py/rpds, a dependency of jsonschema).
Could you be more specific on this, please? [...] Where would these wheels come from? From PyPI?
(In the Sage distribution, they won't be "pip" packages -- which are an underdeveloped mechanism in the build system of the Sage distribution -- but rather a variant of the existing "wheel" packages.)As the upstream developer, you would publish binary wheels to PyPI, likely in the same way as is done in https://github.com/crate-py/rpds/blob/main/.github/workflows/CI.yml
Is there any Python project which resorts to mirroring binary PyPI wheels?
So, why do we need to mirror PyPI ?
So, why do we need to mirror PyPI ?
So, why do we need to mirror PyPI ?I understand "mirroring PyPI" as what we do with "wheel" packages, that is, delivering the wheel (downloaded from PyPI) of the specified version in the sage tarball.
So, why do we need to mirror PyPI ?I understand "mirroring PyPI" as what we do with "wheel" packages, that is, delivering the wheel (downloaded from PyPI) of the specified version in the sage tarball.
This is Dima's response:
> [...] multi-Gigabyte territory.
We are discussing your (general) proposal to provide binary wheels for packages by mirroring PyPI.
That is where gigabytes come from.
E.g. the binary wheels for scipy (with one version of Python) add up to about 200Mb.
I explained to Kwankyu that I mean "mirroring" in the usual sense of this word, not the one he thought.
OK. Sage tarballs and the wheels are uploaded to our mirror sites. So wheel packages end up in the mirror sites. This is what you say "mirroring PyPI".You object to "mirroring PyPI", that is, wheel packages. For its replacement, you propose to fetch wheels directly from PyPI by switching to "pip" packages.For users installing sage from sage tarball, this (switching to "pip" packages) means (again) to assume internet connection at install time. Right?