#!/usr/bin/python2.2
# Moshe -- This seems like 30+ minutes to me!
from slides import PRE, URL, Bullet, NumSlide, Slide, SubBullet
from twslides import Lecture

lecture = Lecture(
    "Managing the Release of a Large Python Project",
    Slide(
        "About Twisted",
        Bullet("Networking framework"),
        Bullet("Other goodies"),
        Bullet("60,000 lines of code"),
        Bullet("Things can (and do) go wrong"),
    ),
    Slide(
        "Python",
        Bullet("Recap"),
        Bullet("No compilation (except for native modules)"),
        Bullet("Simple file-based modules (no registration)"),
        Bullet("Distutils -- Does the common things"),
    ),
    Slide(
        "Release Procedure -- Steps",
        Bullet("Increment version in copyright file, README"),
        Bullet("Tag release"),
        Bullet("Export from CVS"),
        Bullet("Rename toplevel directory"),
        Bullet("Generate API and HOWTO documentation"),
        Bullet("Create tarballs"),
        Bullet("Move tarballs to target area"),
        Bullet("Create Debian packages"),
        Bullet("Put Debian packages in final place"),
        Bullet("Upgrade production machine"),
    ),
    Slide(
        "Release Procedure Overview - Documentation",
        Bullet("Man pages -> Lore"),
        Bullet("Lore documents -> HTML"),
        Bullet("Lore documents -> PS/PDF"),
        Bullet("API documentation -> HTML"),
    ),
    Slide(
        "Release Procedure Overview - Testing",
        Bullet("Run of the mill unit tests"),
        Bullet("Acceptance tests of less portable things"),
        Bullet("Prerelease tests for twistedmatrix.com-specific test"),
        Bullet("twistedmatrix.com uses latest version  -- always!"),
    ),
    Slide(
        "Release Procedure Overview - Debian",
        Bullet("The Twisted machines use Debian packages"),
        Bullet("The Twisted machines run latest version"),
        Bullet("Debian packages are built as part of the release procedure"),
    ),
    Slide(
        "Overview Summary",
        Bullet("Many steps"),
        Bullet(
            "Each can fail",
            SubBullet(
                Bullet("Documentation can fail to build"),
                Bullet("Tests can fail"),
                Bullet("Debian packages can fail to build"),
            ),
        ),
        Bullet("Need robust automated setup"),
    ),
    Slide(
        "Enter Release-Twisted",
        Bullet("Python program to release Twisted"),
        Bullet("Key word -- Robust"),
        Bullet("Based on actions which can undo"),
        Bullet("Flexible - able to recover a botched build from the middle"),
        Bullet("Easy - has good defaults"),
    ),
    Slide(
        "Testing - Recap",
        Bullet("Testing is special - no effect"),
        Bullet("The more, the better"),
        Bullet(
            "Harder to automate - machines can't tell right from wrong",
            SubBullet(Bullet("Except in Hollywood")),
        ),
    ),
    Slide(
        "Different Kinds of Tests - Unit Tests",
        Bullet("Completely automated"),
        Bullet("Completely machine-verifiable"),
        Bullet("Portable"),
        Bullet("Must always pass"),
    ),
    Slide(
        "Different Kinds of Tests - Acceptance Tests",
        Bullet("Interacts with user"),
        Bullet("Probably works only on Linux"),
        Bullet("Assumes many client side tools"),
        Bullet("Exercises many parts of Twisted which are hard in unit tests"),
    ),
    Slide(
        "Acceptance Tests Examples",
        Bullet("Run Twisted web server, run user-defined web browser"),
        Bullet("Run mail server, send mail and try to download with pop3"),
        Bullet("Run IRC server, run user-defined IRC client"),
    ),
    Slide(
        "Different Kinds of Tests - Prerelease Tests",
        Bullet("TwistedMatrix.com dogfoods"),
        Bullet("We want to test the dog food"),
        Bullet(
            "prerelease tests convince us that this version doesn't break " "completely"
        ),
        Bullet("Among other things, tests that distributed web works"),
    ),
    Slide(
        "Epydoc",
    ),
    Slide(
        "Epyrun",
    ),
    Slide(
        "Distutils -- Datafiles",
    ),
    Slide(
        "Distutils -- Conditional compilation",
    ),
    Slide(
        "Distutils -- Conditional compilation woes",
    ),
    Slide(
        "Distutils -- Other woes",
        Bullet("Versions -- keywords were added later"),
        Bullet("Icky to do platform dependent stuff"),
    ),
    Slide(
        "release-twistd -- master script",
    ),
    Slide(
        "Commit/rollback",
    ),
    Slide(
        "CVS and tagging",
    ),
    Slide(
        "Debian Packages -- Challenges",
        Bullet("Versioning: We want 1.0.2alpha4 to precede 1.0.2"),
        Bullet("Dependencies: Which versions of Python? 2.1? 2.2? 2.3?"),
        Bullet("Dependencies: Which libc version?"),
    ),
    Slide(
        "Debian Packages -- Solutions",
        Bullet("Build two sets -- for Debian stable and for Debian unstable"),
        Bullet(
            "When building on stable, remove python2.3-dev from build" " dependencies",
            SubBullet(Bullet("This stops the Python 2.3 version from being built")),
        ),
        Bullet("If building a non-final version, name it 1.0.1+1.0.2alpha4"),
        Bullet("Unstable build is done by sshing into an unstable chroot"),
    ),
    Slide(
        "Windows Releases -- Challenges",
    ),
    Slide(
        "Windows Releases -- Solutions",
    ),
    Slide(
        "Why Not Dependency Management?",
    ),
    Slide(
        "Conclusions",
        Bullet("Distutils does not do enough"),
        Bullet("Cross compiling is hard"),
        Bullet("It would be nice if Python had integrated docstring tools"),
        Bullet("Wheel reinvention is useful"),
    ),
    Slide(
        "Future Directions",
        Bullet("RPMs for Various Distributions"),
        Bullet("More automation"),
    ),
    Slide(
        "Questions?",
    ),
)

lecture.renderHTML(".", "releasing-%d.html", css="main.css")
