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

Switch to cmarkgfm completely for rendering Markdown #68

Merged
merged 2 commits into from
Mar 30, 2018

Conversation

theacodes
Copy link
Member

@theacodes theacodes commented Mar 20, 2018

Follow up to #67.

Towards pypa/packaging-problems#126

Note: There are wheels for cmarkgfm for basically everything but Python 2.7 on Windows. This is due to the hilariously ancient version of MSVC needed to compile the wheel and cmark just outright being uncompilable as-is. Basically, users of 2.7 on Windows will not be able to use readme_renderer at all. As long as we're okay with that, this can merge.

Wheels are available across Windows, Linux, and Mac for 2.7, 3.4, 3.5, and 3.6.

@theacodes
Copy link
Member Author

theacodes commented Mar 20, 2018

@di alternatives for Windows 2.7 users include:

  • Use a platform specifier for cmarkgfm and then warn them if they try to use it. (install succeeds, usage fails)
  • Use a platform specifier for cmarkgfm, keep CommonMark as a fallback, work for CommonMark variant but fail for gfm variant.

@theacodes
Copy link
Member Author

I'm a bit baffled as to how this change caused the txt tests to fail on 2.7. Weird.

@theacodes
Copy link
Member Author

I'm a bit baffled as to how this change caused the txt tests to fail on 2.7. Weird.

Figured it out. CommonMark was pulling in future which cleverly provides html.escape which means that the branch in txt.py that checks for html.escape and falls back to cgi.escape was previously never used. Removing CommonMark removed future and thus html and made the previously unused branch trigger for 2.7 - which has different escape behavior for single quotes!

Fixed in 5e7c7d1 by just including future as a direct dependency and removing the problematic branch.

@anthrotype
Copy link

@jonparrott have you tried compiling the Windows 2.7 wheels using mingwpy toolchain?
https://anaconda.org/carlkl/mingwpy
https://github.com/mingwpy/mingwpy
https://mingwpy.github.io/

@theacodes
Copy link
Member Author

@anthrotype nope, is there an easy way to do that with multibuild? I'm using that over in https://github.com/jonparrott/cmarkgfm-wheels.

@theacodes
Copy link
Member Author

Aww it seems mingwpy is abandoned?

@anthrotype
Copy link

Aww it seems mingwpy is abandoned?

yes, but it still works for 2.7.
you can pip install -i https://pypi.anaconda.org/carlkl/simple/ mingwpy

I use it like this in another project where I need c++11 stuff not available for MSVC2008
https://github.com/googlei18n/compreffor/blob/master/.appveyor.yml
https://github.com/googlei18n/compreffor/blob/master/tox.ini#L4

@theacodes
Copy link
Member Author

@anthrotype ah great. I've give that a shot this afternoon. Thank you!

@theacodes
Copy link
Member Author

Thank you for the help @anthrotype! I got wheels working for Python 2.7 on Windows!

@di this should be good to go. :)

@theacodes theacodes merged commit 50d399c into pypa:master Mar 30, 2018
@theacodes theacodes deleted the require-cmark-gfm branch March 30, 2018 21:29
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

Successfully merging this pull request may close these issues.

3 participants