Skip to content

Commit

Permalink
Add support for running without virtualenv. (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
adiroiban committed Dec 15, 2017
1 parent bc62289 commit 89a8ab9
Show file tree
Hide file tree
Showing 5 changed files with 840 additions and 38 deletions.
22 changes: 14 additions & 8 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
Development Notes
==================

The Pelican blog article template is used to generate simple pages.
This is done since we don't care about the blog part but don't want to create
'content/pages' folder in order to automatically generate all pages...
and also have 'pages/*' URLs.
The pages are published using the Read The Docs online service.

Run ``paver deps`` then ``paver run`` to build the project locally on
``http://localhost:8080``
Any changed pushed to master is automatically published online.

Continuously update content with ``paver dev``.
There is paver file to help running a few local tasks.

Publish changes from current branch with ``paver publish``.
To initiate the dev environment::

./paver.sh deps

To generate the page on your local system::

./paver.sh generate

To run a few tests::

./paver.sh test


Onboarding Notes
Expand Down
30 changes: 0 additions & 30 deletions Makefile

This file was deleted.

66 changes: 66 additions & 0 deletions pavement.py
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)
2 changes: 2 additions & 0 deletions paver.conf
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'

0 comments on commit 89a8ab9

Please sign in to comment.