From 9e716ec99b2f562421e6cde9056e6f21219c2cf3 Mon Sep 17 00:00:00 2001 From: "Ville M. Vainio" Date: Thu, 22 May 2008 19:44:30 +0300 Subject: [PATCH 1/3] Updated setup.py and do_sphinx.py for new manual distribution --- setup.py | 60 ++++++++++++++++++++++---------------------------------- 1 file changed, 23 insertions(+), 37 deletions(-) diff --git a/setup.py b/setup.py index 20daf9f6a..877840d85 100755 --- a/setup.py +++ b/setup.py @@ -46,43 +46,25 @@ from distutils.core import setup # update the manuals when building a source dist if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'): + import textwrap from IPython.genutils import target_update # list of things to be updated. Each entry is a triplet of args for # target_update() - to_update = [('doc/magic.tex', - ['IPython/Magic.py'], - "cd doc && ./update_magic.sh" ), - - ('doc/manual.lyx', - ['IPython/Release.py','doc/manual_base.lyx'], - "cd doc && ./update_version.sh" ), - - ('doc/manual/manual.html', - ['doc/manual.lyx', - 'doc/magic.tex', - 'doc/examples/example-gnuplot.py', - 'doc/examples/example-embed.py', - 'doc/examples/example-embed-short.py', - 'IPython/UserConfig/ipythonrc', - ], - "cd doc && " - "lyxport -tt --leave --pdf " - "--html -o '-noinfo -split +1 -local_icons' manual.lyx"), - - ('doc/new_design.pdf', - ['doc/new_design.lyx'], - "cd doc && lyxport -tt --pdf new_design.lyx"), - - ('doc/ipython.1.gz', - ['doc/ipython.1'], - "cd doc && gzip -9c ipython.1 > ipython.1.gz"), - - ('doc/pycolor.1.gz', - ['doc/pycolor.1'], - "cd doc && gzip -9c pycolor.1 > pycolor.1.gz"), - ] - for target in to_update: - target_update(*target) + + def oscmd(s): + cwd = os.getcwd() + for l in textwrap.dedent(s).splitlines(): + print ">", l.strip() + os.system(l.strip()) + + os.chdir(cwd) + + oscmd("""\ + cd doc + python do_sphinx.py""") + + oscmd("cd doc && gzip -9c ipython.1 > ipython.1.gz") + oscmd("cd doc && gzip -9c pycolor.1 > pycolor.1.gz") # Release.py contains version, authors, license, url, keywords, etc. execfile(pjoin('IPython','Release.py')) @@ -113,9 +95,12 @@ exclude = ('.sh','.1.gz') docfiles = filter(lambda f:file_doesnt_endwith(f,exclude),glob('doc/*')) examfiles = filter(isfile, glob('doc/examples/*.py')) -manfiles = filter(isfile, glob('doc/manual/*.html')) + \ - filter(isfile, glob('doc/manual/*.css')) + \ - filter(isfile, glob('doc/manual/*.png')) +manfiles = filter(isfile, glob('doc/build/html/*')) +manstatic = filter(isfile, glob('doc/build/html/_static/*')) + +# filter(isfile, glob('doc/manual/*.css')) + \ +# filter(isfile, glob('doc/manual/*.png')) + manpages = filter(isfile, glob('doc/*.1.gz')) cfgfiles = filter(isfile, glob('IPython/UserConfig/*')) scriptfiles = filter(isfile, ['scripts/ipython','scripts/pycolor', @@ -135,6 +120,7 @@ if 'bdist_wininst' in sys.argv: datafiles = [('data', docdirbase, docfiles), ('data', pjoin(docdirbase, 'examples'),examfiles), ('data', pjoin(docdirbase, 'manual'),manfiles), + ('data', pjoin(docdirbase, 'manual/_static'),manstatic), ('data', manpagebase, manpages), ('data',pjoin(docdirbase, 'extensions'),igridhelpfiles), ] From 1e114fb69e58a4216020d2b45b106fb71856209d Mon Sep 17 00:00:00 2001 From: "Ville M. Vainio" Date: Thu, 22 May 2008 21:11:35 +0300 Subject: [PATCH 2/3] fix do_sphinx running in setup.py --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 877840d85..d01b27bc1 100755 --- a/setup.py +++ b/setup.py @@ -60,8 +60,7 @@ if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'): os.chdir(cwd) oscmd("""\ - cd doc - python do_sphinx.py""") + cd doc && python do_sphinx.py""") oscmd("cd doc && gzip -9c ipython.1 > ipython.1.gz") oscmd("cd doc && gzip -9c pycolor.1 > pycolor.1.gz") From 16cc23ec97f2e7169b7daefede9a69bcbfff3a73 Mon Sep 17 00:00:00 2001 From: "Ville M. Vainio" Date: Thu, 22 May 2008 21:57:52 +0300 Subject: [PATCH 3/3] docs: remove build crap from sdist with manifest.in --- setup.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index d01b27bc1..65944b3b9 100755 --- a/setup.py +++ b/setup.py @@ -52,15 +52,10 @@ if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'): # target_update() def oscmd(s): - cwd = os.getcwd() - for l in textwrap.dedent(s).splitlines(): - print ">", l.strip() - os.system(l.strip()) + print ">", s + os.system(s) - os.chdir(cwd) - - oscmd("""\ - cd doc && python do_sphinx.py""") + oscmd("cd doc && python do_sphinx.py") oscmd("cd doc && gzip -9c ipython.1 > ipython.1.gz") oscmd("cd doc && gzip -9c pycolor.1 > pycolor.1.gz")