-
Notifications
You must be signed in to change notification settings - Fork 0
Home
The code for gensim
is hosted here, on github. Contributions in the form of pull requests are welcome. You may also report an issue or bug here (see the Issues tab above).
Should your contribution be included in the gensim
project, you will also have to agree to assign joint ownership of your changes (your code patch, documentation fix, whatever) to me. This means I will have the full rights to incorporate, distribute and/or further modify your changes, without any fees or restrictions (this is an open-source project!).
Below are some code-style and git-flow guidelines.
There should be no trailing whitespace in source code. Whitespace on empty Python lines (lines separating blocks of code/methods etc.) is fine and even desirable, but not supported in git natively and therefore more difficult to work around.
To make sure you didn't introduce any trailing whitespace in your commit, enable the pre-commit hook (=move file .git/hooks/pre-commit.sample
to .git/hooks/pre-commit
). In this file, there should be a line:
exec git diff-index --check --cached $against --
Change it to:
exec git diff-index --check --cached $against gensim
Now every commit inside the gensim
directory will be first checked by this hook. If there is trailing whitespace, the hook will refuse the commit and give you the offending line(s), which you must fix first. Fix either manually or en-masse with:
$ # for MacOS and other BSD's
$ find gensim -name '*.py' | xargs sed -i '' 's/[[:space:]]*$//'
$ # for GNU sed (i.e. GNU/Linux distros)
$ find gensim -name '*.py' | xargs sed -i 's/\s*$//'
Branching model follows http://nvie.com/posts/a-successful-git-branching-model/:
-
master
branch is stable, HEAD is always the latest release -
develop
branch contains the latest code for the next release. - various feature branches, to be merged into
develop
upon completion
For a new feature, branch off develop
:
$ git checkout -b myfeature develop
To merge a feature back into develop
:
$ git checkout develop
$ git merge --no-ff myfeature
$ git branch -d myfeature
$ git push --tags origin develop
To start a new release, first branch off develop
:
$ export RELEASE=0.7.8
$ git checkout -b release-${RELEASE} develop
To finalize the release, merge its branch into master
and develop
, and tag master
:
$ git checkout master
$ git merge --no-ff release-${RELEASE}
$ git tag -a ${RELEASE}
$ git push --tags origin master
$ git checkout develop
$ git merge --no-ff release-${RELEASE}
$ git branch -d release-${RELEASE}
And update PyPi & documentation:
$ cd docs/src; make clean html upload
$ python2.5 ./setup.py test
$ python2.5 ./setup.py sdist bdist_egg register upload