Abjad packaging checklist:

 1. Open abjad/etc/packaging_transcript.txt and create a new entry.
    Record the date of packaging in the packaging transcript.
    Record the revision of repository in the packaging transcript.

 2.  Document the packaging environment in the packaging transcript.
    (a) Apply any OS updates to the machine on which you will produce the package.
        Record the output of "uname -v" in the packaging transcript.
    (b) Decide whether to upgrade svn.
        OS X svn binaries are available at http://subversion.apache.org/packages.html#osx.
        The openCollabNet universal build maintained by Jeremy Whitlock is recomended.
        Regardless of whether svn is upgraded or not, record the output of "svn --version".
    (c) If necessary, upgrade Python on the packaging machine.
        Python upgrade procedures are OS-dependent.
        Record the output of "python --version" in the packaging transcript.
    (d) Update pip with "sudo pip install --upgrade pip".
        Record the output of "pip --version" in the packaging transcript.
    (e) Update py.test with "pip install py.test".
        Record the output "py.test --version" in the packaging transcript.
    (f) Update Sphinx with "sudo pip install --upgrade Sphinx".
        Record the output of "sphinx-build --version" in the packaging transcript.
    (g) Update LilyPond.
        Record the output of "lilypond --version" in the packaging transcript.
    
 3. Author release notes:
    Open doc/chapters/start_here/abjad/index.rst.
    Add a sentence giving the release date and repository revision number.
    Example: "Released 2009-05-21. Built from r5752."
    Run "scr/devel/count-tools" and "scr/devel/count-source-lines".
    Add a sentence detailing the output of these scripts to this chapter.
    Example: "Implements 405 public classes and 1066 functions totalling 182,000 lines of code."
    Run "svn log --limit 30 | less" (or 40 or whatever) and read output.
    Or run "svn log --revision 4083:4977 | less" and read output in chronological order.
    Read log and write release notes.
    Follow the pattern already established in the document.
    List new features and functionality.
    Highlight significant new functionality with a musical example.
    Begin entries with an active verb in the simple past.
    Order entries by leading verb.
    List adds first and extensions second.
    List changes in user syntax last.

 4. Commit.

 5. Edit abjad/__init__.py and increment '__version__'.

 6. Edit tools/configurationtools/get_abjad_version_string.py and change the
    version number string given in the docstring.

 7. Change to the abjad root directory.
    Run abj-rmpycs. Then run py.test.
    If any tests break, fix, commit and repeat this step.
    Record py.test test results in the packaging transcript.

 8. Change to abjad/tools and run the following three scripts:
    replace-abjad-prompts-with-python-prompts
    run-doctest-on-all-modules-in-tree
    replace-python-prompts-with-abjad-prompts
    If any tests break, fix, commit and go back to (5.)
    Record doctest test results in the packaging transcript.

 9. Start the Abjad interpreter to run one final sanity check.
    Run 'show(Note("c4"))'.
    Then run 'play(Note("c4"))'.
    If either test fails, fix, commit and go back to (5.)
    Record sanity check test results in the packaging transcript.

10. Change back to the abjad root directory and run make-abjad-api.
    You will need Graphviz installed to build the API.
    OS X Graphviz downloads are available at http://www.graphviz.org/Download..php.
    Ubuntu Graphic installation is available with "sudo apt-get install graphviz".
    The HTML version of the API should build with no warnings and no errors.
    If Sphinx gives any warnings or errors, fix, commit and go back to (5.)

11. Change to the abjad/etc/optimization directory.
    Create a v2.x optimization transcript by copying the most recent such file.
    Record memory usage and profiling test results in the optimization transcript.

12. Change to abjad/docs and run 'make clean'.
    This step is important because failing to 'make clean' before building
    the docs can cause the doc tarball made below to exceed 20 megs.
    PyPI rejects doc tarballs greater than 20 megs.

13. Run make-abjad-api. If any errors occur, fix, commit and go back to (5.)
    Record HTML build results in the packaging transcript.

14. Run 'make latex'. If any errors occur, fix, commit and go back to (5.)

