Skip to content

Commit e413c49

Browse files
DOC: Change release and whatsnew (#21599)
* DOC: Change release and whatsnew Changes: * We will include the correct (latest on master or maintenance branch) whatsnew directly in the index.rst toctree * Contributors are included in the whatsnew for each version (automatically) * Removed release.rst * Added new releases.rst which has toctrees for each release Incidental changes * Updated style.ipynb. Writing the jinja template was confusing sphinx. We included it in the git source now. * Fixing some inconsitent header levels (will do more) * Refactored announce.py to support auto-generated contributors
1 parent 6d031f2 commit e413c49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1223
-286
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,5 @@ doc/build/html/index.html
109109
# Windows specific leftover:
110110
doc/tmp.sv
111111
doc/source/styled.xlsx
112-
doc/source/templates/
113112
env/
114113
doc/source/savefig/

ci/build_docs.sh

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ "${TRAVIS_OS_NAME}" != "linux" ]; then
55
exit 0
66
fi
77

8-
cd "$TRAVIS_BUILD_DIR"
8+
cd "$TRAVIS_BUILD_DIR"/doc
99
echo "inside $0"
1010

1111
if [ "$DOC" ]; then
@@ -14,10 +14,6 @@ if [ "$DOC" ]; then
1414

1515
source activate pandas
1616

17-
mv "$TRAVIS_BUILD_DIR"/doc /tmp
18-
mv "$TRAVIS_BUILD_DIR/LICENSE" /tmp # included in the docs.
19-
cd /tmp/doc
20-
2117
echo ###############################
2218
echo # Log file for the doc build #
2319
echo ###############################
@@ -29,7 +25,7 @@ if [ "$DOC" ]; then
2925
echo # Create and send docs #
3026
echo ########################
3127

32-
cd /tmp/doc/build/html
28+
cd build/html
3329
git config --global user.email "[email protected]"
3430
git config --global user.name "pandas-docs-bot"
3531

ci/deps/travis-36-doc.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dependencies:
88
- bottleneck
99
- cython>=0.28.2
1010
- fastparquet
11+
- gitpython
1112
- html5lib
1213
- hypothesis>=3.58.0
1314
- ipykernel

doc/make.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ def _process_single_doc(self, single_doc):
126126
self.single_doc = 'api'
127127
elif os.path.exists(os.path.join(SOURCE_PATH, single_doc)):
128128
self.single_doc_type = 'rst'
129-
self.single_doc = os.path.splitext(os.path.basename(single_doc))[0]
129+
130+
if 'whatsnew' in single_doc:
131+
basename = single_doc
132+
else:
133+
basename = os.path.basename(single_doc)
134+
self.single_doc = os.path.splitext(basename)[0]
130135
elif os.path.exists(
131136
os.path.join(SOURCE_PATH, '{}.rst'.format(single_doc))):
132137
self.single_doc_type = 'rst'

doc/source/conf.py

+39-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
# documentation root, use os.path.abspath to make it absolute, like shown here.
4141
# sys.path.append(os.path.abspath('.'))
4242
sys.path.insert(0, os.path.abspath('../sphinxext'))
43-
4443
sys.path.extend([
4544

4645
# numpy standard doc extensions
@@ -75,6 +74,7 @@
7574
'sphinx.ext.ifconfig',
7675
'sphinx.ext.linkcode',
7776
'nbsphinx',
77+
'contributors', # custom pandas extension
7878
]
7979

8080
try:
@@ -120,7 +120,9 @@
120120
templates_path = ['../_templates']
121121

122122
# The suffix of source filenames.
123-
source_suffix = '.rst'
123+
source_suffix = [
124+
'.rst',
125+
]
124126

125127
# The encoding of source files.
126128
source_encoding = 'utf-8'
@@ -298,8 +300,26 @@
298300
for page in moved_api_pages
299301
}
300302

303+
304+
common_imports = """\
305+
.. currentmodule:: pandas
306+
307+
.. ipython:: python
308+
:suppress:
309+
310+
import numpy as np
311+
from pandas import *
312+
import pandas as pd
313+
randn = np.random.randn
314+
np.set_printoptions(precision=4, suppress=True)
315+
options.display.max_rows = 15
316+
from pandas.compat import StringIO
317+
"""
318+
319+
301320
html_context = {
302-
'redirects': {old: new for old, new in moved_api_pages}
321+
'redirects': {old: new for old, new in moved_api_pages},
322+
'common_imports': common_imports,
303323
}
304324

305325
# If false, no module index is generated.
@@ -654,7 +674,23 @@ def process_class_docstrings(app, what, name, obj, options, lines):
654674
]
655675

656676

677+
def rstjinja(app, docname, source):
678+
"""
679+
Render our pages as a jinja template for fancy templating goodness.
680+
"""
681+
# http://ericholscher.com/blog/2016/jul/25/integrating-jinja-rst-sphinx/
682+
# Make sure we're outputting HTML
683+
if app.builder.format != 'html':
684+
return
685+
src = source[0]
686+
rendered = app.builder.templates.render_string(
687+
src, app.config.html_context
688+
)
689+
source[0] = rendered
690+
691+
657692
def setup(app):
693+
app.connect("source-read", rstjinja)
658694
app.connect("autodoc-process-docstring", remove_flags_docstring)
659695
app.connect("autodoc-process-docstring", process_class_docstrings)
660696
app.add_autodocumenter(AccessorDocumenter)

doc/source/contributing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ Information on how to write a benchmark and how to use asv can be found in the
11031103
Documenting your code
11041104
---------------------
11051105

