Skip to content

Commit

Permalink
updated crazyfun task and dependencies for generating python api docs.
Browse files Browse the repository at this point in the history
1. use virtualenv
2. install all packages from third_party
3. fix error in sphinx_build path determination at linux
  • Loading branch information
alex-savchuk committed Jul 23, 2013
1 parent afc1e4b commit 4f0ecf4
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 9 deletions.
18 changes: 16 additions & 2 deletions py/build.desc
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,19 @@ py_test(
py_docs(
name = "docs",
source_folder = "py/docs/source",
target_folder = "docs/api/py"
)
target_folder = "docs/api/py",
deps = [ "//py:test_env_docs" ]
)

py_env(
name = "test_env_docs",
packages = [
"third_party/py/py-1.4.13.tar.gz",
"third_party/py/docutils-0.11.tar.gz",
"third_party/py/Jinja2-2.7.tar.gz",
"third_party/py/MarkupSafe-0.18.tar.gz",
"third_party/py/Pygments-1.6.tar.gz",
"third_party/py/Sphinx-1.2b1.tar.gz",
],
dest = "build/python"
)
17 changes: 10 additions & 7 deletions rake-tasks/crazy_fun/mappings/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ def handle(fun, dir, args)

#Also generate test with exactly this name, if only one browser specified
task "#{base_task_name}:run" => [ :"#{base_task_name}_#{browsers.first}:run" ] if browsers.length == 1

end
end

Expand Down Expand Up @@ -191,17 +190,21 @@ def handle(fun, dir, args)
end
end

class GenerateDocs
class GenerateDocs < Tasks

def python_path
#This path should be passed through the py_env dep, rather than hard-coded
windows? ? "build\\python\\Scripts\\" : "build/python/bin/"
end

def handle(fun, dir, args)
task Tasks.new.task_name(dir, args[:name]) do
task Tasks.new.task_name(dir, args[:name]) => args[:deps] do

source_folder = Platform.path_for args[:source_folder]
target_folder = Platform.path_for args[:target_folder]

pip_pkg = "pip install Sphinx"
sh pip_pkg, :verbose => true

sphinx_build = "sphinx-build" + ".exe" if windows?
sphinx_build = "#{python_path}sphinx-build"
sphinx_build = sphinx_build + ".exe" if windows?

sh "#{sphinx_build} -b html -d build/doctrees #{source_folder} #{target_folder}", :verbose => true
end
Expand Down
Binary file added third_party/py/Jinja2-2.7.tar.gz
Binary file not shown.
Binary file added third_party/py/MarkupSafe-0.18.tar.gz
Binary file not shown.
Binary file added third_party/py/Pygments-1.6.tar.gz
Binary file not shown.
Binary file added third_party/py/Sphinx-1.2b1.tar.gz
Binary file not shown.
Binary file added third_party/py/docutils-0.11.tar.gz
Binary file not shown.

0 comments on commit 4f0ecf4

Please sign in to comment.