Merge remote-tracking branch 'origin/bug/docutils'

This commit is contained in:
DJ Mountney 2016-08-26 10:51:38 -07:00
commit 70ee88c2d7
4 changed files with 40 additions and 2 deletions

View File

@ -0,0 +1,13 @@
diff --git a/lib/github/markups.rb b/lib/github/markups.rb
index 89f1b41..a5259a6 100644
--- a/lib/github/markups.rb
+++ b/lib/github/markups.rb
@@ -33,7 +33,7 @@ markup(:asciidoctor, /adoc|asc(iidoc)?/) do |content|
end
command(
- "python2 -S #{Shellwords.escape(File.dirname(__FILE__))}/commands/rest2html",
+ "python3 -S #{Shellwords.escape(File.dirname(__FILE__))}/commands/rest2html",
/re?st(\.txt)?/,
"restructuredtext"
)

View File

@ -0,0 +1,19 @@
diff --git a/lib/github/commands/rest2html b/lib/github/commands/rest2html
index 7ecfe27..958cd3c 100755
--- a/lib/github/commands/rest2html
+++ b/lib/github/commands/rest2html
@@ -31,9 +31,11 @@ import sys
import os
# This fixes docutils failing with unicode parameters to CSV-Table. The -S
-# switch and the following 2 lines can be removed after upgrading to python 3.
-reload(sys)
-sys.setdefaultencoding('utf-8')
+# switch and the following 3 lines can be removed after upgrading to python 3.
+if sys.version_info[0] < 3:
+ reload(sys)
+ sys.setdefaultencoding('utf-8')
+
import site
try:

View File

@ -22,7 +22,7 @@ name "gitlab-rails"
default_version version.print
combined_licenses_file = "#{install_dir}/embedded/service/gem/gitlab-gem-licenses"
gems_directory = "#{install_dir}/embedded/service/gem/ruby/2.3.0/gems/"
gems_directory = "#{install_dir}/embedded/service/gem/ruby/2.3.0/gems"
license "MIT"
license_file "LICENSE"
@ -66,6 +66,11 @@ build do
bundle "config build.rugged --no-use-system-libraries", :env => env
bundle "install --without #{bundle_without.join(" ")} --path=#{install_dir}/embedded/service/gem --jobs #{workers} --retry 5", :env => env
# This patch makes the github-markup gem use and be compatible with Python3
# We've sent part of the changes upstream: https://github.com/github/markup/pull/919
patch source: 'github-markup_gem-markups.patch', target: "#{gems_directory}/github-markup-1.4.0/lib/github/markups.rb"
patch source: 'github-markup_gem-rest2html.patch', target: "#{gems_directory}/github-markup-1.4.0/lib/github/commands/rest2html"
# In order to precompile the assets, we need to get to a state where rake can
# load the Rails environment.
copy 'config/gitlab.yml.example', 'config/gitlab.yml'

View File

@ -63,7 +63,8 @@ default['gitlab']['gitlab-rails']['env'] = {
'PATH' => "#{node['package']['install-dir']}/bin:#{node['package']['install-dir']}/embedded/bin:/bin:/usr/bin",
# Charlock Holmes and libicu will report U_FILE_ACCESS_ERROR if this is not set to the right path
# See https://gitlab.com/gitlab-org/gitlab-ce/issues/17415#note_13868167
'ICU_DATA' => "#{node['package']['install-dir']}/embedded/share/icu/current"
'ICU_DATA' => "#{node['package']['install-dir']}/embedded/share/icu/current",
'PYTHONPATH' => "#{node['package']['install-dir']}/embedded/lib/python3.4/site-packages"
}
default['gitlab']['gitlab-rails']['internal_api_url'] = nil