devexp-db / distgen

Distribution oriented templating system
http://distgen.readthedocs.io/
GNU General Public License v2.0
18 stars 13 forks source link

Show long description in setup.py in readable format #136

Closed zmiklank closed 1 year ago

zmiklank commented 1 year ago

Seems like pypi description needs fix up: https://pypi.org/project/distgen/

This PR introduces readable form of README.md for a long_description field in setup.py.

zmiklank commented 1 year ago

@praiskup can I merge? As I am no python expert I rather ask, because they may exist better solution on how to write this.

praiskup commented 1 year ago

So far I haven't a chance to deal with similar problem IIRC, but I found https://packaging.python.org/en/latest/guides/making-a-pypi-friendly-readme/ What do you think about the suggestion:

from setuptools import setup

# read the contents of your README file
from pathlib import Path
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()

setup(
    name='an_example_package',
    # other arguments omitted
    long_description=long_description,
    long_description_content_type='text/markdown'
)
zmiklank commented 1 year ago

Thanks Pavel for looking into this. However, I see one possible issue with this approach. In current approach we remove the badges info from README, as badges are not written in a proper markdown and would be showed incorrectly in PyPI. The code you mentioned here imo does not deal with this situation.

praiskup commented 1 year ago

Then +1 for merging? We can fix it later.