From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QYFeE-0001OC-H5 for garchives@archives.gentoo.org; Sun, 19 Jun 2011 10:54:34 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 556881C056; Sun, 19 Jun 2011 10:54:27 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 25CF21C056 for ; Sun, 19 Jun 2011 10:54:27 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ADFBD1B402B for ; Sun, 19 Jun 2011 10:54:26 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 0A68F8003E for ; Sun, 19 Jun 2011 10:54:26 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <54bb7aea747dbf9ddc67fe06434a7b21660b2fdd.mgorny@gentoo> Subject: [gentoo-commits] proj/pms-test-suite:master commit in: / X-VCS-Repository: proj/pms-test-suite X-VCS-Files: setup.py X-VCS-Directories: / X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 54bb7aea747dbf9ddc67fe06434a7b21660b2fdd Date: Sun, 19 Jun 2011 10:54:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 7c72a3c20720e0daddf07ca59335978d commit: 54bb7aea747dbf9ddc67fe06434a7b21660b2fdd Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Sun Jun 19 10:54:30 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Sun Jun 19 10:54:30 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3D54bb7aea Add a distutils command to build docs. --- setup.py | 38 ++++++++++++++++++++++++++++++++++++-- 1 files changed, 36 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 5018d21..7cf346f 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ # (c) 2011 Micha=C5=82 G=C3=B3rny # Released under the terms of the 2-clause BSD license. =20 -from distutils.core import setup, Command +from distutils.core import setup, Command, Distribution =20 import os.path, sys =20 @@ -13,6 +13,32 @@ try: except ImportError: PV =3D 'unknown' =20 +class DocCommand(Command): + user_options =3D [] + + def __init__(self, distr): + Command.__init__(self, distr) + self.docs =3D distr.docs + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + try: + import markdown + except ImportError: + sys.stderr.write('Doc generation requires the markdown module:\nhttp:= //www.freewisdom.org/projects/python-markdown\n') + sys.exit(1) + + m =3D markdown.Markdown() + for f in self.docs: + d =3D '%s.html' % os.path.splitext(f)[0] + print('Creating %s (from %s)' % (d, f)) + m.convertFile(f, d) + class TestCommand(Command): user_options =3D [] =20 @@ -45,6 +71,9 @@ class TestCommand(Command): res =3D r.run(tests) sys.exit(0 if res.wasSuccessful() else 1) =20 +class DocDistribution(Distribution): + docs =3D [] + setup( name =3D 'pms-test-suite', version =3D PV, @@ -63,6 +92,9 @@ setup( scripts =3D [ 'pms-tester' ], + docs =3D [ + 'doc/library-format.md' + ], =20 classifiers =3D [ 'Development Status :: 2 - Pre-Alpha', @@ -77,6 +109,8 @@ setup( ], =20 cmdclass =3D { + 'doc': DocCommand, 'test': TestCommand - } + }, + distclass =3D DocDistribution )