Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

variant=CommonMark gets stripped from long_description_content_type #122

Closed
Jackenmen opened this issue Mar 12, 2022 · 1 comment
Closed

Comments

@Jackenmen
Copy link

Minimal example:

  • setup.cfg:
[metadata]
name = example_project
long_description = file: README.md
long_description_content_type = text/markdown; charset=UTF-8; variant=CommonMark
  • README.md:
# Header

text

setup.cfg gets rewritten to:

[metadata]
name = example_project
long_description = file: README.md
long_description_content_type = text/markdown

This spec can be found here:
https://packaging.python.org/en/latest/specifications/core-metadata/#description-content-type

@asottile
Copy link
Owner

setup-cfg-fmt unconditionally assigns that value based on the detected content type of the readme file:

tags = identify.tags_from_filename(readme)
if 'markdown' in tags:
cfg['metadata']['long_description_content_type'] = 'text/markdown'
elif 'rst' in tags:
cfg['metadata']['long_description_content_type'] = 'text/x-rst'
else:
cfg['metadata']['long_description_content_type'] = 'text/plain'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants