|
| 1 | +#!/usr/bin/env python |
| 2 | +# encoding: utf-8 |
| 3 | +# |
| 4 | +# Copyright (c) 2008 Doug Hellmann All rights reserved. |
| 5 | +# |
| 6 | +""" |
| 7 | +TODO |
| 8 | +
|
| 9 | + - make sure all of the files from the manifests are included |
| 10 | + |
| 11 | +""" |
| 12 | + |
| 13 | +__version__ = "$Id$" |
| 14 | + |
| 15 | +# Standard library |
| 16 | +import copy |
| 17 | +import os |
| 18 | + |
| 19 | +# Third-party |
| 20 | + |
| 21 | +# Set up Paver |
| 22 | +import paver |
| 23 | +import paver.misctasks |
| 24 | +from paver.path import path |
| 25 | +from paver.easy import * |
| 26 | +import paver.setuputils |
| 27 | +paver.setuputils.install_distutils_tasks() |
| 28 | + |
| 29 | +# What project are we building? |
| 30 | +PROJECT = 'virtualenvwrapper' |
| 31 | + |
| 32 | +# What version is this? (take from path in svn tree) |
| 33 | +VERSION = path(os.getcwd()).name |
| 34 | +os.environ['VERSION'] = VERSION |
| 35 | + |
| 36 | +# Read the long description to give to setup |
| 37 | +README = path('README').text() |
| 38 | + |
| 39 | +# Scan the input for package information |
| 40 | +# to grab any data files (text, images, etc.) |
| 41 | +# associated with sub-packages. |
| 42 | +# PACKAGE_DATA = paver.setuputils.find_package_data(PROJECT, |
| 43 | +# package=PROJECT, |
| 44 | +# only_in_packages=True, |
| 45 | +# ) |
| 46 | + |
| 47 | +options( |
| 48 | + setup=Bunch( |
| 49 | + name = PROJECT, |
| 50 | + version = VERSION, |
| 51 | + |
| 52 | + description = 'Enhancements to virtualenv', |
| 53 | + long_description = README, |
| 54 | + |
| 55 | + author = 'Doug Hellmann', |
| 56 | + author_email = '[email protected]', |
| 57 | + |
| 58 | + url = 'http://www.doughellmann.com/projects/virtualenvwrapper/', |
| 59 | + download_url = 'http://www.doughellmann.com/downloads/%s-%s.tar.gz' % \ |
| 60 | + (PROJECT, VERSION), |
| 61 | + |
| 62 | + classifiers = [ 'Development Status :: 5 - Production/Stable', |
| 63 | + 'License :: OSI Approved :: BSD License', |
| 64 | + 'Programming Language :: Python', |
| 65 | + 'Intended Audience :: Developers', |
| 66 | + 'Environment :: Console', |
| 67 | + ], |
| 68 | + |
| 69 | + platforms = ('Any',), |
| 70 | + |
| 71 | + scripts = ['virtualenvwrapper_bashrc', |
| 72 | + ], |
| 73 | + |
| 74 | + provides=['virtualenvwrapper', |
| 75 | + ], |
| 76 | + requires=['virtualenv'], |
| 77 | + |
| 78 | + data_files=[('docs', ['README.html']), |
| 79 | + ], |
| 80 | + |
| 81 | + # It seems wrong to have to list recursive packages explicitly. |
| 82 | + # packages = sorted(PACKAGE_DATA.keys()), |
| 83 | + # package_data=PACKAGE_DATA, |
| 84 | + |
| 85 | + zip_safe=False, |
| 86 | + |
| 87 | + ), |
| 88 | + |
| 89 | + packaging = Bunch( |
| 90 | + outdir='~/Desktop', |
| 91 | + ), |
| 92 | + |
| 93 | +) |
| 94 | + |
| 95 | +def remake_directories(*dirnames): |
| 96 | + """Remove the directories and recreate them. |
| 97 | + """ |
| 98 | + for d in dirnames: |
| 99 | + d = path(d) |
| 100 | + if d.exists(): |
| 101 | + d.rmtree() |
| 102 | + d.mkdir() |
| 103 | + return |
| 104 | + |
| 105 | +@task |
| 106 | +@needs(['html', 'generate_setup', 'minilib', |
| 107 | + 'setuptools.command.sdist' |
| 108 | + ]) |
| 109 | +def sdist(): |
| 110 | + """Create a source distribution. |
| 111 | + """ |
| 112 | + # Move the output file to the desktop |
| 113 | + dist_files = path('dist').glob('*.tar.gz') |
| 114 | + dest_dir = path(options.packaging.outdir).expanduser() |
| 115 | + for f in dist_files: |
| 116 | + f.move(dest_dir) |
| 117 | + return |
| 118 | + |
| 119 | +@task |
| 120 | +def html(): |
| 121 | + # FIXME - Switch to sphinx? |
| 122 | + outfile = path('README.html') |
| 123 | + outfile.unlink() |
| 124 | + sh('rst2html.py README README.html') |
| 125 | + return |
0 commit comments