Commit 9fa9d23c by Eric Coissac

Switch to the version 1.1.2

Add the exports of the doc in html epub and man pages
Modify the obitool script to setup the path to export/bin
parent bb4170df
......@@ -27,11 +27,16 @@ class build(ori_build):
def has_pidname(self):
return is_mac_system()
def has_doc(self):
return True
sub_commands = [('littlebigman', has_littlebigman),
('pidname',has_pidname),
('build_ctools', has_ctools),
('build_files', has_files),
('build_cexe', has_executables)] \
+ ori_build.sub_commands
+ ori_build.sub_commands + \
[('build_sphinx',has_doc)]
'''
Created on 10 mars 2015
@author: coissac
'''
from sphinx.setup_command import BuildDoc as ori_build_sphinx
class build_sphinx(ori_build_sphinx):
'''
Build Sphinx documentation in html, epub and man formats
'''
description = __doc__
def run(self):
self.builder='html'
self.finalize_options()
ori_build_sphinx.run(self)
self.builder='epub'
self.finalize_options()
ori_build_sphinx.run(self)
self.builder='man'
self.finalize_options()
ori_build_sphinx.run(self)
\ No newline at end of file
......@@ -11,4 +11,4 @@ class install(install_ori):
def __init__(self,dist):
install_ori.__init__(self, dist)
self.sub_commands.insert(0, ('build',lambda self: True))
self.sub_commands.append(('install_sphinx',lambda self: self.distribution.serenity))
......@@ -13,7 +13,8 @@ class install_scripts(ori_install_scripts):
def initialize_options(self):
ori_install_scripts.initialize_options(self)
self.deprecated_scripts = None
self.public_dir = None
def revove_dot_py(self):
for filename in self.get_outputs():
pyfile = "%s.py" % filename
......@@ -28,8 +29,23 @@ class install_scripts(ori_install_scripts):
except:
log.info('Unix command %s is not present in build dir' % command)
def remove_deprecated_script(self):
def install_public_link(self):
self.mkpath(self.public_dir)
for file in self.get_outputs():
if self.dry_run:
log.info("changing mode of %s", file)
else:
log.info("exporting file %s -> %s", file,os.path.join(self.public_dir,
os.path.split(file)[1]
))
dest = os.path.join(self.public_dir,
os.path.split(file)[1]
)
if os.path.exists(dest):
os.unlink(dest)
os.symlink(file,dest)
def remove_deprecated_script(self):
if self.deprecated_scripts is not None:
for f in self.deprecated_scripts:
try:
......@@ -46,8 +62,13 @@ class install_scripts(ori_install_scripts):
def run(self):
self.remove_deprecated_script()
ori_install_scripts.run(self)
if self.distribution.serenity:
self.public_dir=os.path.join(self.install_dir,"../export/bin")
self.public_dir=os.path.abspath(self.public_dir)
self.install_public_link()
self.revove_dot_py()
......@@ -23,11 +23,13 @@ from distutils.extension import Extension
from obidistutils.command.build import build
from obidistutils.command.littlebigman import littlebigman
from obidistutils.command.build_cexe import build_cexe
from obidistutils.command.build_sphinx import build_sphinx
from obidistutils.command import build_ext
from obidistutils.command.build_ctools import build_ctools
from obidistutils.command.build_files import build_files
from obidistutils.command.build_scripts import build_scripts
from obidistutils.command.install_scripts import install_scripts
from obidistutils.command.install_sphinx import install_sphinx
from obidistutils.command.install import install
from obidistutils.command.pidname import pidname
......@@ -122,7 +124,9 @@ COMMANDS = {'build':build,
'build_cexe':build_cexe,
'build_ext': build_ext,
'build_scripts':build_scripts,
'build_sphinx':build_sphinx,
'install_scripts':install_scripts,
'install_sphinx':install_sphinx,
'install':install}
CTOOLS =[]
......@@ -177,6 +181,9 @@ def setup(**attrs):
if 'sse' not in attrs:
attrs['sse']=None
if 'serenity' not in attrs:
attrs['serenity']=False
EXTENTION=findCython(SRC)
......
......@@ -17,6 +17,7 @@ class Distribution(ori_Distribution):
self.deprecated_scripts = None
self.zip_safe=False
self.sse = None
self.serenity=attrs['serenity']
ori_Distribution.__init__(self, attrs)
......@@ -29,6 +30,7 @@ class Distribution(ori_Distribution):
"By default the name is PACKAGE-VERSION"
))
def has_executables(self):
return self.executables is not None and self.executables
......
......@@ -108,4 +108,6 @@ def serenity_mode(package,version):
log.set_threshold(old)
return args.serenity
......@@ -56,6 +56,11 @@ json:
@echo
@echo "Build finished; now you can process the JSON files."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
......
......@@ -12,6 +12,7 @@
# serve to show the default.
import sys, os
import glob
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
......@@ -61,7 +62,7 @@ master_doc = 'index'
# General information about the project.
project = u'OBITools'
copyright = u'2009 - 2013, OBITool Development Team'
copyright = u'2009 - 2015, OBITool Development Team'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
......@@ -244,3 +245,18 @@ PygmentsBridge.latex_formatter = CustomLatexFormatter
epub_publisher=u"metabarcoding.org"
epub_author=u"OBITools Development Team"
#--options for the man format -------------------------------
man_pages = []
for f in glob.glob('scripts/*.rst'):
man_pages.append((
f[:-4], # source file (no extension)
os.path.split(f[:-4])[1], # output file (under output dir)
'description of %s' % os.path.split(f[:-4])[1], # description
'The OBITools Development Team - LECA', # author
1, # section
))
......@@ -37443,10 +37443,40 @@ def main():
with open(activate,"w") as fp:
print >>fp, install_script % (virtualenvname,SOFT,SOFT)
print >>fp
st = os.stat(activate)
os.chmod(activate, st.st_mode | stat.S_IEXEC)
envactivate = open(os.path.join(virtualenvname,'bin','activate')).readlines()
line=0
try:
while True:
if envactivate[line]=='PATH="$VIRTUAL_ENV/bin:$PATH"\n':
envactivate[line]='PATH="$VIRTUAL_ENV/export/bin:$PATH"\n'
envactivate.insert(line+2,'export MANPATH="$VIRTUAL_ENV/export/share/man:$MANPATH"\n')
line+=1
except IndexError:
pass
print >>open(os.path.join(virtualenvname,'bin','activate'),"w"),"".join(envactivate)
envactivate = open(os.path.join(virtualenvname,'bin','activate.csh')).readlines()
line=0
try:
while True:
if envactivate[line]=='setenv PATH "$VIRTUAL_ENV/bin:$PATH"\n':
envactivate[line]='setenv PATH "$VIRTUAL_ENV/export/bin:$PATH"\n'
envactivate.insert(line+1,'setenv MANPATH "$VIRTUAL_ENV/export/share/man:$MANPATH"\n')
line+=1
except IndexError:
pass
print >>open(os.path.join(virtualenvname,'bin','activate.csh'),"w"),"".join(envactivate)
shutil.rmtree(os.path.join(virtualenvname,'src'), ignore_errors=True)
shutil.copytree(filename, os.path.join(virtualenvname,'src'), symlinks=True)
......@@ -19,7 +19,7 @@ from os import path
PACKAGE = "OBITools"
VERSION = "1.1.001"
VERSION = "1.1.2"
AUTHOR = 'Eric Coissac'
EMAIL = 'eric@coissac.eu'
URL = 'metabarcoding.org/obitools'
......@@ -34,7 +34,7 @@ if __name__=="__main__":
from obidistutils.serenity import serenity_mode
serenity_mode(PACKAGE,VERSION)
serenity=serenity_mode(PACKAGE,VERSION)
from obidistutils.core import setup
from obidistutils.core import CTOOLS
......@@ -66,6 +66,7 @@ if __name__=="__main__":
license=LICENSE,
url=URL,
python_src=SRC,
sse='sse2')
sse='sse2',
serenity=serenity)
......@@ -20,8 +20,8 @@ into an ecoPCR database. The formated database include the taxonomy as defined b
> obipr2
This command downloads and formats the latest version of the PR2 database from
the official `PR2 web site<http://ssu-rrna.org/pr2/>`_.
This command downloads and formats the latest version of the PR2 database from
the official `PR2 web site<http://ssu-rrna.org/pr2/>`_.
.. codeauthor:: Eric Coissac <eric.coissac@metabarcoding.org>
......
major = 1
minor = 1
serial= '001'
serial= '2'
version = "%2d.%02d %s" % (major,minor,serial)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment