osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PyPi twine check does not like my README.rst files anymore


I am update some PyPI projects and found that twine was refusing the upload.

I have been googling and reading the PyPI guides but did not find anthing
that helps me understand what is required.

What am I doing wrong?

Using the twine check command I get reports about the reasons.

All the code on https://github.com/barry-scott/namedstruct
where you can see the README.rst rendered in full.
Where as at https://pypi.org/project/namedstruct/
only the first line is rendered.

Checking distribution dist\namedstruct-1.2.1-py3-none-any.whl: warning: `long_description_content_type` missing.  defaulting to `text/x-rst`.
Passed
Checking distribution dist\namedstruct-1.2.1.tar.gz: warning: `long_description_content_type` missing.  defaulting to `text/x-rst`.
Failed
The project's long_description has invalid markup which will not be rendered on PyPI. The following syntax errors were detected:
line 1: Severe: Unexpected section title or transition.

The part of setup.py that does this is:

setup(
    name='namedstruct',

    version=open('version.txt').read().strip(),

    description='namedstruct encapsulates struct.unpack() with results accessed by name',
    long_description=long_description,
    long_description_content_type='text/x-rst',

    # The project's main homepage.
    url='https://github.com/barry-scott/namedstruct',

Where should I have added the content type?

The other reason is the show stopper.

It does not allow me to have sections in my README.rst.

The README.rst starts with:

Module namedstruct
------------------

namedstruct encapsulates struct.unpack() and struct.pack() with results accessed by name.

Classes
-------

  class namedstruct.namedstruct

If I remove the sections the README.rst shown only has the first line of the readme
twine allows be to upload but only the first line of the README is rendered.

Barry