-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for running without virtualenv. (#71)
- Loading branch information
Showing
5 changed files
with
840 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Copyright (c) 2017 Adi Roiban. | ||
# See LICENSE for details. | ||
""" | ||
Build script for Python binary distribution. | ||
""" | ||
from __future__ import unicode_literals, print_function | ||
import os | ||
import sys | ||
from paver.easy import path, task | ||
|
||
|
||
RUN_PACKAGES = [ | ||
'sphinx', | ||
'sphinx-autobuild', | ||
'sphinx_rtd_theme', | ||
] | ||
|
||
|
||
@task | ||
def deps(): | ||
""" | ||
Copy external dependencies. | ||
""" | ||
print('Installing dependencies to ...') | ||
from pip import main | ||
main(args=['install'] + RUN_PACKAGES) | ||
|
||
|
||
def _run_sphinx(args): | ||
""" | ||
Run sphinx build with `args`. | ||
""" | ||
from sphinx import main | ||
main(argv=['build'] + args) | ||
|
||
|
||
@task | ||
def generate(): | ||
""" | ||
Generate the site as local static files. | ||
""" | ||
build_html = os.path.join(os.getcwd(), 'build', 'html') | ||
_run_sphinx(['-b', 'html', '-j', '2', '-n', 'docs/', build_html]) | ||
print("Open the result in a browser: file://%s/index.html" % build_html) | ||
|
||
|
||
@task | ||
def test(): | ||
""" | ||
Run a few tests. | ||
""" | ||
build_errors = os.path.join(os.getcwd(), 'build', 'errors') | ||
path(build_errors).remove() | ||
|
||
build_html = os.path.join(os.getcwd(), 'build', 'html') | ||
_run_sphinx([ | ||
'-b', 'html', | ||
'-j', '2', | ||
'-Ean', '-w', build_errors, | ||
'docs/', build_html, | ||
]) | ||
errors = open(build_errors, 'r').read() | ||
if errors: | ||
print('Errors summary:\n\n') | ||
print(errors) | ||
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
BASE_REQUIREMENTS='paver==1.2.4' | ||
PYTHON_CONFIGURATION='default@2.7.14.620df8b0' |
Oops, something went wrong.