--When I try to register my own library (mong) in pypi, the package description (README.md) ) Was angry with a format error
--long_description_content_type
is recognized as reStructuredText even though it is specified
--In setup.py
, use setuptools.setup
instead of distutils.core.setup
When I noticed, the solution was instant. I don't have much chance to create setup.py from scratch, so I will record it for future use. (I am another person after 3 days)
I've always been worried that the description of pypi in mong is broken. It wasn't recognized as Markdown, and I thought it was a typo even though I specified long_description_content_type =" text / markdown "
in the argument of setup ()
. Since a new name was added by the head family, we decided to upgrade and tackled this problem that had been postponed.
twine check
At first I was testing with test.pypi, but along the way I realized that I could use twine check
to verify it at hand. This speeds up the verification cycle.
The check result in twine is as follows, and it also appears if long_description_content_type
is not specified.
% twine check dist/mong-0.0.1.tar.gz
Checking dist/mong-0.0.1.tar.gz: FAILED
`long_description` has syntax errors in markup and would not be rendered on PyPI.
line 13: Warning: Inline literal start-string without end-string.
warning: `long_description_content_type` missing. defaulting to `text/x-rst`.
I checked the following items one by one. After all, it didn't matter at all, but I got a better understanding of PyPI
and packages. The description seems to have been generated by looking at mong-00.1 / PKG-INFO
.
--typo: Example of official Python documentation didn't work, so it looks different
-Format violation of other items: Even if the input items are minimized, it still occurs.
-[Updating setuptools version](https://medium.com/@chezou/1%E8%A1%8C%E4%BF%AE%E6%AD%A3%E3%81%A7%E6%96% B0% E3% 81% 97% E3% 81% 84pypi% E3% 81% A7markdown% E3% 81% AE% E3% 83% 89% E3% 82% AD% E3% 83% A5% E3% 83% A1% E3% 83% B3% E3% 83% 88% E3% 81% 8C% E4% BD% BF% E3% 81% 88% E3% 81% 9F-14e40d90ff3f): setuptools supports Markdown from v38.6.0 That said, I'm using 45.2.0
So, when I looked at the beginning of the code, I didn't use setuptools
in the first place. It's completely unexpected (even though it's my code) that I was using the old distutils
.
https://github.com/toshihikoyanase/mong/blob/v0.0.1/setup.py#L1
from distutils.core import setup
You should replace it with setuptools
.
https://github.com/toshihikoyanase/mong/blob/v0.0.2/setup.py#L1
from setuptools import setup
You can rest assured that the description will be rendered in Markdown. We have also released v0.0.2.
Recommended Posts