Skip to content

Commit

Permalink
Include docs in setup.py and MANIFEST.in
Browse files Browse the repository at this point in the history
  • Loading branch information
unbrice committed Jul 13, 2014
1 parent ce8c648 commit f813001
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ python:
- "3.3"
- "3.4"
install:
- pip install -r tests/requirements.txt
- pip install -r build-requirements.txt
script:
- python -m unittest discover
# Checks that pip can install the package.
Expand Down
8 changes: 8 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
include LICENSE.txt
include README.rst

# Tests
recursive-include tests *.py *.txt

# Docs
recursive-include docs *.rst *.html *.py
prune docs/_autosummary
prune docs/_build
5 changes: 5 additions & 0 deletions build-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mock
sphinx>=1.2
sphinx_rtd_theme
sphinxcontrib-napoleon

26 changes: 24 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,19 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from distutils import core
from distutils.command import build
import setuptools
from sphinx import setup_command as sphinx_command

from py1 import constants

core.setup(
class build(build.build):
sub_commands = build.build.sub_commands + [
('build_sphinx', None),
('build_man', None),
]

setuptools.setup(
name=constants.NAME,
version=constants.VERSION,

Expand All @@ -46,6 +55,19 @@
'py1.runner',
],

# The manpage is build by an alias of build_sphinx
data_files=[('share/man/man1', ['build/sphinx/man/py1.1'])],
cmdclass = {
'build_man': sphinx_command.BuildDoc,
# Setups our build command that also builds the doc.
'build': build,
},
command_options = {
'build_man': {
'builder': ('setup.py', 'man'),
},
},

keywords = 'scripting awk one-liner oneliner',

# https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down
1 change: 0 additions & 1 deletion tests/requirements.txt

This file was deleted.

0 comments on commit f813001

Please sign in to comment.