=== Checklist for MDP release ===

Before release:

- check that new nodes have been explicitly imported in nodes/__init__.py
  and that they are listed in __all__:
  - create a list of defined nodes with:
    git grep 'class .*Node(' mdp/nodes | grep -v test | grep -v Scikits | cut -d ':' -f 2 | cut -d ' ' -f 2 | cut -d '(' -f 1 | sort > /tmp/list_defined
  - create a list of nodes imported in mdp.nodes with:
    python -c "import sys, mdp; [sys.stdout.write(i+'\n') for i in  sorted([obj for obj in mdp.nodes.__dict__ if obj.endswith('Node') and not obj.endswith('ScikitsLearnNode')])]" > /tmp/list_in_dict
  - create a list of nodes in __all__ with:
    python -c "import sys, mdp; [sys.stdout.write(i+'\n') for i in  sorted([obj for obj in mdp.nodes.__all__ if obj.endswith('Node') and not obj.endswith('ScikitsLearnNode')])]" > /tmp/list_in_all
  - compare those lists [keep in mind that a couple of nodes are private and
    so those lists do not need to be exactly equal]

- make sure that __init__ has the right version number

- update date in variable __copyright__ in file __init__
- test all suported python versions and dependencies with
  python testall.py [dir]
  where [dir] is an optional directory that will be prepended to your python
  path, in case you have locally installed packages
- "make doctest" in docs repository and fix all failures

During release:
- update CHANGES: you can generate a new bunch of CHANGES with:
  git log --no-color --pretty="format:%w(79,0,12)%ad: %s%+b" --date=short --no-merges --since=$LASTRELEASE
  where LASTRELEASE is the tag of the last release, e.g. MDP-3.4
  You can then prepend the output of this command to the original CHANGES file, 
  but even better would be to edit the result to only keep the changes
  that are relevant for the user like incompatibilities, new features, etc..
- update TODO and COPYRIGHT (date)
- generate tutorial, website, and API documentation [make website]
- change homepage colors
- short/long description should go: on SF.net description, tutorial,
  home page, modules __init__, software.incf.net.
- generate packages and test them:
  # this generates a source distribution (tarball) and an universal wheel (binary
  # installer OS independent)
  python3 setup.py sdist bdist_wheel
  # the generated files are in the directory "dist"
  # test them in a virtualenv
  virtualenv mdp-27 && source /home/tiziano/mdp-27/bin/activate
  cd dist 
  pip install MDP-3.4.tar.gz
  pip install pytest
  python -c 'import mdp; mdp.test(seed=10)'
  python -c 'import bimdp; bimdp.test(seed=10)'
  cd ..
  virtualenv mdp-27-wheel && source /home/tiziano/mdp-27-wheel/bin/activate
  cd dist
  pip install MDP-3.4-py2.py3-none-any.whl
  pip install pytest
  python -c 'import mdp; mdp.test(seed=10)'
  python -c 'import bimdp; bimdp.test(seed=10)'
  # now do the same with python3, where instead of virtualenv you use
  python3 -m venv mdp-3 && source /home/tiziano/mdp-3/bin/activate
- create a release notes file
- tag release in git (tag mdp-toolkit repo)
  git tag -a MDP-3.4
- push the tag git push --tags
- update the package on PyPI:
  # first test on the test PyPI instance (you have to register there first)
  # - create a ~/.pypirc first:
  cat > ~/.pypirc <<EOF
[distutils]
index-servers=
    test

[test]
    repository = https://testpypi.python.org/pypi
    username = otizonaizit
EOF
  # - register
  python3 setup.py register -r test
  # go and check if it is there!
  # now use twine to upload and sign the packages
  twine upload -r test -s dist/MDP-3.4*
  # now create another virtualenv and try to test installation
  virtualenv mdp-27 && source /home/tiziano/mdp-27/bin/activate
  pip install -i https://testpypi.python.org/pypi MDP
  # if it fails because future or numpy are not on the test pypi server,
  # just install them with pip install without -i
  # 
  # If all of the above works, you can finally upload to the real PyPI:
  # modify your ~/.pypirc:
cat > ~/.pypirc <<EOF
[distutils]
index-servers=
    pypi
    test

[test]
repository = https://testpypi.python.org/pypi
username = otizonaizit

[pypi]
repository = https://pypi.python.org/pypi
username = otizonaizit
EOF
   # now register
   python3 setup register
   # upload to pipy
   twine upload -s dist/MDP-3.4*
   # test that it works with pip
virtualenv mdp-27 && source /home/tiziano/mdp-27/bin/activate
pip install mdp
   # yeah, it works!!!
- update on SF.net:
  release files: 
    - sftp username@frs.sourceforge.net
    - cd /home/frs/project/mdp-toolkit/mdp-toolkit/
    - create a new directory for the release, for example for release 3.0:
       mkdir 3.0
       cd 3.0
    - upload the files there (note: the release notes should be named 
      README.txt): 
      file to upload are: .tar.gz, .zip, .exe, tutorial, release notes file
       - login to sourceforge, go to "Files"
       - select the new created directory
       - select the wheel file and set it as a default for windows and
         Mac by clicking on the "i" icon on the right, 
       - select the tar.gz as a default for everything else
       - at that point the readme file should be automatically shown as release
         note file
		 if README.txt is not shown, delete it and upload it through the web interface.
		 make sure that it is shown.
    - more info: https://sourceforge.net/apps/trac/sourceforge/wiki/Release%20files%20for%20download
- make the website within a clone of the docs repository with:
 - make website
 - be careful to read all warnings and messages, often things do not work as 
   expected.
 - upload the pdf tutorial, which is in build/latex/MDP-tutorial.pdf, to sf.net
   as explained above for the source tarballs.
 - synchronize the site with:
   cd build/html
   rsync -av --delete-after . username@web.sourceforge.net:/home/project-web/mdp-toolkit/htdocs/
 - more info: http://alexandria.wiki.sourceforge.net/Project+Web,+Shell,+VHOST+and+Database+Services
- tag the docs repository:
  git tag -a MDP-3.5
  git push --tags
After release:
- update version number in __init__
- send announcement to:
	connectionists: connectionists@cs.cmu.edu
	ML-news: ML-news@googlegroups.com
	numpy-discussion: numpy-discussion@scipy.org
	Scipy users: scipy-user@scipy.org
	mdp-users: mdp-toolkit-users@lists.sourceforge.net
        Python-announce: python-announce-list@python.org

- celebrate!!

