Skip to content

'uv publish' for mixed python-rust code fails due to unsupported platform tag 'linux_x86_64' #9842

@giacomopiccinini

Description

@giacomopiccinini

Hi!

We are experiencing the following issue when building and publishing a mixed python-rust codebase to PyPi.

Prior to introducing the rust part, in the same project, we were able to successfully build and publish. No issues whatsoever.

Then, we introduced the rust part with the bindings via pyo3 and maturin. No problem at all with the build part. However, we can't get the code to be published on PyPi due to a "wrong" tag. This is the output we get

Successfully built dist/gemmoai-0.1.19.tar.gz
Successfully built dist/gemmoai-0.1.19-cp38-abi3-linux_x86_64.whl
Please enter your PyPI token:

Publishing package...
warning: `uv publish` is experimental and may change without warning
Publishing 2 files https://upload.pypi.org/legacy/
Uploading gemmoai-0.1.19-cp38-abi3-linux_x86_64.whl (2.5MiB)
error: Failed to publish `dist/gemmoai-0.1.19-cp38-abi3-linux_x86_64.whl` to https://upload.pypi.org/legacy/
  Caused by: Upload failed with status code 400 Bad Request. Server says: 400 Binary wheel 'gemmoai-0.1.19-cp38-abi3-linux_x86_64.whl' has an unsupported platform tag 'linux_x86_64'.

I suppose the issue is that PyPi requires some flavour of "manylinux" in the tag, but it's unclear where we should enforce this. Our current pyproject.toml reads

[project]
name = "gemmoai"
version = "0.1.19"
description = "GemmoAI Python Library"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
    "maturin>=1.7.6",
    "pymupdf>=1.24.14",
    "tomli>=2.2.1",
]

[tool.maturin]
python-packages = ["gemmoai"]
python-source = "src"
features = ["pyo3/extension-module"]
module-name = "gemmoai.rust" 

[build-system]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"

We have tried some solutions based on LLMs suggestion, e.g. adding

[tool.maturin]
manylinux = "manylinux2014"

or

[tool.maturin]
python-platform = "x8664-manylinux240"

or

[tool.uv.pip]
python-platform = "x8664-manylinux240"

The final tag never changes, and hence the upload fails. What is the right solution for this?

Many thanks in advance, and let us know if we can contribute in any way.

Details

uv 0.5.8
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.5 LTS
Release:	22.04
Codename:	jammy

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionAsking for clarification or support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions