Skip to content

Commit eb04519

Browse files
committed
Merge branch 'master' into mypy/base
2 parents 4222c83 + 0f8234c commit eb04519

File tree

122 files changed

+1969
-1577
lines changed

Some content is hidden

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

122 files changed

+1969
-1577
lines changed
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Build pandas
2+
description: Rebuilds the C extensions and installs pandas
3+
runs:
4+
using: composite
5+
steps:
6+
7+
- name: Environment Detail
8+
run: |
9+
conda info
10+
conda list
11+
shell: bash -l {0}
12+
13+
- name: Build Pandas
14+
run: |
15+
python setup.py build_ext -j 2
16+
python -m pip install -e . --no-build-isolation --no-use-pep517
17+
shell: bash -l {0}

.github/actions/setup/action.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Set up pandas
2+
description: Runs all the setup steps required to have a built pandas ready to use
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Setting conda path
7+
run: echo "${HOME}/miniconda3/bin" >> $GITHUB_PATH
8+
shell: bash -l {0}
9+
10+
- name: Setup environment and build pandas
11+
run: ci/setup_env.sh
12+
shell: bash -l {0}

.github/workflows/ci.yml

+20-18
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,8 @@ jobs:
4141
environment-file: ${{ env.ENV_FILE }}
4242
use-only-tar-bz2: true
4343

44-
- name: Environment Detail
45-
run: |
46-
conda info
47-
conda list
48-
4944
- name: Build Pandas
50-
run: |
51-
python setup.py build_ext -j 2
52-
python -m pip install -e . --no-build-isolation --no-use-pep517
45+
uses: ./.github/actions/build_pandas
5346

5447
- name: Linting
5548
run: ci/code_checks.sh lint
@@ -100,14 +93,11 @@ jobs:
10093
runs-on: ubuntu-latest
10194
steps:
10295

103-
- name: Setting conda path
104-
run: echo "${HOME}/miniconda3/bin" >> $GITHUB_PATH
105-
10696
- name: Checkout
10797
uses: actions/checkout@v1
10898

109-
- name: Setup environment and build pandas
110-
run: ci/setup_env.sh
99+
- name: Set up pandas
100+
uses: ./.github/actions/setup
111101

112102
- name: Build website
113103
run: |
@@ -139,21 +129,33 @@ jobs:
139129
run: rsync -az --delete doc/build/html/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas/pandas-docs/dev
140130
if: github.event_name == 'push'
141131

132+
- name: Move docs into site directory
133+
run: mv doc/build/html web/build/docs
134+
- name: Save website as an artifact
135+
uses: actions/upload-artifact@v2
136+
with:
137+
name: website
138+
path: web/build
139+
retention-days: 14
140+
142141
data_manager:
143142
name: Test experimental data manager
144143
runs-on: ubuntu-latest
145144
steps:
146145

147-
- name: Setting conda path
148-
run: echo "${HOME}/miniconda3/bin" >> $GITHUB_PATH
149-
150146
- name: Checkout
151147
uses: actions/checkout@v1
152148

153-
- name: Setup environment and build pandas
154-
run: ci/setup_env.sh
149+
- name: Set up pandas
150+
uses: ./.github/actions/setup
155151

156152
- name: Run tests
157153
run: |
158154
source activate pandas-dev
159155
pytest pandas/tests/frame/methods --array-manager
156+
157+
# indexing iset related (temporary since other tests don't pass yet)
158+
pytest pandas/tests/frame/indexing/test_indexing.py::TestDataFrameIndexing::test_setitem_multi_index --array-manager
159+
pytest pandas/tests/frame/indexing/test_setitem.py::TestDataFrameSetItem::test_setitem_listlike_indexer_duplicate_columns --array-manager
160+
pytest pandas/tests/indexing/multiindex/test_setitem.py::TestMultiIndexSetItem::test_astype_assignment_with_dups --array-manager
161+
pytest pandas/tests/indexing/multiindex/test_setitem.py::TestMultiIndexSetItem::test_frame_setitem_multi_column --array-manager

.github/workflows/database.yml

+10-16
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,8 @@ jobs:
7272
environment-file: ${{ env.ENV_FILE }}
7373
use-only-tar-bz2: true
7474

75-
- name: Environment Detail
76-
run: |
77-
conda info
78-
conda list
79-
8075
- name: Build Pandas
81-
run: |
82-
python setup.py build_ext -j 2
83-
python -m pip install -e . --no-build-isolation --no-use-pep517
76+
uses: ./.github/actions/build_pandas
8477

8578
- name: Test
8679
run: ci/run_tests.sh
@@ -158,15 +151,8 @@ jobs:
158151
environment-file: ${{ env.ENV_FILE }}
159152
use-only-tar-bz2: true
160153

161-
- name: Environment Detail
162-
run: |
163-
conda info
164-
conda list
165-
166154
- name: Build Pandas
167-
run: |
168-
python setup.py build_ext -j 2
169-
python -m pip install -e . --no-build-isolation --no-use-pep517
155+
uses: ./.github/actions/build_pandas
170156

171157
- name: Test
172158
run: ci/run_tests.sh
@@ -184,3 +170,11 @@ jobs:
184170

185171
- name: Print skipped tests
186172
run: python ci/print_skipped.py
173+
174+
- name: Upload coverage to Codecov
175+
uses: codecov/codecov-action@v1
176+
with:
177+
files: /tmp/test_coverage.xml
178+
flags: unittests
179+
name: codecov-pandas
180+
fail_ci_if_error: true

.pre-commit-config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ repos:
180180
language: pygrep
181181
types: [python]
182182
files: ^pandas/tests/
183+
- id: title-capitalization
184+
name: Validate correct capitalization among titles in documentation
185+
entry: python scripts/validate_rst_title_capitalization.py
186+
language: python
187+
types: [rst]
188+
files: ^doc/source/(development|reference)/
183189
- repo: https://github.com/asottile/yesqa
184190
rev: v1.2.2
185191
hooks:

ci/code_checks.sh

-4
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
233233
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS02,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA02,SA03
234234
RET=$(($RET + $?)) ; echo $MSG "DONE"
235235

236-
MSG='Validate correct capitalization among titles in documentation' ; echo $MSG
237-
$BASE_DIR/scripts/validate_rst_title_capitalization.py $BASE_DIR/doc/source/development $BASE_DIR/doc/source/reference
238-
RET=$(($RET + $?)) ; echo $MSG "DONE"
239-
240236
fi
241237

242238
### TYPING ###

ci/deps/azure-37-locale_slow.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
- lxml
1919
- matplotlib=3.0.0
2020
- numpy=1.16.*
21-
- openpyxl=2.6.0
21+
- openpyxl=3.0.0
2222
- python-dateutil
2323
- python-blosc
2424
- pytz=2017.3

ci/deps/azure-37-minimum_versions.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
- numba=0.46.0
2020
- numexpr=2.6.8
2121
- numpy=1.16.5
22-
- openpyxl=2.6.0
22+
- openpyxl=3.0.0
2323
- pytables=3.5.1
2424
- python-dateutil=2.7.3
2525
- pytz=2017.3

doc/cheatsheet/Pandas_Cheat_Sheet.pdf

39.9 KB
Binary file not shown.
2.18 KB
Binary file not shown.

doc/make.py

+14
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ def __init__(
4141
self,
4242
num_jobs=0,
4343
include_api=True,
44+
whatsnew=False,
4445
single_doc=None,
4546
verbosity=0,
4647
warnings_are_errors=False,
4748
):
4849
self.num_jobs = num_jobs
4950
self.include_api = include_api
51+
self.whatsnew = whatsnew
5052
self.verbosity = verbosity
5153
self.warnings_are_errors = warnings_are_errors
5254

@@ -56,6 +58,8 @@ def __init__(
5658
os.environ["SPHINX_PATTERN"] = single_doc
5759
elif not include_api:
5860
os.environ["SPHINX_PATTERN"] = "-api"
61+
elif whatsnew:
62+
os.environ["SPHINX_PATTERN"] = "whatsnew"
5963

6064
self.single_doc_html = None
6165
if single_doc and single_doc.endswith(".rst"):
@@ -235,6 +239,9 @@ def html(self):
235239
self._open_browser(self.single_doc_html)
236240
else:
237241
self._add_redirects()
242+
if self.whatsnew:
243+
self._open_browser(os.path.join("whatsnew", "index.html"))
244+
238245
return ret_code
239246

240247
def latex(self, force=False):
@@ -302,6 +309,12 @@ def main():
302309
argparser.add_argument(
303310
"--no-api", default=False, help="omit api and autosummary", action="store_true"
304311
)
312+
argparser.add_argument(
313+
"--whatsnew",
314+
default=False,
315+
help="only build whatsnew (and api for links)",
316+
action="store_true",
317+
)
305318
argparser.add_argument(
306319
"--single",
307320
metavar="FILENAME",
@@ -353,6 +366,7 @@ def main():
353366
builder = DocBuilder(
354367
args.num_jobs,
355368
not args.no_api,
369+
args.whatsnew,
356370
args.single,
357371
args.verbosity,
358372
args.warnings_are_errors,

doc/source/conf.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@
9191
# (e.g. '10min.rst' or 'pandas.DataFrame.head')
9292
source_path = os.path.dirname(os.path.abspath(__file__))
9393
pattern = os.environ.get("SPHINX_PATTERN")
94-
single_doc = pattern is not None and pattern != "-api"
95-
include_api = pattern != "-api"
94+
single_doc = pattern is not None and pattern not in ("-api", "whatsnew")
95+
include_api = pattern is None or pattern == "whatsnew"
9696
if pattern:
9797
for dirname, dirs, fnames in os.walk(source_path):
9898
reldir = os.path.relpath(dirname, source_path)
@@ -104,7 +104,13 @@
104104
continue
105105
elif pattern == "-api" and reldir.startswith("reference"):
106106
exclude_patterns.append(fname)
107-
elif pattern != "-api" and fname != pattern:
107+
elif (
108+
pattern == "whatsnew"
109+
and not reldir.startswith("reference")
110+
and reldir != "whatsnew"
111+
):
112+
exclude_patterns.append(fname)
113+
elif single_doc and fname != pattern:
108114
exclude_patterns.append(fname)
109115

110116
with open(os.path.join(source_path, "index.rst.template")) as f:

doc/source/development/contributing.rst

+15
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,10 @@ reducing the turn-around time for checking your changes.
604604
python make.py clean
605605
python make.py --single pandas.DataFrame.join
606606

607+
# compile whatsnew and API section (to resolve links in the whatsnew)
608+
python make.py clean
609+
python make.py --whatsnew
610+
607611
For comparison, a full documentation build may take 15 minutes, but a single
608612
section may take 15 seconds. Subsequent builds, which only process portions
609613
you have changed, will be faster.
@@ -629,6 +633,17 @@ the documentation are also built by Travis-CI. These docs are then hosted `here
629633
<https://pandas.pydata.org/docs/dev/>`__, see also
630634
the :ref:`Continuous Integration <contributing.ci>` section.
631635

636+
Previewing changes
637+
------------------
638+
639+
Once, the pull request is submitted, GitHub Actions will automatically build the
640+
documentation. To view the built site:
641+
642+
#. Wait for the ``CI / Web and docs`` check to complete.
643+
#. Click ``Details`` next to it.
644+
#. From the ``Artifacts`` drop-down, click ``docs`` or ``website`` to download
645+
the site as a ZIP file.
646+
632647
.. _contributing.code:
633648

634649
Contributing to the code base

doc/source/ecosystem.rst

+8
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,14 @@ storing numeric arrays with units. These arrays can be stored inside pandas'
476476
Series and DataFrame. Operations between Series and DataFrame columns which
477477
use pint's extension array are then units aware.
478478

479+
`Text Extensions for Pandas`_
480+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
481+
482+
``Text Extensions for Pandas <https://ibm.biz/text-extensions-for-pandas>``
483+
provides extension types to cover common data structures for representing natural language
484+
data, plus library integrations that convert the outputs of popular natural language
485+
processing libraries into Pandas DataFrames.
486+
479487
.. _ecosystem.accessors:
480488

481489
Accessors

doc/source/getting_started/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ html5lib 1.0.1 HTML parser for read_html (see :ref
274274
lxml 4.3.0 HTML parser for read_html (see :ref:`note <optional_html>`)
275275
matplotlib 2.2.3 Visualization
276276
numba 0.46.0 Alternative execution engine for rolling operations
277-
openpyxl 2.6.0 Reading / writing for xlsx files
277+
openpyxl 3.0.0 Reading / writing for xlsx files
278278
pandas-gbq 0.12.0 Google Big Query access
279279
psycopg2 2.7 PostgreSQL engine for sqlalchemy
280280
pyarrow 0.15.0 Parquet, ORC, and feather reading / writing

0 commit comments

Comments
 (0)