I followed the Python packaging guide to upload my project to TestPyPI, but the README is missing images.

I read that relative paths to images don’t work because PyPI only has the scope of the README itself and (maybe) Sphinx directory? So the README on Codeberg looks normal, but on PyPI it’s missing the images.

What can I do so both Codeberg and PyPI can render images?

Ideally, I would like a solution that still allows rendering the images locally after downloading the source files (if that’s possible).

I thought of maintaining a clone of the README (something like README.pypi.md), but I don’t think that is a good idea. Any thoughts?

  • logging_strict@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    18 days ago

    There are tools to check README files. Which would give suggestions on what needs to be fixed.

    If you are using Sphinx anyway, would suggest going with a ReStructuredText rather than vanilla markdown.

    In your Sphinx docs, can mix rst and md but the index file must be index.rst, not index.md

    Then use this sphinx-external-toc-strict for structuring your Sphinx docs.

    restview for real time editing of restructuredtext file