invocations-0.6.2/000755 000765 000024 00000000000 12411365640 015023 5ustar00jforcierstaff000000 000000 invocations-0.6.2/dev-requirements.txt000644 000765 000024 00000000046 12313432017 021055 0ustar00jforcierstaff000000 000000 # Dev version of Invoke invoke>=0.7.0 invocations-0.6.2/invocations/000755 000765 000024 00000000000 12411365640 017357 5ustar00jforcierstaff000000 000000 invocations-0.6.2/invocations.egg-info/000755 000765 000024 00000000000 12411365640 021051 5ustar00jforcierstaff000000 000000 invocations-0.6.2/LICENSE000644 000765 000024 00000002442 12260703301 016022 0ustar00jforcierstaff000000 000000 Copyright (c) 2014 Jeff Forcier. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. invocations-0.6.2/MANIFEST.in000644 000765 000024 00000000100 12243517640 016552 0ustar00jforcierstaff000000 000000 include LICENSE include README.rst include dev-requirements.txt invocations-0.6.2/PKG-INFO000644 000765 000024 00000002036 12411365640 016121 0ustar00jforcierstaff000000 000000 Metadata-Version: 1.0 Name: invocations Version: 0.6.2 Summary: Reusable Invoke tasks Home-page: http://pyinvoke.org Author: Jeff Forcier Author-email: jeff@bitprophet.org License: BSD Description: UNKNOWN Platform: UNKNOWN Classifier: Development Status :: 3 - Alpha Classifier: Environment :: Console Classifier: Intended Audience :: Developers Classifier: Intended Audience :: System Administrators Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: Unix Classifier: Operating System :: POSIX Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Topic :: Software Development Classifier: Topic :: Software Development :: Build Tools Classifier: Topic :: Software Development :: Libraries Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: System :: Software Distribution Classifier: Topic :: System :: Systems Administration invocations-0.6.2/README.rst000644 000765 000024 00000000723 12243522054 016511 0ustar00jforcierstaff000000 000000 Invocations is a collection of reusable `Invoke `_ tasks/task modules, including (but not limited to) Python project management tools such as documentation building and dependency organization. It has no stand-alone components and is designed to be imported into your pre-existing Invoke task files. Invocations is currently in pre-alpha status and is unsupported. Please follow the Invoke project's communication channels for updates. Thanks! invocations-0.6.2/setup.cfg000644 000765 000024 00000000073 12411365640 016644 0ustar00jforcierstaff000000 000000 [egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 invocations-0.6.2/setup.py000644 000765 000024 00000003043 12411365553 016540 0ustar00jforcierstaff000000 000000 #!/usr/bin/env python # Support setuptools or distutils try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup # Version info -- read without importing _locals = {} with open('invocations/_version.py') as fp: exec(fp.read(), None, _locals) version = _locals['__version__'] setup( name='invocations', version=version, description='Reusable Invoke tasks', license='BSD', author='Jeff Forcier', author_email='jeff@bitprophet.org', url='http://pyinvoke.org', # Release requirements. See dev-requirements.txt for dev version reqs. requirements=['invoke>=0.6.0,<=0.9.0'], packages=['invocations'], classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Operating System :: MacOS :: MacOS X', 'Operating System :: Unix', 'Operating System :: POSIX', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development', 'Topic :: Software Development :: Build Tools', 'Topic :: Software Development :: Libraries', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: System :: Software Distribution', 'Topic :: System :: Systems Administration', ], ) invocations-0.6.2/invocations.egg-info/dependency_links.txt000644 000765 000024 00000000001 12411365640 025117 0ustar00jforcierstaff000000 000000 invocations-0.6.2/invocations.egg-info/PKG-INFO000644 000765 000024 00000002036 12411365640 022147 0ustar00jforcierstaff000000 000000 Metadata-Version: 1.0 Name: invocations Version: 0.6.2 Summary: Reusable Invoke tasks Home-page: http://pyinvoke.org Author: Jeff Forcier Author-email: jeff@bitprophet.org License: BSD Description: UNKNOWN Platform: UNKNOWN Classifier: Development Status :: 3 - Alpha Classifier: Environment :: Console Classifier: Intended Audience :: Developers Classifier: Intended Audience :: System Administrators Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: Unix Classifier: Operating System :: POSIX Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Topic :: Software Development Classifier: Topic :: Software Development :: Build Tools Classifier: Topic :: Software Development :: Libraries Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: System :: Software Distribution Classifier: Topic :: System :: Systems Administration invocations-0.6.2/invocations.egg-info/SOURCES.txt000644 000765 000024 00000000474 12411365640 022742 0ustar00jforcierstaff000000 000000 LICENSE MANIFEST.in README.rst dev-requirements.txt setup.py invocations/__init__.py invocations/_version.py invocations/docs.py invocations/packaging.py invocations/testing.py invocations.egg-info/PKG-INFO invocations.egg-info/SOURCES.txt invocations.egg-info/dependency_links.txt invocations.egg-info/top_level.txtinvocations-0.6.2/invocations.egg-info/top_level.txt000644 000765 000024 00000000014 12411365640 023576 0ustar00jforcierstaff000000 000000 invocations invocations-0.6.2/invocations/__init__.py000644 000765 000024 00000000000 12161703442 021454 0ustar00jforcierstaff000000 000000 invocations-0.6.2/invocations/_version.py000644 000765 000024 00000000120 12411365617 021552 0ustar00jforcierstaff000000 000000 __version_info__ = (0, 6, 2) __version__ = '.'.join(map(str, __version_info__)) invocations-0.6.2/invocations/docs.py000644 000765 000024 00000002216 12264145147 020666 0ustar00jforcierstaff000000 000000 import os from invoke import ctask as task, Collection # Underscored func name to avoid shadowing kwargs in build() @task(name='clean') def _clean(ctx): ctx.run("rm -rf {0}".format(ctx['sphinx.target'])) # Ditto @task(name='browse') def _browse(ctx): index = os.path.join(ctx['sphinx.target'], ctx['sphinx.target_file']) ctx.run("open {0}".format(index)) @task(default=True, help={'opts': "Extra sphinx-build options/args"}) def build(ctx, clean=False, browse=False, opts=None): if clean: _clean(ctx) cmd = "sphinx-build{2} {0} {1}".format( ctx['sphinx.source'], ctx['sphinx.target'], (" " + opts) if opts else "", ) ctx.run(cmd, pty=True) if browse: _browse(ctx) @task def tree(ctx): ignore = ".git|*.pyc|*.swp|dist|*.egg-info|_static|_build|_templates" ctx.run("tree -Ca -I \"{0}\" {1}".format(ignore, ctx['sphinx.source'])) ns = Collection(_clean, _browse, build, tree) ns.configure({ 'sphinx.source': 'docs', # TODO: allow lazy eval so one attr can refer to another? 'sphinx.target': os.path.join('docs', '_build'), 'sphinx.target_file': 'index.html', }) invocations-0.6.2/invocations/packaging.py000644 000765 000024 00000011770 12410400017 021646 0ustar00jforcierstaff000000 000000 from glob import glob import os from shutil import rmtree, copy, copytree from tempfile import mkdtemp from invoke import ctask as task, Collection def unpack(ctx, tmp, package, version, git_url=None): """ Download + unpack given package into temp dir ``tmp``. Return ``(real_version, source)`` where ``real_version`` is the "actual" version downloaded (e.g. if a Git master was indicated, it will be the SHA of master HEAD) and ``source`` is the source directory (relative to unpacked source) to import into ``/vendor``. """ real_version = version[:] source = None if git_url: pass # git clone into tempdir # git checkout # set target to checkout # if version does not look SHA-ish: # in the checkout, obtain SHA from that branch # set real_version to that value else: cwd = os.getcwd() print("Moving into temp dir %s" % tmp) os.chdir(tmp) try: # Nab from index flags = "--download-cache= --download=. --build=build" cmd = "pip install %s %s==%s" % (flags, package, version) ctx.run(cmd) # Identify basename # TODO: glob is bad here because pip install --download gets all # dependencies too! ugh. zipfile = os.path.basename(glob("*.zip")[0]) source = os.path.splitext(zipfile)[0] # Unzip ctx.run("unzip *.zip") finally: os.chdir(cwd) return real_version, source @task def vendorize(ctx, distribution, version, vendor_dir, package=None, git_url=None, license=None): """ Vendorize Python package ``distribution`` at version/SHA ``version``. Specify the vendor folder (e.g. ``/vendor``) as ``vendor_dir``. For Crate/PyPI releases, ``package`` should be the name of the software entry on those sites, and ``version`` should be a specific version number. E.g. ``vendorize('lexicon', '0.1.2')``. For Git releases, ``package`` should be the name of the package folder within the checkout that needs to be vendorized and ``version`` should be a Git identifier (branch, tag, SHA etc.) ``git_url`` must also be given, something suitable for ``git clone ``. For SVN releases: xxx. For packages where the distribution name is not the same as the package directory name, give ``package='name'``. By default, no explicit license seeking is done -- we assume the license info is in file headers or otherwise within the Python package vendorized. This is not always true; specify ``license=/path/to/license/file`` to trigger copying of a license into the vendored folder from the checkout/download (relative to its root.) """ tmp = mkdtemp() package = package or distribution target = os.path.join(vendor_dir, package) try: # Unpack source real_version, source = unpack(ctx, tmp, distribution, version, git_url) abs_source = os.path.join(tmp, source) source_package = os.path.join(abs_source, package) # Ensure source package exists if not os.path.exists(source_package): rel_package = os.path.join(source, package) raise ValueError("Source package %s doesn't exist!" % rel_package) # Nuke target if exists if os.path.exists(target): print("Removing pre-existing vendorized folder %s" % target) rmtree(target) # Perform the copy print("Copying %s => %s" % (source_package, target)) copytree(source_package, target) # Explicit license if needed if license: copy(os.path.join(abs_source, license), target) # git commit -a -m "Update $package to $version ($real_version if different)" finally: rmtree(tmp) @task(name='all') def all_(ctx): """ Catchall version-bump/tag/changelog/PyPI upload task. """ @task def changelog(ctx, target='docs/changelog.rst'): """ Update changelog with new release entry. """ pass @task def version(ctx): """ Update stored project version (e.g. a ``_version.py``.) Requires configuration to be effective (since version file is usually kept within a project-named directory. """ pass @task def tag(ctx): """ Create a release tag. May set a config option for a prefix, e.g. 'v1.0.0' vs just '1.0.0'. This is unset/blank by default. """ pass @task def push(ctx): """ Push tag/changelog/version changes to Git origin. """ # TODO: or should this be distributed amongst the appropriate tasks? pass @task def publish(ctx, wheel=False): """ Publish code to PyPI. """ # TODO: Use twine. parts = ["python", "setup.py", "sdist"] if wheel: parts.append("bdist_wheel") parts.append("register") parts.append("upload") ctx.run(" ".join(parts)) release = Collection('release', changelog, version, tag, push) release.add_task(all_, default=True) invocations-0.6.2/invocations/testing.py000644 000765 000024 00000001307 12351120605 021400 0ustar00jforcierstaff000000 000000 from invoke import ctask as task @task(help={ 'module': "Just runs tests/STRING.py.", 'runner': "Use STRING to run tests instead of 'spec'.", 'opts': "Extra flags for the test runner", 'pty': "Whether to run tests under a pseudo-tty", }) def test(ctx, module=None, runner=None, opts=None, pty=True): """ Run a Spec or Nose-powered internal test suite. """ runner = runner or 'spec' # Allow selecting specific submodule specific_module = " --tests=tests/%s.py" % module args = (specific_module if module else "") if opts: args += " " + opts # Use pty by default so the spec/nose/Python process buffers "correctly" ctx.run(runner + args, pty=pty)