Skip to content

Instantly share code, notes, and snippets.

@ppurka
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ppurka/d10f668db113c2d1ddd4 to your computer and use it in GitHub Desktop.
Save ppurka/d10f668db113c2d1ddd4 to your computer and use it in GitHub Desktop.
Creating sagenb package

Steps to create a Sagenb package

Throughout the steps below, replace <version> with the actual version, for example, 0.10.8.3. Also, I will assume that github.org/sagemath/sagenb is present as upstream remote repository in your local SAGENB_ROOT.

  1. Change into the sagenb git directory, and update to the latest upstream/master. I am assuming that all the required merges to the upstream/master has happened already.

    cd SAGENB_ROOT
    git checkout master
    git fetch upstream
    git rebase upstream/master  # Assuming your master is an exact replica of upstream/master, otherwise use git merge upstream/master
  2. Edit Changes file to highlight the main changes. Edit setup.py to update the version for Sagenb (this is important). Example diff

    --- a/setup.py
    +++ b/setup.py
    @@ -44,7 +44,7 @@ if __name__ == '__main__':
             distutils.log.set_threshold(distutils.log.DEBUG)
    
         code = setup(name = 'sagenb',
    -          version     = '0.10.8.2',
    +          version     = '0.10.8.3',
               description = 'The Sage Notebook',
               license     = 'GNU General Public License (GPL) v3+',
               author      = 'William Stein et al.',                      
  3. Commit the updated version change.

    git commit -a -m "Update Sagenb version to <version>"
  4. Create the dist directory with all the included packages

    ./dist.sh
  5. (Optional) If the above command was already run once, then to avoid downloading all the dependencies all over again, and to just repackage only sagenb, the following command can also be run:

    rm -f dist/sagenb*
    ./dist.sh -s
  6. Create the sagenb tar file for inclusion into Sage.

    mv dist sagenb-<version>
    tar cf sagenb-<version>.tar sagenb-<version>
    mv sagenb-<version>.tar SAGE_ROOT/upstream
  7. Update the checksums in Sage, test Sage and/or sagenb, and push the changes to the ticket <ticket>

    cd SAGE_ROOT
    git checkout develop -b ticket/<ticket> # or "git trac create" or "git trac checkout", etc
    echo "<version>" > build/pkgs/sagenb/package-version.txt
    ./sage -sh -c sage-fix-pkg-checksums
    git commit -a -m "Upgrade sagenb to version <version>"
    ./sage -tp --long --sagenb  # test sagenb
    make ptestlong              # test sage
    git trac push <ticket>
  8. Now that everything is fine, update the sagenb in Github with the new changes.

    cd SAGENB_ROOT
    git tag <version>
    git push upstream master
    git checkout release
    git merge <version>
    git push upstream release
    git push upstream --tags  # This will automatically create sagenb.tar.gz in Github
  9. If you make any mistakes, then you can also look at the work flow that was shown by @kini long ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment