[Python] How to set core metadata version when building Python package?

Discussão em 'Python' iniciado por Stack, Janeiro 17, 2025.

  1. Stack

    Stack Membro Participativo

    Main question

    I want to build a wheel using Metadata-Version: "2.1". I cannot figure out how to include that in the build configs. Any advice?

    Background

    I need to use a private artifact repository to host packages. I built an example package using the official tutorial and when I tried uploading it (using twine), I got:

    HTTPError: 400 Bad Request from <redacted>
    Bad Request - Metadata version '2.2' is unsupported. Supported versions are: 1.0,1.1,1.2,2.0,2.1.


    I cannot upgrade the artifact repository (not up for discussion), so I must build using an older version of "metadata". I've been through the documentation for python build and for hatch, and even gone through the hatch source code, but I have yet to identify how to provide the metadata version configuration value. How do I do this?

    I'm open to advice for alternatives, except for upgrading the artifact repository.

    Continue reading...

Compartilhe esta Página