Skip to content

DOC/CI: include api docs on travis #11069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ git:

matrix:
fast_finish: true
fail_fast: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't think we should have this and leave it false. That way you can see the full gamut of errors (of course for your testsing ok)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this one is from the temporary commit just for testing, will remove it

include:
- python: 2.6
env:
Expand All @@ -42,7 +43,6 @@ matrix:
- FULL_DEPS=true
- CLIPBOARD_GUI=gtk2
- BUILD_TYPE=conda
- DOC_BUILD=true # if rst files were changed, build docs in parallel with tests
- python: 3.4
env:
- JOB_NAME: "34_nslow"
Expand Down Expand Up @@ -103,6 +103,12 @@ matrix:
- NUMPY_BUILD=master
- BUILD_TYPE=pydata
- PANDAS_TESTING_MODE="deprecate"
- python: 2.7
env:
- JOB_NAME: "doc_build"
- JOB_TAG=_DOC_BUILD
- BUILD_TYPE=conda
- DOC_BUILD=true # if rst files were changed, build docs in parallel with tests
allow_failures:
- python: 3.3
env:
Expand Down Expand Up @@ -150,6 +156,12 @@ matrix:
- FULL_DEPS=true
- BUILD_TYPE=pydata
- BUILD_TEST=true
- python: 2.7
env:
- JOB_NAME: "doc_build"
- JOB_TAG=_DOC_BUILD
- BUILD_TYPE=conda
- DOC_BUILD=true

before_install:
- echo "before_install"
Expand Down Expand Up @@ -178,7 +190,7 @@ before_script:

script:
- echo "script"
- ci/run_build_docs.sh &
- ci/run_build_docs.sh
- ci/script.sh
# nothing here, or failed tests won't fail travis

Expand Down
4 changes: 4 additions & 0 deletions ci/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ echo "inside $0"
sudo apt-get update $APT_ARGS # run apt-get update for all versions

true # never fail because bad things happened here

if [ x"$DOC_BUILD" == x"" ]; then
exit 1
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you nee to put this before the 'true' above. IOW, the script should always return true.
(I think this was for testing only?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this was only for the testing from the temp commit (just so the others will all fail before installing pandas, so the doc build did not need to wait on all the others)

11 changes: 5 additions & 6 deletions ci/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,22 @@ fi

if [ x"$DOC_BUILD" != x"" ]; then

# we're running network tests, let's build the docs in the meantime
echo "Will build docs"
conda install -n pandas sphinx=1.1.3 pygments ipython=2.4 --yes

source activate pandas
conda install -n pandas -c r r rpy2 --yes

time sudo apt-get $APT_ARGS install dvipng

mv "$TRAVIS_BUILD_DIR"/doc /tmp
cd /tmp/doc

rm /tmp/doc/source/api.rst # no R
rm /tmp/doc/source/r_interface.rst # no R

echo ###############################
echo # Log file for the doc build #
echo ###############################

echo -e "y\n" | ./make.py --no-api 2>&1
echo ./make.py
./make.py

cd /tmp/doc/build/html
git config --global user.email "[email protected]"
Expand Down
4 changes: 4 additions & 0 deletions ci/requirements-2.7_DOC_BUILD.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dateutil
pytz
numpy
cython
16 changes: 16 additions & 0 deletions ci/requirements-2.7_DOC_BUILD.run
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
sphinx=1.2.3
ipython=3.2.1
matplotlib
scipy
lxml
beautiful-soup
html5lib
pytables
openpyxl=1.8.5
xlrd
xlwt
xlsxwriter
sqlalchemy
numexpr
bottleneck
statsmodels
2 changes: 1 addition & 1 deletion ci/run_build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

echo "inside $0"

"$TRAVIS_BUILD_DIR"/ci/build_docs.sh 2>&1 > /tmp/doc.log &
"$TRAVIS_BUILD_DIR"/ci/build_docs.sh 2>&1

# wait until subprocesses finish (build_docs.sh)
wait
Expand Down
5 changes: 5 additions & 0 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ echo "inside $0"

source activate pandas

# don't run the tests for the doc build
if [ x"$DOC_BUILD" != x"" ]; then
exit 0
fi

if [ -n "$LOCALE_OVERRIDE" ]; then
export LC_ALL="$LOCALE_OVERRIDE";
echo "Setting LC_ALL to $LOCALE_OVERRIDE"
Expand Down
2 changes: 1 addition & 1 deletion doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def clean():

def html():
check_build()
if os.system('sphinx-build -P -b html -d build/doctrees '
if os.system('sphinx-build -P -j 4 -b html -d build/doctrees '
'source build/html'):
raise SystemExit("Building HTML failed.")
try:
Expand Down
6 changes: 5 additions & 1 deletion doc/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ strings and apply several methods to it. These can be acccessed like

..
The following is needed to ensure the generated pages are created with the
correct template (otherwise they would be created in the Series class page)
correct template (otherwise they would be created in the Series/Index class page)

..
.. autosummary::
Expand All @@ -613,6 +613,10 @@ strings and apply several methods to it. These can be acccessed like
Series.str
Series.cat
Series.dt
Index.str
CategoricalIndex.str
DatetimeIndex.str
TimedeltaIndex.str


.. _api.categorical:
Expand Down
15 changes: 9 additions & 6 deletions doc/sphinxext/numpydoc/docscrape_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def __init__(self, docstring, config={}):
def load_config(self, config):
self.use_plots = config.get('use_plots', False)
self.class_members_toctree = config.get('class_members_toctree', True)
self.class_members_list = config.get('class_members_list', True)

# string conversion routines
def _str_header(self, name, symbol='`'):
Expand Down Expand Up @@ -95,7 +96,7 @@ def _str_member_list(self, name):

"""
out = []
if self[name]:
if self[name] and self.class_members_list:
out += ['.. rubric:: %s' % name, '']
prefix = getattr(self, '_name', '')

Expand All @@ -114,11 +115,13 @@ def _str_member_list(self, name):
or inspect.isgetsetdescriptor(param_obj)):
param_obj = None

if param_obj and (pydoc.getdoc(param_obj) or not desc):
# Referenced object has a docstring
autosum += [" %s%s" % (prefix, param)]
else:
others.append((param, param_type, desc))
# pandas HACK - do not exclude attributes wich are None
# if param_obj and (pydoc.getdoc(param_obj) or not desc):
# # Referenced object has a docstring
# autosum += [" %s%s" % (prefix, param)]
# else:
# others.append((param, param_type, desc))
autosum += [" %s%s" % (prefix, param)]

if autosum:
out += ['.. autosummary::']
Expand Down
4 changes: 4 additions & 0 deletions doc/sphinxext/numpydoc/numpydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def mangle_docstrings(app, what, name, obj, options, lines,
class_members_toctree=app.config.numpydoc_class_members_toctree,
)

# PANDAS HACK (to remove the list of methods/attributes for Categorical)
if what == "class" and name.endswith(".Categorical"):
cfg['class_members_list'] = False

if what == 'module':
# Strip top title
title_re = re.compile(sixu('^\\s*[#*=]{4,}\\n[a-z0-9 -]+\\n[#*=]{4,}\\s*'),
Expand Down