-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preparing for API documentation on Read The Docs
- Loading branch information
Showing
4 changed files
with
183 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Makefile for rotate-backups | ||
# | ||
# Author: Peter Odding <peter@peterodding.com> | ||
# Last Change: July 19, 2015 | ||
# URL: https://github.com/xolox/python-rotate-backups | ||
|
||
WORKON_HOME ?= $(HOME)/.virtualenvs | ||
VIRTUAL_ENV ?= $(WORKON_HOME)/rotate-backups | ||
ACTIVATE = . $(VIRTUAL_ENV)/bin/activate | ||
|
||
default: | ||
@echo 'Makefile for rotate-backups' | ||
@echo | ||
@echo 'Usage:' | ||
@echo | ||
@echo ' make install install the package in a virtual environment' | ||
@echo ' make reset recreate the virtual environment' | ||
@echo ' make test run the test suite' | ||
@echo ' make coverage run the tests, report coverage' | ||
@echo ' make docs update documentation using Sphinx' | ||
@echo ' make publish publish changes to GitHub/PyPI' | ||
@echo ' make clean cleanup all temporary files' | ||
@echo | ||
|
||
install: | ||
test -d "$(VIRTUAL_ENV)" || virtualenv "$(VIRTUAL_ENV)" | ||
test -x "$(VIRTUAL_ENV)/bin/pip" || ($(ACTIVATE) && easy_install pip) | ||
test -x "$(VIRTUAL_ENV)/bin/pip-accel" || ($(ACTIVATE) && pip install pip-accel) | ||
$(ACTIVATE) && pip uninstall -y rotate-backups >/dev/null 2>&1 || true | ||
$(ACTIVATE) && pip install --quiet --editable . | ||
|
||
reset: | ||
rm -Rf "$(VIRTUAL_ENV)" | ||
make --no-print-directory clean install | ||
|
||
test: install | ||
test -x "$(VIRTUAL_ENV)/bin/py.test" || ($(ACTIVATE) && pip-accel install pytest) | ||
$(ACTIVATE) && py.test -v | ||
$(ACTIVATE) && make coverage | ||
test -x "$(VIRTUAL_ENV)/bin/tox" || ($(ACTIVATE) && pip-accel install tox) | ||
$(ACTIVATE) && tox | ||
|
||
coverage: install | ||
$(ACTIVATE) && pip-accel install coverage | ||
$(ACTIVATE) && coverage run setup.py test | ||
$(ACTIVATE) && coverage report | ||
$(ACTIVATE) && coverage html | ||
|
||
readme: | ||
test -x "$(VIRTUAL_ENV)/bin/cog.py" || ($(ACTIVATE) && pip-accel install cogapp) | ||
$(ACTIVATE) && cog.py -r README.rst | ||
|
||
docs: install | ||
test -x "$(VIRTUAL_ENV)/bin/sphinx-build" || ($(ACTIVATE) && pip-accel install sphinx) | ||
$(ACTIVATE) && cd docs && sphinx-build -b html -d build/doctrees . build/html | ||
|
||
publish: | ||
git push origin && git push --tags origin | ||
make clean && python setup.py sdist upload | ||
|
||
clean: | ||
rm -Rf *.egg *.egg-info .coverage build dist docs/build htmlcov | ||
find -depth -type d -name __pycache__ -exec rm -Rf {} \; | ||
find -type f -name '*.pyc' -delete | ||
|
||
.PHONY: default install reset test coverage docs publish clean |
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,76 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# documentation build configuration file for the 'rotate-backups' package. This | ||
# file is execfile()d with the current directory set to its containing dir. | ||
|
||
import os | ||
import sys | ||
|
||
# Add the 'rotate-backups' source distribution's root directory to the module path. | ||
sys.path.insert(0, os.path.abspath('..')) | ||
|
||
# -- General configuration ----------------------------------------------------- | ||
|
||
# Sphinx extension module names. | ||
extensions = ['sphinx.ext.doctest', 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx'] | ||
|
||
# Paths that contain templates, relative to this directory. | ||
templates_path = ['templates'] | ||
|
||
# The suffix of source filenames. | ||
source_suffix = '.rst' | ||
|
||
# The master toctree document. | ||
master_doc = 'index' | ||
|
||
# General information about the project. | ||
project = u'rotate-backups' | ||
copyright = u'2015, Peter Odding' | ||
|
||
# The version info for the project you're documenting, acts as replacement for | ||
# |version| and |release|, also used in various other places throughout the | ||
# built documents. | ||
|
||
# Find the package version and make it the release. | ||
from rotate_backups import __version__ as rotate_backups_version | ||
|
||
# The short X.Y version. | ||
version = '.'.join(rotate_backups_version.split('.')[:2]) | ||
|
||
# The full version, including alpha/beta/rc tags. | ||
release = rotate_backups_version | ||
|
||
# The language for content autogenerated by Sphinx. Refer to documentation | ||
# for a list of supported languages. | ||
language = 'en' | ||
|
||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
exclude_patterns = ['build'] | ||
|
||
# If true, '()' will be appended to :func: etc. cross-reference text. | ||
add_function_parentheses = True | ||
|
||
# The name of the Pygments (syntax highlighting) style to use. | ||
pygments_style = 'sphinx' | ||
|
||
# Refer to the Python standard library. | ||
# From: http://twistedmatrix.com/trac/ticket/4582. | ||
intersphinx_mapping = { | ||
'python': ('http://docs.python.org', None), | ||
} | ||
|
||
# -- Options for HTML output --------------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
html_theme = 'default' | ||
|
||
# Output file base name for HTML help builder. | ||
htmlhelp_basename = 'rotatebackupsdoc' | ||
|
||
|
||
def setup(app): | ||
# Based on http://stackoverflow.com/a/5599712/788200. | ||
app.connect('autodoc-skip-member', (lambda app, what, name, obj, skip, options: | ||
False if name == '__init__' and obj.__doc__ else skip)) |
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,16 @@ | ||
.. include:: ../README.rst | ||
|
||
API documentation | ||
================= | ||
|
||
This documentation is based on the source code of version |release| of the | ||
`rotate-backups` package. The following modules are available: | ||
|
||
.. contents:: | ||
:local: | ||
|
||
:mod:`rotate_backups` | ||
--------------------- | ||
|
||
.. automodule:: rotate_backups | ||
:members: |
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