From b95a3068ae330690da5e20e1556502b4599cebb4 Mon Sep 17 00:00:00 2001 From: Carl Brasic Date: Tue, 30 Mar 2021 14:41:06 -0500 Subject: [PATCH 1/5] Point to python3 executable for rendering RST https://github.com/github/markup/pull/919 added support for python3, but we still explicitly shell out to the `python2` executable. Let's switch to python3 now that it's supported. This bumps the major version because it's a breaking change for anyone running in an environment with only python2. --- lib/github-markup.rb | 2 +- lib/github/markups.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/github-markup.rb b/lib/github-markup.rb index 4b064e0e..df6aa41d 100644 --- a/lib/github-markup.rb +++ b/lib/github-markup.rb @@ -1,6 +1,6 @@ module GitHub module Markup - VERSION = '3.0.5' + VERSION = '4.0.0' Version = VERSION end end diff --git a/lib/github/markups.rb b/lib/github/markups.rb index 0ed55df0..f12fb7e0 100644 --- a/lib/github/markups.rb +++ b/lib/github/markups.rb @@ -49,7 +49,7 @@ command( ::GitHub::Markups::MARKUP_RST, - "python2 -S #{Shellwords.escape(File.dirname(__FILE__))}/commands/rest2html", + "python3 -S #{Shellwords.escape(File.dirname(__FILE__))}/commands/rest2html", /re?st(\.txt)?/, ["reStructuredText"], "restructuredtext" From e1fb4356cd9064384c026b8bcb10fc88c151d505 Mon Sep 17 00:00:00 2001 From: Carl Brasic Date: Tue, 30 Mar 2021 15:31:52 -0500 Subject: [PATCH 2/5] Remove -S flag for python3 This should not be necessary anymore and its presence breaks actual use of pip which installs into the site-packages directory. --- lib/github/markups.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/github/markups.rb b/lib/github/markups.rb index f12fb7e0..2c30c99d 100644 --- a/lib/github/markups.rb +++ b/lib/github/markups.rb @@ -49,7 +49,7 @@ command( ::GitHub::Markups::MARKUP_RST, - "python3 -S #{Shellwords.escape(File.dirname(__FILE__))}/commands/rest2html", + "python3 #{Shellwords.escape(File.dirname(__FILE__))}/commands/rest2html", /re?st(\.txt)?/, ["reStructuredText"], "restructuredtext" From 935ee3bb2365b372ee1a290e8f0ea4ea0ffc8c6d Mon Sep 17 00:00:00 2001 From: Carl Brasic Date: Tue, 30 Mar 2021 15:33:15 -0500 Subject: [PATCH 3/5] Update bootstrap script to use pip3 --- script/bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/bootstrap b/script/bootstrap index 8092d517..f89f3181 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -5,4 +5,4 @@ set -e cd $(dirname "$0")/.. bundle install -easy_install docutils +pip3 install docutils From 9899397bdef227900f827001116a85f350377312 Mon Sep 17 00:00:00 2001 From: Carl Brasic Date: Tue, 30 Mar 2021 15:47:37 -0500 Subject: [PATCH 4/5] Update HTML fixture for python3 The README.rst fixture had a test that was python2-specific, it asserted that a segment of markup would be dropped from the output for containing UTF-8 chars. That's no longer true, so we can update the fixture accordingly. --- test/markups/README.rst.html | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/test/markups/README.rst.html b/test/markups/README.rst.html index 7b8e9fca..031c3c4a 100644 --- a/test/markups/README.rst.html +++ b/test/markups/README.rst.html @@ -16,6 +16,47 @@

Header 2

  • Somé UTF-8°
  • The UTF-8 quote character in this table used to cause python to go boom. Now docutils just silently ignores it.

    + +Things that are Awesome (on a scale of 1-11) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ThingAwesomeness
    Icecream7
    Honey Badgers10.5
    Nickelback-2
    Iron Man10
    Iron Man 23
    Tabular Data5
    Made up ratings11
     A block of code
     
    From 4230afedbb28a0d0e053ac51f5d74a9fdf160349 Mon Sep 17 00:00:00 2001 From: Carl Brasic Date: Wed, 31 Mar 2021 10:14:16 -0500 Subject: [PATCH 5/5] Add changelog entry --- HISTORY.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 8ee4e818..c296602b 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,7 @@ +## 4.0.0 - 2021-03-31 + +* Drop support for Python 2 in RST rendering [#1456](https://github.com/github/markup/pull/1456) + ## 3.0.5 - 2020-11-12 * Add commonmarker_exts to commonmarker options [#1268](https://github.com/github/markup/pull/1268) @@ -72,8 +76,8 @@ ### Added -* Re-introduce [#537](https://github.com/github/markup/pull/537) to detect language of markup document - However `github-linguist` is optional and this gem will fallback to extensions for detection. +* Re-introduce [#537](https://github.com/github/markup/pull/537) to detect language of markup document + However `github-linguist` is optional and this gem will fallback to extensions for detection. [Full changelog](https://github.com/github/markup/compare/v1.4.9...v1.5.0)