<commit_before>.. vim: set filetype=rst

===========================
How to make a khmer release
===========================

<NAME> is the current release maker. This is his checklist.

#. The below should be done in a clean checkout::

        cd `mktemp -d`
        git clone <EMAIL>:ged-lab/khmer.git
        cd khmer

#. (Optional) Check for updates to versioneer::

        pip install versioneer
        versioneer-installer

        git diff
        
        ./setup.py versioneer
        git diff 
        git commit -m -a "new version of versioneer.py"
        # or
        git checkout -- versioneer.py khmer/_version.py khmer/__init__.py MANIFEST.in

#. Review the git logs since the last release and diffs (if needed) and ensure
   that the ``Changelog`` is up to date::

        git log --minimal --patch `git describe --tags --always --abbrev=0`..HEAD

#. Review the issue list for any new bugs that will not be fixed in this
   release. Add them to ``doc/known-issues.txt``

#. Verify that the build is clean: http://ci.ged.msu.edu/job/khmer-master/

#. Set your new version number::

        new_version=1.1

   and then tag the release candidate with the new version number prefixed by
   the letter 'v'::

        git tag v${new_version}-rc1
        git push --tags <EMAIL>@github.com:ged-lab/khmer.git

#. Test the release candidate. Bonus: repeat on Mac OS X::

        cd ..
        virtualenv testenv1
        virtualenv testenv2
        virtualenv testenv3
        virtualenv testenv4
        # First we test the tag
        
        cd testenv1
        source bin/activate
        git clone --depth 1 --branch v${new_version}-rc1 https://github.com/ged-lab/khmer.git
        cd khmer
        make install
        make test
        normalize-by-median.py --version # double-check version number

        # Secondly we test via pip
        
        cd ../../testenv2
        source bin/activate
        pip install -U setuptools==3.4.1
        pip install -e git+https://github.com/ged-lab/khmer.git@v${new_version}-rc1#egg=khmer
        cd src/khmer
        make dist
        make install
        make test
        normalize-by-median.py --version # double-check version number
        cp dist/khmer*tar.gz ../../../testenv3/
        
        # Is the distribution in testenv2 complete enough to build another
        # functional distribution?
        
        cd ../../../testenv3/
        source bin/activate
        pip install -U setuptools==3.4.1
        pip install khmer*tar.gz
        tar xzf khmer*tar.gz
        cd khmer*
        make dist
        make test

#. Publish the new release on the testing PyPI server.  You will need
   to change your PyPI credentials as documented here:
   https://wiki.python.org/moin/TestPyPI.  You may need to reregister:

        python setup.py register --repository test

   Now, upload the new release::

        python setup.py sdist upload -r test

   Test the PyPI release in a new virtualenv::

        cd ../../testenv4
        source bin/activate
        pip install -U setuptools==3.4.1
        pip install screed nose
        pip install -i https://testpypi.python.org/pypi --pre --no-clean khmer
        normalize-by-median.py --version 2>&1 | awk ' { print $2 } '
        cd build/khmer
        ./setup.py nosetests

#. Create the final tag and publish the new release on PyPI (requires an
   authorized account).::

        cd ../../../khmer
        git tag v${new_version}
        python setup.py register sdist upload

#. Delete the release candidate tag and push the tag updates to github.::

        git tag -d v${new_version}-rc1
        git push <EMAIL>:ged-lab/khmer.git
        git push --tags <EMAIL>:ged-lab/khmer.git

#. Make a binary wheel on OS X.::

        virtualenv build
        cd build
        source bin/activate
        pip install -U setuptools==3.4.1 wheel
        pip install --no-clean khmer==${new_version}
        cd build/khmer
        ./setup.py bdist_wheel upload

#. Update Read the Docs to point to the new version. Visit
   https://readthedocs.org/builds/khmer/ and 'Build Version: master' to pick up
   the new tag. Once that build has finished check the "Activate" box next to
   the new version at https://readthedocs.org/dashboard/khmer/versions/ under
   "Choose Active Versions". Finally change the default version at
   https://readthedocs.org/dashboard/khmer/advanced/ to the new version.

#. Delete any RC tags created::

        git tag -d ${new_version}-rc1
        git push origin :refs/tags/${new_version}-rc1

#. Tweet about the new release.

#. Send email including the contents of the ChangeLog to <EMAIL>
   and <EMAIL>

BaTLab testing
--------------

The UW-Madison Build and Test Lab provides the khmer project with a free
cross-platform testing environment.

#. Connect to their head node::

        ssh mcrusoe@submit-1.batlab.org

#. Move into the khmer directory and download a release from PyPI's main server
   or the test PyPI server::
<commit_msg>more release updates<commit_after>.. vim: set filetype=rst

===========================
How to make a khmer release
===========================

<NAME> is the current release maker. This is his checklist.

