GitHub Pages Activity (rever.activities.ghpages)

Activity for pushing documentation to GitHub pages.

class rever.activities.ghpages.GHPages

Activity for pushing documentation up to GitHub pages.

This activity uses the following environment variable:


str, the URL of the GitHUb pages repository.


str, the GitHub pages branch name, i.e. either gh-pages or master. If not provided, the activity will attempt to deduce it from the repo name.


list or str 2-tuples, This is a list of (src, dst) pairs of files to copy from the project into the gh-pages repo. These pairs will have environment variables expanded and it is evaluated in the current directory (where rever was run from). src files or directories that don’t exist will be skipped. After variable expansion, this list will be deduplicated. Additionally, the environment variable $GHPAGES_REPO_DIR is added to allow easy access to the local clone of the repo, which is at $REVER_DIR/ghpages-repo. By default, this will look in the sphinx html directory created by the sphinx activity.

namestr, optional

Name of the activity.

depsset of str, optional

Set of activities that must be completed before this activity is executed.

funccallable, optional

Function to perform as activity when this activities is executed (called).

undocallable, optional

Function to undo this activities behaviour and reset the repo state.

setupcallable, optional

Function to help initialize the activity.

checkcallable, optional

Function to check if the activity can be run sucessfully on the user’s machine, with their credentials, etc. This function should return True if the activity can be run, and False otherwise.

requiresdict or None, optional

A dict of dicts of the following form that specifies the command line utility and import requirements for this activity.

    "commands": {"<cli name>": "<package name>", ...}
    "imports": {"<module name>": "<package name>", ...}

The top-level keys are both optional, and this will default to an empty dict.

argstuple, optional

Arguments to be supplied to the func(*args), if needed.

kwargsmapping, optional

Keyword arguments to be supplied to the func(**kwargs), if needed.

descstr, optional

A short description of this activity


Returns all kwargs for this activity.


Calls this activity’s check() function.


Checks that an activities requirements are actually available.


Decorator that sets the check function for this activity.


Removes kwarg from the environment, if they exist.


Obtains possible func() kwarg from the environment.


Calls this activity’s setup() initialization function.


Decorator that sets the setup function for this activity.


Reverts to the last instance of this activity. This default implementation uses the revision in the log file from the last time that the activity was started. This may be overridden in a subclass.


Decorator that sets the undo function for this activity.

property env_names

Dictionary mapping parameter names to the names of environment varaibles that the activity looks for when it is executed.

rever.activities.ghpages.branch_name(repo, branch=None)

Computes the gh-pages branch name for a repo.


Expands a list or (src, dst) tuples into a deduplicated list where the src is guaranteed to exist, and src and dst are returned as absolute paths.