pypa / readme_renderer

Safely render long_description/README files in Warehouse
Apache License 2.0
158 stars 89 forks source link

Python 3.5 new keywords, async and await, not syntax highlighted #96

Closed di closed 6 years ago

di commented 6 years ago

From https://github.com/pypa/warehouse/issues/3770:

See for instance https://pypi.org/project/influxdbpusher/

It has code snippets with async def and await, which are not being properly highlighted as keywords.

theacodes commented 6 years ago

looks like it might just be that we need to use the "python3" lexer by default: http://pygments.org/demo/6734166/

gjcarneiro commented 6 years ago

I am still not seeing python 3 properly highlighted (eg.). Is this not deployed to pypi.org yet, or did the bug fix not work?

theacodes commented 6 years ago

For rst you'll need to use ..code-block:: python3.

gjcarneiro commented 6 years ago

But... it works in github as it is, see: https://github.com/GambitResearch/influxdbpusher

theacodes commented 6 years ago

github uses a different syntax highlighter than we do, which leads to some inconsistencies like this. We try to match their behavior exactly when it comes to Markdown, but so far we've only been close with RST. Do you feel strongly we should make the RST highlighter default to python3?

On Fri, May 25, 2018 at 1:07 PM Gustavo J. A. M. Carneiro < notifications@github.com> wrote:

But... it works in github as it is, see: https://github.com/GambitResearch/influxdbpusher

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/pypa/readme_renderer/issues/96#issuecomment-392166209, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPUczjcWH7-J1jvdCKjOlpx_m1ZB8U0ks5t2GR-gaJpZM4TbkjW .

gjcarneiro commented 6 years ago

For me, Python 3 is Python, Python 2 is "legacy Python". We definitely should default to Python 3.

theacodes commented 6 years ago

I certainly agree with that sentiment.

@di what do you think?

gjcarneiro commented 6 years ago

Looks like I'm not the only package author with this problem, see https://pypi.org/project/aiokafka/0.4.3/