Skip to content

Commit 0672438

Browse files
committed
create a simple python package and include the documentation in it so it is installed by default
1 parent 8dfb27d commit 0672438

File tree

5 files changed

+39
-25
lines changed

5 files changed

+39
-25
lines changed

.hgignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ paver-minilib.zip
55
setup.py
66
trace.txt
77
docs
8+
*.pyc
89

910
syntax: re
1011
.DS_Store

MANIFEST.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
include README.html
21
include setup.py
32
include paver-minilib.zip
43
include pavement.py
54
include tests/*
6-
recursive-include docs *.html *.txt *.css *.js *.png
5+
recursive-include virtualenvwrapper *.html *.txt *.css *.js *.png
76
recursive-include docsource *.rst

docsource/history.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Release History
33
===============
44

5+
1.17
6+
7+
- Added documentation updates provided by Steve Steiner.
8+
59
1.16
610

711
- Merged in changes to ``cdvirtualenv`` from wam and added tests and docs.

pavement.py

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
# Scan the input for package information
3434
# to grab any data files (text, images, etc.)
3535
# associated with sub-packages.
36-
# PACKAGE_DATA = paver.setuputils.find_package_data(PROJECT,
37-
# package=PROJECT,
38-
# only_in_packages=True,
39-
# )
36+
PACKAGE_DATA = paver.setuputils.find_package_data(PROJECT,
37+
package=PROJECT,
38+
only_in_packages=False,
39+
)
4040

4141
options(
4242
setup=Bunch(
@@ -68,13 +68,9 @@
6868
provides=['virtualenvwrapper',
6969
],
7070
requires=['virtualenv'],
71-
72-
data_files=[('docs', ['README.html']),
73-
],
74-
75-
# It seems wrong to have to list recursive packages explicitly.
76-
# packages = sorted(PACKAGE_DATA.keys()),
77-
# package_data=PACKAGE_DATA,
71+
72+
packages = sorted(PACKAGE_DATA.keys()),
73+
package_data = PACKAGE_DATA,
7874

7975
zip_safe=False,
8076

@@ -109,23 +105,26 @@ def remake_directories(*dirnames):
109105
return
110106

111107
@task
112-
@needs(['html', 'readme_html', 'generate_setup', 'minilib',
113-
'setuptools.command.sdist'
108+
@needs('paver.doctools.html')
109+
def html(options):
110+
destdir = path(PROJECT) / 'docs'
111+
destdir.rmtree()
112+
builtdocs = path(options.builddir) / "html"
113+
builtdocs.move(destdir)
114+
return
115+
116+
@task
117+
@needs(['html',
118+
'generate_setup', 'minilib',
119+
'setuptools.command.sdist',
114120
])
115-
def sdist():
121+
def sdist(options):
116122
"""Create a source distribution.
117123
"""
118124
pass
119-
120-
@task
121-
def readme_html():
122-
# FIXME - Switch to sphinx?
123-
outfile = path('README.html')
124-
outfile.unlink()
125-
sh('rst2html.py %s README.html' % README_FILE)
126-
return
127-
125+
128126
@task
129127
def test():
130128
sh('bash ./tests/test.sh')
131129
sh('SHUNIT_PARENT=./tests/test.sh zsh -o shwordsplit ./tests/test.sh')
130+
return

virtualenvwrapper/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""virtualenvwrapper module
2+
"""
3+
4+
if __name__ == '__main__':
5+
import os
6+
import webbrowser
7+
docs_root = os.path.join(os.path.dirname(__file__), 'docs', 'index.html')
8+
webbrowser.open_new('file://' + docs_root)
9+
else:
10+
import warnings
11+
warnings.warn('Use virtualenvwrapper_bashrc to set up your shell environment.')

0 commit comments

Comments
 (0)