#. The below should be done in a clean checkout::

        cd `mktemp -d`
        git clone git@github.com:ged-lab/khmer.git
        cd khmer

#. (Optional) Check for updates to versioneer::

        pip install versioneer
        versioneer-installer

        git diff
        
        ./setup.py versioneer
        git diff 
        git commit -m -a "new version of versioneer.py"
        # or
        git checkout -- versioneer.py khmer/_version.py khmer/__init__.py MANIFEST.in

#. Review the git logs since the last release and diffs (if needed) and ensure
   that the ``Changelog`` is up to date::

        git log --minimal --patch `git describe --tags --always --abbrev=0`..HEAD

#. Review the issue list for any new bugs that will not be fixed in this
   release. Add them to ``doc/known-issues.txt``

#. Verify that the build is clean: http://ci.ged.msu.edu/job/khmer-master/

#. Set your new version number::

        new_version=1.1

   and then tag the release candidate with the new version number prefixed by
   the letter 'v'::

        git tag v${new_version}-rc1
        git push --tags <EMAIL>:ged-lab/khmer.git

#. Test the release candidate. Bonus: repeat on Mac OS X::

        cd ..
        virtualenv testenv1
        virtualenv testenv2
        virtualenv testenv3
        virtualenv testenv4
        # First we test the tag
        
        cd testenv1
        source bin/activate
        git clone --depth 1 --branch v${new_version}-rc1 https://github.com/ged-lab/khmer.git
        cd khmer
        make install
        make test
        normalize-by-median.py --version # double-check version number

        # Secondly we test via pip
        
        cd ../../testenv2
        source bin/activate
        pip install -U setuptools==3.4.1
        pip install -e git+https://github.com/ged-lab/khmer.git@v${new_version}-rc1#egg=khmer
        cd src/khmer
        make dist
        make install
        make test
        normalize-by-median.py --version # double-check version number
        cp dist/khmer*tar.gz ../../../testenv3/
        
        # Is the distribution in testenv2 complete enough to build another
        # functional distribution?
        
        cd ../../../testenv3/
        source bin/activate
        pip install -U setuptools==3.4.1
        pip install khmer*tar.gz
        tar xzf khmer*tar.gz
        cd khmer*
        make dist
        make test

#. Publish the new release on the testing PyPI server.  You will need
   to change your PyPI credentials as documented here:
   https://wiki.python.org/moin/TestPyPI.  You may need to reregister:

        python setup.py register --repository test

   Now, upload the new release::

        python setup.py sdist upload -r test

   Test the PyPI release in a new virtualenv::

        cd ../../testenv4
        source bin/activate
        pip install -U setuptools==3.4.1
        pip install screed nose
        pip install -i https://testpypi.python.org/pypi --pre --no-clean khmer
        normalize-by-median.py --version 2>&1 | awk ' { print $2 } '
        cd build/khmer
        ./setup.py nosetests

#. Create the final tag and publish the new release on PyPI (requires an
   authorized account).::

        cd ../../../khmer
        git tag v${new_version}
        python setup.py register sdist upload

#. Delete the release candidate tag and push the tag updates to github.::

        git tag -d v${new_version}-rc1
        git push <EMAIL>:ged-lab/khmer.git
        git push --tags <EMAIL>:ged-lab/khmer.git

#. Make sure any release notes are merged into doc/release-notes/.

#. Add the release on github, using the tag you just pushed.  Name
   it 'version X.Y.Z', and copy and paste in the release notes.

#. Make a binary wheel on OS X.::

        virtualenv build
        cd build
        source bin/activate
        pip install -U setuptools==3.4.1 wheel
        pip install --no-clean khmer==${new_version}
        cd build/khmer
        ./setup.py bdist_wheel upload

#. Update Read the Docs to point to the new version. Visit
   https://readthedocs.org/builds/khmer/ and 'Build Version: master' to pick up
   the new tag. Once that build has finished check the "Activate" box next to
   the new version at https://readthedocs.org/dashboard/khmer/versions/ under
   "Choose Active Versions". Finally change the default version at
   https://readthedocs.org/dashboard/khmer/advanced/ to the new version.

#. Delete any RC tags created::

        git tag -d ${new_version}-rc1
        git push origin :refs/tags/${new_version}-rc1

#. Tweet about the new release.

#. Send email including the release notes to <EMAIL>
   and <EMAIL>

BaTLab testing
--------------

The UW-Madison Build and Test Lab provides the khmer project with a free
cross-platform testing environment.

#. Connect to their head node::

        ssh mcrusoe@submit-1.batlab.org

#. Move into the khmer directory and download a release from PyPI's main server
   or the test PyPI server::

{'fraction_non_alphanumeric': 0.10046200727415708, 'fraction_numerical': 0.00707755824240637, 'mean_word_length': 2.1469223631302197, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 18, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7171244', 'n_tokens_mistral': 3052, 'n_tokens_neox': 2873, 'n_words': 1122}