import os import sys import paver from paver.easy import options, Bunch import paver.setuputils import pkg_resources #pylint: disable=unused-import from runestone import build # build is called implicitly by the paver driver. paver.setuputils.install_distutils_tasks() sys.path.append(os.getcwd()) home_dir = os.getcwd() master_url = 'http://127.0.0.1:8000' master_app = 'runestone' serving_dir = "./_build" dest = "../../static" options( sphinx=Bunch(docroot=".", ), build=Bunch( builddir="./_build", sourcedir="_sources", outdir="./_build", confdir=".", project_name="Uputstvo_autorima", # leave template_args empty, use html_context from conf.py template_args={}))
import shutil import tempfile from StringIO import StringIO from urllib2 import urlopen import zipfile from paver.easy import (Bunch, call_task, cmdopts, info, options, path, pushd, sh, task) BASEDIR = os.path.abspath(os.path.dirname(__file__)) options(base=Bunch( home=path(BASEDIR), docs=path('%s/docs' % BASEDIR), instance=path('%s/instance' % BASEDIR), pot=path('%s/GeoHealthCheck/translations/en/LC_MESSAGES/messages.po' % BASEDIR), static_docs=path('%s/GeoHealthCheck/static/docs' % BASEDIR), static_lib=path('%s/GeoHealthCheck/static/lib' % BASEDIR), tmp=path(tempfile.mkdtemp()), translations=path('%s/GeoHealthCheck/translations' % BASEDIR)), ) @task def setup(): """setup plugin dependencies""" config_file = options.base.home / 'GeoHealthCheck/config_main.py' config_site = options.base.instance / 'config_site.py' # setup dirs if not os.path.exists(options.base.static_lib):
RELEASE = 'doc/release/1.2.0-notes.rst' # Start/end of the log (from git) LOG_START = 'v1.1.0' LOG_END = 'master' #------------------------------------------------------- # Hardcoded build/install dirs, virtualenv options, etc. #------------------------------------------------------- # Default python version PYVER = "2.7" # Paver options object, holds all default dirs options( bootstrap=Bunch(bootstrap_dir="bootstrap"), virtualenv=Bunch(packages_to_install=["sphinx==1.1.3", "numpydoc"], no_site_packages=False), sphinx=Bunch(builddir="build", sourcedir="source", docroot='doc'), superpack=Bunch(builddir="build-superpack", bindir=os.path.join("build-superpack", "binaries")), installers=Bunch(releasedir="release", installersdir=os.path.join("release", "installers")), doc=Bunch(doc_root="doc", sdir=os.path.join("doc", "source"), bdir=os.path.join("doc", "build"), bdir_latex=os.path.join("doc", "build", "latex"), destdir_pdf=os.path.join("build_doc", "pdf")), html=Bunch(builddir=os.path.join("build", "html")), dmg=Bunch(python_version=PYVER), bdist_wininst_simple=Bunch(python_version=PYVER),
import re import os from functools import partial from paver import doctools from paver.easy import options, Bunch, task, sh, BuildFailure from paver.path25 import path, pushd options( sphinx=Bunch( builddir='_build', ) ) def managepy(project, cmd): sh('python %s/manage.py %s' % (project, cmd)) def read_requirements(filename): """ Read pip requirements file and return it's canonical form in a string -- without unnecessary whitespace, comments and sorted alphabetically. """ strip_whitespace = partial(map, str.strip) remove_empty_lines = partial(filter, None) strip_comments = partial(filter, lambda line: not line.startswith('#')) return ( '\n'.join( sorted(
RELEASE = 'doc/release/0.9.0-notes.rst' # Start/end of the log (from git) LOG_START = 'svn/tags/0.8.0' LOG_END = 'master' # Virtualenv bootstrap stuff BOOTSTRAP_DIR = "bootstrap" BOOTSTRAP_PYEXEC = "%s/bin/python" % BOOTSTRAP_DIR BOOTSTRAP_SCRIPT = "%s/bootstrap.py" % BOOTSTRAP_DIR # Where to put the final installers, as put on sourceforge RELEASE_DIR = 'release' INSTALLERS_DIR = os.path.join(RELEASE_DIR, 'installers') options(sphinx=Bunch(builddir="build", sourcedir="source", docroot='doc'), virtualenv=Bunch(script_name=BOOTSTRAP_SCRIPT, packages_to_install=["sphinx==1.0.4"]), wininst=Bunch(pyver=PYVER, scratch=True)) def parse_numpy_version(pyexec): if isinstance(pyexec, str): cmd = [pyexec, "-c", "'import numpy; print numpy.version.version'"] else: # sequence for pyexec cmd = pyexec + ["-c", "'import numpy; print numpy.version.version'"] # Execute in shell because launching python from python does not work # (hangs) p = subprocess.Popen(" ".join(cmd), stdout=subprocess.PIPE, shell=True)
from paver.easy import task, needs, sh, path, options, Bunch, BuildFailure, dry import paver.doctools import sys try: import sphinx has_sphinx = True except ImportError: has_sphinx = False util.update( options.paved, dict( docs = Bunch( path = path('./docs'), targets = ['html'], build_rel = '_build/html', upload_location = False, ), ) ) __all__ = ['sphinx_make', 'docs', 'clean_docs', 'rsync_docs', 'ghpages', 'showhtml', 'showpdf','pdf'] def sphinx_make(*targets): """Call the Sphinx Makefile with the specified targets. `options.paved.docs.path`: the path to the Sphinx folder (where the Makefile resides). """ sh('make %s' % ' '.join(targets), cwd=options.paved.docs.path)
#----------------------------------- # Things to be changed for a release #----------------------------------- # Path to the release notes RELEASE_NOTES = 'doc/source/release/1.21.0-notes.rst' #------------------------------------------------------- # Hardcoded build/install dirs, virtualenv options, etc. #------------------------------------------------------- # Where to put the release installers options(installers=Bunch(releasedir="release", installersdir=os.path.join("release", "installers")),) #----------------------------- # Generate the release version #----------------------------- sys.path.insert(0, os.path.dirname(__file__)) try: setup_py = __import__("setup") FULLVERSION = setup_py.VERSION # This is duplicated from setup.py if os.path.exists('.git'): GIT_REVISION = setup_py.git_version() elif os.path.exists('numpy/version.py'): # must be a source distribution, use existing version file
import xml.etree.ElementTree as etree import xmlrpclib import zipfile from paver.easy import (call_task, cmdopts, error, info, needs, options, path, pushd, sh, task, Bunch) PLUGIN_NAME = 'MetaSearch' BASEDIR = os.path.abspath(os.path.dirname(__file__)) USERDIR = os.path.expanduser('~') options(base=Bunch(home=BASEDIR, docs=path(BASEDIR) / 'docs', plugin=path('%s/plugin/MetaSearch' % BASEDIR), ui=path(BASEDIR) / 'plugin' / PLUGIN_NAME / 'ui', install=path('%s/.qgis2/python/plugins/MetaSearch' % USERDIR), ext_libs=path('plugin/MetaSearch/ext-libs'), tmp=path(path('%s/MetaSearch-dist' % USERDIR)), version=open('VERSION.txt').read().strip()), upload=Bunch(host='plugins.qgis.org', port=80, endpoint='plugins/RPC2/')) @task def setup(): """setup plugin dependencies""" if not os.path.exists(options.base.ext_libs): sh('pip install -r requirements.txt --target=%s' %
import os import sys from paver.easy import path, sh, needs, task, options, Bunch, cmdopts PYCOMPILE_CACHES = ['*.pyc', '*$py.class'] options( sphinx=Bunch(builddir='.build'), ) def sphinx_builddir(options): return path('docs') / options.sphinx.builddir / 'html' @task def clean_docs(options): sphinx_builddir(options).rmtree() @task @needs('clean_docs', 'paver.doctools.html') def html(options): destdir = path('Documentation') destdir.rmtree() builtdocs = sphinx_builddir(options) builtdocs.move(destdir) @task
from owslib.csw import CatalogueServiceWeb # spellok PLUGIN_NAME = 'MetaSearch' BASEDIR = os.path.abspath(os.path.dirname(__file__)) USERDIR = os.path.expanduser('~') with open('metadata.txt') as mf: cp = ConfigParser() cp.readfp(mf) VERSION = cp.get('general', 'version') options(base=Bunch(home=BASEDIR, plugin=path(BASEDIR), ui=path(BASEDIR) / 'plugin' / PLUGIN_NAME / 'ui', install=path('%s/.qgis3/python/plugins/MetaSearch' % USERDIR), ext_libs=path('plugin/MetaSearch/ext-libs'), tmp=path(path('%s/MetaSearch-dist' % USERDIR)), version=VERSION), upload=Bunch(host='plugins.qgis.org', port=80, endpoint='plugins/RPC2/')) @task def clean(): """clean environment""" if os.path.exists(options.base.install): if os.path.islink(options.base.install): os.unlink(options.base.install)
setup( name="PyMOTW-3", packages=[], version="1.0", url="https://pymotw.com/3/", author="Doug Hellmann", author_email="*****@*****.**" ) options( sphinx=Bunch( docroot='.', builddir='build', sourcedir='source', warnerror=True, ), # Some of the files include [[[ as part of a nested list data # structure, so change the tags cog looks for to something # less likely to appear. cog=Bunch( beginspec='{{{cog', endspec='}}}', endoutput='{{{end}}}', ), pdf=Bunch( builder='latex', docroot='.',
import paver.setuputils import pkg_resources #pylint: disable=unused-import from runestone import build # build is called implicitly by the paver driver. paver.setuputils.install_distutils_tasks() sys.path.append(os.getcwd()) home_dir = os.getcwd() master_url = '{{master_url}}' master_app = '{{master_app}}' serving_dir = "{{build_dir}}" dest = "{{dest}}" version = pkg_resources.require("runestone")[0].version options( sphinx = Bunch(docroot=".",), build = Bunch( builddir="{{build_dir}}", sourcedir="_sources", outdir="{{build_dir}}", confdir=".", project_name = "{{project_name}}", # leave template_args empty, use html_context from conf.py template_args= {} ) )
def generate_data_files(toplevel, filters=None): 'make a pair (dir, [list-of-files] ) for all dirs in toplevel' return ([(toplevel, list(path(toplevel).walkfiles()))] + [(str(d), list(d.walkfiles())) for d in path(toplevel).walkdirs()]) options( setup=dict( name='BisQue', version="0.5.9", author="Center for BioImage Informatics, UCSB", author_email="*****@*****.**", #data_files = [ ('config-defaults', glob.glob ('config-defaults/*') )], #data_files = generate_data_files ('./contrib') + generate_data_files ('./config-defaults'), ), virtualenv=Bunch(packages_to_install=['pip'], paver_command_line="required"), sphinx=Bunch(builddir="build", sourcedir="docs/source"), license=Bunch( extensions=set([("py", "#"), ("js", "//")]), exclude=set([ './ez_setup', './data', './tg2env', './docs', # Things we don't want to add our license tag to ])), ) feature_subdirs = ['bqfeature'] server_subdirs = ['bqapi', 'bqcore', 'bqserver', 'bqengine'] engine_subdirs = ['bqapi', 'bqcore', 'bqengine']
entry_points=entry_points, classifiers=[ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ]) options( minilib=Bunch( # 'version' is included as workaround to https://github.com/paver/paver/issues/112, TODO: remove extra_files=['virtual', 'svn', 'version']), virtualenv=Bunch(paver_command_line='develop'), # sphinxcontrib.paverutils sphinx=Bunch(docroot='docs', builddir='build', builder='html', confdir='docs'), ) def set_init_version(ver): """Replaces the version with ``ver`` in _version.py""" import fileinput for line in fileinput.FileInput('flexget/_version.py', inplace=1): if line.startswith('__version__ = '):
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # # ================================================================= import os import shutil from urllib2 import urlopen from paver.easy import Bunch, cmdopts, options, path, task options(app=Bunch( home=path('app'), voc= 'https://raw.githubusercontent.com/OSGeo/Cat-Interop/%s/LinkPropertyLookupTable.csv', # noqa build=path('app/build'), version=open('VERSION.txt').read().strip())) @task def setup(): """setup install""" if not os.path.exists(options.app.build): options.app.build.mkdir() if not os.path.exists(options.app.build / 'LinkPropertyLookupTable.csv'): if options.app.version.endswith('-dev'): # master url = options.app.voc % 'master' else: url = options.app.voc % options.app.version
sys.path.append(os.getcwd()) # The project name, for use below. project_name = 'armTutorial' master_url = 'http://127.0.0.1:8000' if not master_url: master_url = get_master_url() # The root directory for ``runestone serve``. serving_dir = "./build/" + project_name # The destination directory for ``runestone deploy``. dest = "./static" options( sphinx=Bunch(docroot=".", ), build=Bunch( builddir=serving_dir, sourcedir="_sources", outdir=serving_dir, confdir=".", template_args={ 'login_required': 'false', 'loglevel': 0, 'course_title': 'ARMTutorial', 'python3': 'false', 'dburl': '', 'default_ac_lang': 'python', 'jobe_server': 'http://jobe2.cosc.canterbury.ac.nz', 'proxy_uri_runs': '/jobe/index.php/restapi/runs/', 'proxy_uri_files': '/jobe/index.php/restapi/files/',