maturin: maturin build & upload fails due to "malformed summary"

Bug Description

I am currently facing an issue whereby after building the wheel distribution file, maturin upload fails with the following error,

πŸ’₯ maturin failed
  Caused by: πŸ’₯ Failed to upload "mydistribution-1.3.7b1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl" (19.6 MB)
  Caused by: Failed to upload the wheel with status 400: <html>
 <head>
  <title>400 'summary' has invalid data. See https://packaging.python.org/specifications/core-metadata for more information.</title>
 </head>
 <body>
  <h1>400 'summary' has invalid data. See https://packaging.python.org/specifications/core-metadata for more information.</h1>
  The server could not comply with the request since it is either malformed or otherwise incorrect.<br/><br/>
&#x27;summary&#x27; has invalid data. See https://packaging.python.org/specifications/core-metadata for more information.


 </body>
</html>

I am also building through docker run

After using unzip on the wheel file, I find that the outputted METADATA is using Metadata-Version 2.1, not too sure if this would be relevant.

Your maturin version (maturin --version)

1.4.0

Your Python version (python -V)

n/a

Your pip version (pip -V)

n/a

What bindings you’re using

pyo3

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren’t accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

  1. ./build.sh
ACTION=build
ARGS='--release --interpreter 3.12 --out ./dist --sdist'
RUST_LOG='maturin=debug'
docker run \
  -it \
  -v $HOME/.ssh/id_rsa:/root/.ssh/id_rsa \
  -v $HOME/.ssh/known_hosts:/root/.ssh/known_hosts \
  -v ./dist:/dist \
  -v $(pwd):/io \
  -e $RUST_LOG \
  -w /io/bindings/python \
  mydistribution/maturin:latest \
  $ACTION $ARGS

Output:

πŸ“¦ Including license file "/io/bindings/python/LICENSE"
🍹 Building a mixed python/rust project
πŸ”— Found pyo3 bindings
🐍 Found CPython 3.12
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
πŸ“¦ Built source distribution to /dist/mydistribution-1.3.7b1.tar.gz
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
   Compiling pyo3-build-config v0.18.3
   Compiling pyo3-ffi v0.18.3
   Compiling pyo3 v0.18.3
   Compiling pyo3-asyncio v0.18.0
   Compiling pyo3-log v0.8.4
   Compiling py-mydistribution v1.3.7-beta.1 (/io/bindings/python)
    Finished release [optimized] target(s) in 42.56s
πŸ–¨  Copied external shared libraries to package mydistribution.libs directory:
    /usr/lib64/libk5crypto.so.3.1
    /usr/lib64/libkrb5support.so.0.1
    /usr/lib64/libssl.so.1.0.2k
    /usr/lib64/libselinux.so.1
    /usr/lib64/libpcre.so.1.2.0
    /usr/lib64/libkrb5.so.3.3
    /usr/lib64/libcrypto.so.1.0.2k
    /usr/lib64/libcom_err.so.2.1
    /usr/lib64/libgssapi_krb5.so.2.2
    /usr/lib64/libkeyutils.so.1.5
πŸ“¦ Built wheel for CPython 3.12 to /dist/mydistribution-1.3.7b1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  1. maturin upload mydistribution-1.3.7b1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Output:
πŸ’₯ maturin failed
  Caused by: πŸ’₯ Failed to upload "mydistribution-1.3.7b1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl" (19.6 MB)
  Caused by: Failed to upload the wheel with status 400: <html>
 <head>
  <title>400 'summary' has invalid data. See https://packaging.python.org/specifications/core-metadata for more information.</title>
 </head>
 <body>
  <h1>400 'summary' has invalid data. See https://packaging.python.org/specifications/core-metadata for more information.</h1>
  The server could not comply with the request since it is either malformed or otherwise incorrect.<br/><br/>
&#x27;summary&#x27; has invalid data. See https://packaging.python.org/specifications/core-metadata for more information.


 </body>
</html>

About this issue

  • Original URL
  • State: closed
  • Created 3 months ago
  • Comments: 20 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I’ll push a new release after work.

For now, if anyone is blocked by this, switch to twine for upload.

I’m also running into this issue, but it seems to me that the correct key in pyproject.toml is in fact description, not summary: https://packaging.python.org/en/latest/specifications/pyproject-toml/#description It mentions that this should be exported as summary in the metadata of the wheel however.

Here is a log from such an upload https://github.com/pymc-devs/nutpie/actions/runs/8360753012/job/22888798313

And the corresponding pyproject file: https://github.com/pymc-devs/nutpie/blob/8fdb3b69a672a08cb1cf71d9bd6f2fc79b6d3cdd/pyproject.toml

@ion-elgreco Can you run twine check on that wheel file?