Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Latest commit

 

History

History
69 lines (53 loc) · 2.9 KB

HACKING.rst

File metadata and controls

69 lines (53 loc) · 2.9 KB

Development of the Sage notebook

Unlike most other parts of Sage (as of January 2013), development of sagenb is done on a moving target, namely a git repository on GitHub. Rather than making changes to the version of sagenb that came with your copy of Sage, please first clone the sagenb git repository and install it into your copy of Sage before you start coding. Details on how to do this are as follows.

  1. Install the latest development version of Sage from sagemath.org.

  2. Sign up for an account at github.com, if you don't already have one, and log in; set up your SSH keys for authentication as directed by the instructions.

  3. Create your own fork of sagenb on the GitHub website. To do this, go to the sagenb git repository page and click on "Fork" in the upper right corner of the webpage.

  4. Clone your fork of sagenb to somewhere on your local disk, for example ~/src/sagenb-git:

    $ cd ~/src
    $ git clone git@github.com:<your username>/sagenb sagenb-git
    
  5. Where SAGE_ROOT represents the base path of your Sage installation, perform the following commands. If you have more than one sagenb installation in SAGE_ROOT/local/lib/python2.7/site-packages, then change directory into the latest version:

    $ cd SAGE_ROOT/local/lib/python2.7/site-packages/
    $ mv sagenb sagenb-old
    $ ln -s ~/src/sagenb-git/sagenb sagenb  # or wherever your clone is
    $ cd ~/src/sagenb-git
    $ SAGE_ROOT/sage --python setup.py develop
    $ ln -s SAGE_ROOT/sage/local/share/mathjax sagenb/data/mathjax
    
  6. You can also add the `sagenb`_ git repository as a remote branch called upstream:

    $ git remote add upstream git@github.com:sagemath/sagenb
    $ git remote update upstream
    

    This will allow you to update your local repository as other people's changes are merged. Such an operation might look something like this:

    $ git remote update upstream    # learn what has changed
    $ git checkout master           # move to local master
    $ git merge upstream/master     # merge changes to local master
    

This completes the installation process. Now you can modify files in your sagenb-git directory and submit your modifications to us using pull requests on GitHub. (A full walkthrough of using git and GitHub are beyond the scope of this file -- for more information see the relevant section in the Sage manual.)

If you ever need to switch to using another Sage installation for your sagenb development, you only need to repeat step 5 with the new value of SAGE_ROOT.