Getting the bleeding edge

asmeurer edited this page Apr 4, 2013 · 4 revisions
Clone this wiki locally

Getting the Bleeding Edge

Introduction

If you want to just have the latest development version of SymPy, which is recommended to try if you are having problems with the latest released version, or if you just want to be on the bleeding edge, then you don't need to learn a lot of how to use git, as opposed to if you want to contribute, which requires learning a little bit more (see the Development workflow page).

The easy way

If you don't want to learn git or the command line, the easiest way is to use GitHub's git client for your operating system (Mac; Windows), and just clone sympy/sympy (there is a button at the top of https://github.com/sympy/sympy that says "Clone in Mac" or "Clone in Windows" depending on your platform). You can then run or install SymPy from the directory it downloads.

On Linux, you will need to use the command line, see below.

If you just want to install SymPy, you can use pip

pip install git+https://github.com/sympy/sympy.git

(see also the part about installation below)

Using the command line

This guide is specifically for Linux and Mac OS X. On Windows, you can do the same thing using msysgit: Windows development using git.

Basically, if you have never used git before, you need to just install it either from your operating system's package manager (for Mac OS X, fink is recommended), or from http://git-scm.com/ and run

git clone git://github.com/sympy/sympy.git

in whatever directory you want to put it, and then

cd sympy
./bin/isympy

or you can install it using

./setup.py install

Installing

Installing is not recommended for non-release versions, because the development directory is updated often from git, and the installed version won't be updated unless you re-run setup.py. If you just want to use SymPy as a calculator, you can just run

./bin/isympy

from the sympy directory without installing, and it will work just fine.

However, there is a way to install globally that will automatically update when you update from git. Use

./setupegg.py develop

This will set the global SymPy to point to the git directory. Now, any time you change the git directory (i.e., by doing a git pull), the global version will automatically be updated to that.

If you decide to install SymPy, you should be aware that this will install the development version at whatever point in time you do the installation. SymPy is usually stable (if this image is green, it is currently OK: Travis), but occasionally bugs slip in. So you should update the git repo on a regular basis, either by doing git pull if you used setupegg.py develop as described above (or synchronizing git in the GitHub application), or by re-running pip with the --upgrade flag if you used pip.

If you just use SymPy as a calculator, it is recommended to just keep the local git clone without ever installing globally.

Some more about git

If you want to contribute to SymPy, which you are always welcome to do so, there are more things about git to learn -- see the Development workflow page, but if you just want to pull down the bleeding edge, that is it. The command

git pull

will update it whenever you want. If that command fails, it's because you edited something in the sympy directory and it won't override it (dirty tree). The command

git diff

will show you what has changed and

git reset --hard

will clear the changes, but WARNING: THIS WILL PERMANENTLY REVERT ALL CHANGES IN THE REPOSITORY TO THEIR ORIGINAL STATE. If you are trying to develop for sympy, you will need to use git branches and git commit. See our Development Workflow page, the GitHub documentation, or any git tutorial online.

Python 3

If you want to work in Python 3, you will need to run

./bin/use2to3

after each pull, and then work from the py3k-sympy directory.