mbox series

[bug#71914,00/10] gnu: Add python-nh3.

Message ID cover.1719992277.git.mcsinyx@disroot.org
Headers show
Series gnu: Add python-nh3. | expand

Message

ashish.is--- via Guix-patches" via July 3, 2024, 7:54 a.m. UTC
nh3 is a HTML sanitization library for Python,
generally a replacement for the now-deprecated bleach.

I use nh3 for a tool rendering mail threads into HTML,
but that's to be packaged later since I also want to upgrade
its other dependency, mistune.

Dependency tree among patches:
* Add Python nh3
  * Add Rust ammonia
    * Add Rust html5ever 0.27
      * Add Rust markup5ever 0.12
      * Update Rust typed-arena 2 to 2.0.2
  * Add Rust pyo3* 0.21 (also update pyo3* 0.20 to 0.20.3)

Nguyễn Gia Phong (10):
  gnu: rust-typed-arena-2: Update to 2.0.2.
  gnu: Add rust-markup5ever-0.12.
  gnu: Add rust-html5ever-0.27.
  gnu: Add rust-ammonia-4.
  gnu: Add rust-pyo3-build-config-0.21.
  gnu: Add rust-pyo3-ffi-0.21.
  gnu: Add rust-pyo3-macros-backend-0.21.
  gnu: Add rust-pyo3-macros-0.21.
  gnu: Add rust-pyo3-0.21.
  gnu: Add python-nh3.

 gnu/packages/crates-io.scm  | 240 ++++++++++++++++++++++++++++++------
 gnu/packages/crates-web.scm |  29 +++++
 gnu/packages/python-web.scm |  45 +++++++
 3 files changed, 277 insertions(+), 37 deletions(-)


base-commit: 4b3a553ca5ba5ac190739309eb5f7aa8170cf2a8

Comments

Efraim Flashner July 3, 2024, 9:07 a.m. UTC | #1
On Wed, Jul 03, 2024 at 04:54:58PM +0900, guix-patches--- via wrote:
> nh3 is a HTML sanitization library for Python,
> generally a replacement for the now-deprecated bleach.
> 
> I use nh3 for a tool rendering mail threads into HTML,
> but that's to be packaged later since I also want to upgrade
> its other dependency, mistune.
> 
> Dependency tree among patches:
> * Add Python nh3
>   * Add Rust ammonia
>     * Add Rust html5ever 0.27
>       * Add Rust markup5ever 0.12
>       * Update Rust typed-arena 2 to 2.0.2
>   * Add Rust pyo3* 0.21 (also update pyo3* 0.20 to 0.20.3)
> 
> Nguyễn Gia Phong (10):
>   gnu: rust-typed-arena-2: Update to 2.0.2.
>   gnu: Add rust-markup5ever-0.12.
>   gnu: Add rust-html5ever-0.27.
>   gnu: Add rust-ammonia-4.
>   gnu: Add rust-pyo3-build-config-0.21.
>   gnu: Add rust-pyo3-ffi-0.21.
>   gnu: Add rust-pyo3-macros-backend-0.21.
>   gnu: Add rust-pyo3-macros-0.21.
>   gnu: Add rust-pyo3-0.21.
>   gnu: Add python-nh3.
> 
>  gnu/packages/crates-io.scm  | 240 ++++++++++++++++++++++++++++++------
>  gnu/packages/crates-web.scm |  29 +++++
>  gnu/packages/python-web.scm |  45 +++++++
>  3 files changed, 277 insertions(+), 37 deletions(-)
> 
> 
> base-commit: 4b3a553ca5ba5ac190739309eb5f7aa8170cf2a8

Since it wasn't only new packages I applied this to the rust-team
branch, which should be merged soon-ish.

There were a couple of missing bits, which I found while building all
the packages affected:
rust-pyo3-macros-0.21, rust-pyo3-macros-0.20:
Needs python-minimal as a native-input
rust-pyo3-macros-backend-0.21, rust-pyo3-macros-backend-0.20:
Needs rust-pyo3-build-config-0.2X as a cargo-input and python-minimal as
a native-input
rust-pyo3-0.21:
[cargo-inputs]: Added rust-chrono-tz-0.6, rust-portable-atomic-1.
[cargo-development-inputs]: Added rust-chrono-tz-0.6, rust-futures-0.3.
Removed rust-widestring-0.5.

I used the following command to build all the packages:
./pre-inst-env guix build --no-grafts --fallback --max-jobs=3 rust-typed-arena@2 rust-markup5ever@0.12 rust-html5ever@0.27 rust-ammonia@4 rust-pyo3{,-{build-config,ffi,macros-backend,macros}}@0.{20,21} python-nh3
ashish.is--- via Guix-patches" via July 3, 2024, 9:20 a.m. UTC | #2
On 2024-07-03 at 12:07+03:00, Efraim Flashner wrote:
> On Wed, Jul 03, 2024 at 04:54:58PM +0900, Nguyễn Gia Phong wrote:
> > Nguyễn Gia Phong (10):
> >   gnu: rust-typed-arena-2: Update to 2.0.2.
> >   gnu: Add rust-markup5ever-0.12.
> >   gnu: Add rust-html5ever-0.27.
> >   gnu: Add rust-ammonia-4.
> >   gnu: Add rust-pyo3-build-config-0.21.
> >   gnu: Add rust-pyo3-ffi-0.21.
> >   gnu: Add rust-pyo3-macros-backend-0.21.
> >   gnu: Add rust-pyo3-macros-0.21.
> >   gnu: Add rust-pyo3-0.21.
> >   gnu: Add python-nh3.
>
> Since it wasn't only new packages I applied this to the rust-team
> branch, which should be merged soon-ish.
>
> There were a couple of missing bits, which I found while building all
> the packages affected:
> rust-pyo3-macros-0.21, rust-pyo3-macros-0.20:
> Needs python-minimal as a native-input
> rust-pyo3-macros-backend-0.21, rust-pyo3-macros-backend-0.20:
> Needs rust-pyo3-build-config-0.2X as a cargo-input and python-minimal as
> a native-input
> rust-pyo3-0.21:
> [cargo-inputs]: Added rust-chrono-tz-0.6, rust-portable-atomic-1.
> [cargo-development-inputs]: Added rust-chrono-tz-0.6, rust-futures-0.3.
> Removed rust-widestring-0.5.
>
> I used the following command to build all the packages:
> ./pre-inst-env guix build --no-grafts --fallback --max-jobs=3 rust-typed-arena@2 rust-markup5ever@0.12 rust-html5ever@0.27 rust-ammonia@4 rust-pyo3{,-{build-config,ffi,macros-backend,macros}}@0.{20,21} python-nh3

Thank you very much!  So because Rust is statically compiled,
each package needs to be (built and) tested individually?
Efraim Flashner July 3, 2024, 9:24 a.m. UTC | #3
On Wed, Jul 03, 2024 at 06:20:03PM +0900, Nguyễn Gia Phong wrote:
> On 2024-07-03 at 12:07+03:00, Efraim Flashner wrote:
> > On Wed, Jul 03, 2024 at 04:54:58PM +0900, Nguyễn Gia Phong wrote:
> > > Nguyễn Gia Phong (10):
> > >   gnu: rust-typed-arena-2: Update to 2.0.2.
> > >   gnu: Add rust-markup5ever-0.12.
> > >   gnu: Add rust-html5ever-0.27.
> > >   gnu: Add rust-ammonia-4.
> > >   gnu: Add rust-pyo3-build-config-0.21.
> > >   gnu: Add rust-pyo3-ffi-0.21.
> > >   gnu: Add rust-pyo3-macros-backend-0.21.
> > >   gnu: Add rust-pyo3-macros-0.21.
> > >   gnu: Add rust-pyo3-0.21.
> > >   gnu: Add python-nh3.
> >
> > Since it wasn't only new packages I applied this to the rust-team
> > branch, which should be merged soon-ish.
> >
> > There were a couple of missing bits, which I found while building all
> > the packages affected:
> > rust-pyo3-macros-0.21, rust-pyo3-macros-0.20:
> > Needs python-minimal as a native-input
> > rust-pyo3-macros-backend-0.21, rust-pyo3-macros-backend-0.20:
> > Needs rust-pyo3-build-config-0.2X as a cargo-input and python-minimal as
> > a native-input
> > rust-pyo3-0.21:
> > [cargo-inputs]: Added rust-chrono-tz-0.6, rust-portable-atomic-1.
> > [cargo-development-inputs]: Added rust-chrono-tz-0.6, rust-futures-0.3.
> > Removed rust-widestring-0.5.
> >
> > I used the following command to build all the packages:
> > ./pre-inst-env guix build --no-grafts --fallback --max-jobs=3 rust-typed-arena@2 rust-markup5ever@0.12 rust-html5ever@0.27 rust-ammonia@4 rust-pyo3{,-{build-config,ffi,macros-backend,macros}}@0.{20,21} python-nh3
> 
> Thank you very much!  So because Rust is statically compiled,
> each package needs to be (built and) tested individually?

Yeah, its an unfortunate side effect of using the sources of the
packages instead of an output. There has been talk in the upstream rust
community about providing a stable-ish interface so that we can reuse
build artifacts from one build to another.
ashish.is--- via Guix-patches" via July 3, 2024, 9:44 a.m. UTC | #4
On 2024-07-03 at 12:24+03:00, Efraim Flashner wrote:
> On Wed, Jul 03, 2024 at 06:20:03PM +0900, Nguyễn Gia Phong wrote:
> > On 2024-07-03 at 12:07+03:00, Efraim Flashner wrote:
> > > There were a couple of missing bits, which I found
> > > while building all the packages affected:
> > > rust-pyo3-macros-0.21, rust-pyo3-macros-0.20:
> > > Needs python-minimal as a native-input [...]
> > >
> > > I used the following command to build all the packages:
> > > ./pre-inst-env guix build --no-grafts --fallback --max-jobs=3 rust-typed-arena@2 rust-markup5ever@0.12 rust-html5ever@0.27 rust-ammonia@4 rust-pyo3{,-{build-config,ffi,macros-backend,macros}}@0.{20,21} python-nh3
> > 
> > So because Rust is statically compiled,
> > each package needs to be (built and) tested individually?
>
> Yeah, its an unfortunate side effect of using the sources of the
> packages instead of an output. There has been talk in the upstream
> rust community about providing a stable-ish interface
> so that we can reuse build artifacts from one build to another.

Thank you, that's good to know.

On 2024-07-03 at 12:27+03:00, Efraim Flashner wrote:
> On Wed, Jul 03, 2024 at 06:12:51PM +0900, Nguyễn Gia Phong wrote:
> > what's the general etiquette for sending revisions
> > of a subset of the patch series?
>
> I don't think we have a consensus. On one hand re-sending unchanged
> patches is "wasteful", on the other hand it makes it easier to work
> on a set of patches (or a revision of patches) in one go.
>
> I think I normally end up with a single updated patch if there's
> a change to only one patch, but otherwise I normally send out
> a whole new set and then in 0000-v2 I mention what changes
> there are compared to the previous version.

Thanks, guess that'd be best for compatibility with everyone's tooling.