15. Run "svn info"
    Note the current revision of the working copy you are packaging.
    Open docs/chapters/start_here/versions/index.rst again.
    Check the revision number indicated there.
    Make sure the revision number equals current revision + 1.

16. Change to docs/_build/latex and run 'make all-pdf'.
    If any errors occur, fix, commit and go back to (5.)
    Open the docs/_build/latex/Abjad.pdf file that results.
    Click around some to make sure everything looks OK.
    Record PDF build results in the packaging transcript.

17. Copy docs/_build/latex/Abjad.pdf to docs/pdf/Abjad-x-y.pdf.
    Do this with 'cp' and not with 'svn cp'.

18. Add docs/pdf/Abajd-x-y.pdf to svn.

19. Remove docs/pdf/Abjad-x-(y-1).pdf from svn.

20. Commit.
    All tests have now passed in the packaging environment.
    All documentation has now built in the packaging environment.

21. For each addition test environment, repeat the following steps:
    [2] documenting the test environment.
    [7], [8], [9] recording py.test, doctest and sanity check test results.
    [13], [16] recording HTML & PDF build results.

22. Complete all addition platform testing.
    Close and save the packaging transcript.
    Commit.

23. Change to abjad/trunk.
    Upgrade setuptools with "sudo pip intall --upgrade setuptools".

24. Run 'python setup.py register sdist upload'
    Follow the login instructions provided by PyPI.
    You must have Abjad package owner credentials for this step to work.
    If you need Abjad package owner credentials, talk to Trevor, Victor or Josiah.
    PyPI will respond with "Server response (200): OK".

25. Remove 'dist' and 'Abjad.egg-info'.
    The directories are no longer needed after upload to PyPI.
    The directories should not be checked into the Abjad repository.

26. Change to docs/_build/html and archive all 9 or 10 files and subdirectories therein.
    You must create a single archive of all 9 or 10 files.
    Through the Finder on the Mac you can shift-click all 9 or 10 files,
    then control-click the selected files and choose "Compress 9 items"
    from the context menu that appears.
    (Note that archiving just the docs/_build/html folder will not work.)
    Name the archive Archive.zip.
    Check the size of the archive.
    The archive must be less than 10 megs.

27. Log in to The PyPI website at pypi.python.org with Abjad owner credentials.
    Click on the Abjad link to edit PyPI's information about the package.

28. At the bottom of the "Package 'Abjad' Editing" page, click on "Choose file"
    and select docs/_build/html/Archive.zip. Then click on "Upload Documentation".
    PyPI will redirect to http://packages.python.org/Abjad/ and the newest version
    of the docs will appear. If it doesn't, debug and fix what went wrong.

29. Click your browser's "back" button to return to the "Package 'Abjad' Editing" page.
    Then click on the "edit" link to the left of the entry for the new x.y version.
    This will take you to the "Submitting package information" page.

30. Manually restore the diacritics in "Víctor Adán" and "Trevor Bača" in the "Author" field.
    (This is necessary because there's a bug in setup.py that fails on UNICODE metadata.
    So UNICODE characters must be added back in by hand on this page of the PyPI website
    rather than being more conveniently read from abjad/trunk/setup.py.)
    ("Josiah Oberholtzer" transmits fine here and doesn't have to be tweaked.)

31. Manually restore the spaces after each of the keyword phrases in
    "music composition, music notation, formalized score control, lilypond"
    in the "Keywords" field. (Again, setup.py mangles these on upload to PyPI.)

32. Click the "Add information" button at the bottom of the page to confirm.
    All PyPI editing and uploading is now complete.

33. Click around PyPI to make sure everything looks correct.
    Then leave PyPI.
    
34. Return to your Abjad sources and remove docs/_build/html/Archive.zip.
    The archive should not be checked in to the Abjad repository.

35. Author release announcement and mail to abjad-user@googlegroups.com.
    Release announcement should recapitulate version history.
    
[2011-08-21, 2011-08-30, 2011-09-12, 2011-09-22, 2012-01-29, 2012-02-27, 2012-05-22, 2012-06-05]