1106-
Changes should be reflected in the release notes located in ``doc/source/whatsnew/vx.y.z.txt``.
1106+
Changes should be reflected in the release notes located in ``doc/source/whatsnew/vx.y.z.rst``.
11071107
This file contains an ongoing change log for each release. Add an entry to this file to
11081108
document your fix, enhancement or (unavoidable) breaking change. Make sure to include the
11091109
GitHub issue number when adding your entry (using ``:issue:`1234``` where ``1234`` is the

doc/source/index.rst.template

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ See the package overview for more detail about what's in the library.
118118
{{ single_doc }}
119119
{% endif -%}
120120
{% if not single_doc -%}
121-
whatsnew
121+
What's New <whatsnew/v0.24.0>
122122
install
123123
contributing
124124
overview
@@ -159,5 +159,5 @@ See the package overview for more detail about what's in the library.
159159
developer
160160
internals
161161
extending
162-
release
162+
releases
163163
{% endif -%}

doc/source/releases.rst

+203
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
.. _release:
2+
3+
*************
4+
Release Notes
5+
*************
6+
7+
This is the list of changes to pandas between each release. For full details,
8+
see the commit logs at http://github.com/pandas-dev/pandas. For install and
9+
upgrade instructions, see :ref:`install`.
10+
11+
Version 0.24
12+
------------
13+
14+
.. toctree::
15+
:maxdepth: 2
16+
17+
whatsnew/v0.24.0
18+
19+
Version 0.23
20+
------------
21+
22+
.. toctree::
23+
:maxdepth: 2
24+
25+
whatsnew/v0.23.4
26+
whatsnew/v0.23.3
27+
whatsnew/v0.23.2
28+
whatsnew/v0.23.1
29+
whatsnew/v0.23.0
30+
31+
Version 0.22
32+
------------
33+
34+
.. toctree::
35+
:maxdepth: 2
36+
37+
whatsnew/v0.22.0
38+
39+
Version 0.21
40+
------------
41+
42+
.. toctree::
43+
:maxdepth: 2
44+
45+
whatsnew/v0.21.0
46+
whatsnew/v0.21.1
47+
48+
Version 0.20
49+
------------
50+
51+
.. toctree::
52+
:maxdepth: 2
53+
54+
whatsnew/v0.20.0
55+
whatsnew/v0.20.2
56+
whatsnew/v0.20.3
57+
58+
Version 0.19
59+
------------
60+
61+
.. toctree::
62+
:maxdepth: 2
63+
64+
whatsnew/v0.19.0
65+
whatsnew/v0.19.1
66+
whatsnew/v0.19.2
67+
68+
Version 0.18
69+
------------
70+
71+
.. toctree::
72+
:maxdepth: 2
73+
74+
whatsnew/v0.18.0
75+
whatsnew/v0.18.1
76+
77+
Version 0.17
78+
------------
79+
80+
.. toctree::
81+
:maxdepth: 2
82+
83+
whatsnew/v0.17.0
84+
whatsnew/v0.17.1
85+
86+
Version 0.16
87+
------------
88+
89+
.. toctree::
90+
:maxdepth: 2
91+
92+
whatsnew/v0.16.0
93+
whatsnew/v0.16.1
94+
whatsnew/v0.16.2
95+
96+
Version 0.15
97+
------------
98+
99+
.. toctree::
100+
:maxdepth: 2
101+
102+
whatsnew/v0.15.0
103+
whatsnew/v0.15.1
104+
whatsnew/v0.15.2
105+
106+
Version 0.14
107+
------------
108+
109+
.. toctree::
110+
:maxdepth: 2
111+
112+
whatsnew/v0.14.0
113+
whatsnew/v0.14.1
114+
115+
Version 0.13
116+
------------
117+
118+
.. toctree::
119+
:maxdepth: 2
120+
121+
whatsnew/v0.13.0
122+
whatsnew/v0.13.1
123+
124+
Version 0.12
125+
------------
126+
127+
.. toctree::
128+
:maxdepth: 2
129+
130+
whatsnew/v0.12.0
131+
132+
Version 0.11
133+
------------
134+
135+
.. toctree::
136+
:maxdepth: 2
137+
138+
whatsnew/v0.11.0
139+
140+
Version 0.10
141+
------------
142+
143+
.. toctree::
144+
:maxdepth: 2
145+
146+
whatsnew/v0.10.0
147+
whatsnew/v0.10.1
148+
149+
Version 0.9
150+
-----------
151+
152+
.. toctree::
153+
:maxdepth: 2
154+
155+
whatsnew/v0.9.0
156+
whatsnew/v0.9.1
157+
158+
Version 0.8
159+
------------
160+
161+
.. toctree::
162+
:maxdepth: 2
163+
164+
whatsnew/v0.8.0
165+
whatsnew/v0.8.1
166+
167+
Version 0.7
168+
-----------
169+
170+
.. toctree::
171+
:maxdepth: 2
172+
173+
whatsnew/v0.7.0
174+
whatsnew/v0.7.1
175+
whatsnew/v0.7.2
176+
whatsnew/v0.7.3
177+
178+
Version 0.6
179+
-----------
180+
181+
.. toctree::
182+
:maxdepth: 2
183+
184+
185+
whatsnew/v0.6.0
186+
whatsnew/v0.6.1
187+
188+
Version 0.5
189+
-----------
190+
191+
.. toctree::
192+
:maxdepth: 2
193+
194+
195+
whatsnew/v0.5.0
196+
197+
Version 0.4
198+
-----------
199+
200+
.. toctree::
201+
:maxdepth: 2
202+
203+
whatsnew/v0.4.x

0 commit comments

Comments
 (0)