Skip to content

Commit 0f95d40

Browse files
Merge remote-tracking branch 'upstream/master' into docker-script
2 parents 4190806 + bf31347 commit 0f95d40

File tree

489 files changed

+23557
-13223
lines changed

Some content is hidden

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

489 files changed

+23557
-13223
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,47 @@ jobs:
150150
uses: ./.github/actions/setup
151151

152152
- name: Run tests
153+
env:
154+
PANDAS_DATA_MANAGER: array
153155
run: |
154156
source activate pandas-dev
155-
pytest pandas/tests/frame/methods --array-manager
156-
pytest pandas/tests/arithmetic/ --array-manager
157+
158+
pytest pandas/tests/frame/methods
159+
pytest pandas/tests/frame/test_constructors.py
160+
pytest pandas/tests/frame/test_*
161+
pytest pandas/tests/frame/test_reductions.py
162+
pytest pandas/tests/reductions/
163+
pytest pandas/tests/generic/test_generic.py
164+
pytest pandas/tests/arithmetic/
165+
pytest pandas/tests/groupby/
166+
pytest pandas/tests/resample/
167+
pytest pandas/tests/reshape/merge
168+
169+
pytest pandas/tests/series/methods
170+
pytest pandas/tests/series/test_*
157171
158172
# indexing subset (temporary since other tests don't pass yet)
159-
pytest pandas/tests/frame/indexing/test_indexing.py::TestDataFrameIndexing::test_setitem_boolean --array-manager
160-
pytest pandas/tests/frame/indexing/test_where.py --array-manager
161-
pytest pandas/tests/frame/indexing/test_indexing.py::TestDataFrameIndexing::test_setitem_multi_index --array-manager
162-
pytest pandas/tests/frame/indexing/test_setitem.py::TestDataFrameSetItem::test_setitem_listlike_indexer_duplicate_columns --array-manager
163-
pytest pandas/tests/indexing/multiindex/test_setitem.py::TestMultiIndexSetItem::test_astype_assignment_with_dups --array-manager
164-
pytest pandas/tests/indexing/multiindex/test_setitem.py::TestMultiIndexSetItem::test_frame_setitem_multi_column --array-manager
173+
pytest pandas/tests/frame/indexing/test_indexing.py::TestDataFrameIndexing::test_setitem_boolean
174+
pytest pandas/tests/frame/indexing/test_where.py
175+
pytest pandas/tests/frame/indexing/test_setitem.py::TestDataFrameSetItem::test_setitem_multi_index
176+
pytest pandas/tests/frame/indexing/test_setitem.py::TestDataFrameSetItem::test_setitem_listlike_indexer_duplicate_columns
177+
pytest pandas/tests/indexing/multiindex/test_setitem.py::TestMultiIndexSetItem::test_astype_assignment_with_dups
178+
pytest pandas/tests/indexing/multiindex/test_setitem.py::TestMultiIndexSetItem::test_frame_setitem_multi_column
179+
180+
pytest pandas/tests/api/
181+
pytest pandas/tests/arrays/
182+
pytest pandas/tests/base/
183+
pytest pandas/tests/computation/
184+
pytest pandas/tests/config/
185+
pytest pandas/tests/dtypes/
186+
pytest pandas/tests/generic/
187+
pytest pandas/tests/indexes/
188+
pytest pandas/tests/libs/
189+
pytest pandas/tests/plotting/
190+
pytest pandas/tests/scalar/
191+
pytest pandas/tests/strings/
192+
pytest pandas/tests/tools/
193+
pytest pandas/tests/tseries/
194+
pytest pandas/tests/tslibs/
195+
pytest pandas/tests/util/
196+
pytest pandas/tests/window/

.pre-commit-config.yaml

Lines changed: 127 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,38 @@
11
minimum_pre_commit_version: 2.9.2
22
exclude: ^LICENSES/|\.(html|csv|svg)$
33
repos:
4+
- repo: https://github.com/MarcoGorelli/absolufy-imports
5+
rev: v0.2.1
6+
hooks:
7+
- id: absolufy-imports
8+
files: ^pandas/
49
- repo: https://github.com/python/black
510
rev: 20.8b1
611
hooks:
712
- id: black
13+
- repo: https://github.com/codespell-project/codespell
14+
rev: v2.0.0
15+
hooks:
16+
- id: codespell
17+
types_or: [python, rst, markdown]
18+
files: ^(pandas|doc)/
19+
exclude: ^pandas/tests/
20+
- repo: https://github.com/pre-commit/pre-commit-hooks
21+
rev: v3.4.0
22+
hooks:
23+
- id: end-of-file-fixer
24+
exclude: \.txt$
25+
- id: trailing-whitespace
26+
- repo: https://github.com/cpplint/cpplint
27+
rev: f7061b1 # the latest tag does not have the hook
28+
hooks:
29+
- id: cpplint
30+
# We don't lint all C files because we don't want to lint any that are built
31+
# from Cython files nor do we want to lint C files that we didn't modify for
32+
# this particular codebase (e.g. src/headers, src/klib). However,
33+
# we can lint all header files since they aren't "generated" like C files are.
34+
exclude: ^pandas/_libs/src/(klib|headers)/
35+
args: [--quiet, '--extensions=c,h', '--headers=h', --recursive, '--filter=-readability/casting,-runtime/int,-build/include_subdir']
836
- repo: https://gitlab.com/pycqa/flake8
937
rev: 3.8.4
1038
hooks:
@@ -23,29 +51,31 @@ repos:
2351
rev: 5.7.0
2452
hooks:
2553
- id: isort
54+
- repo: https://github.com/MarcoGorelli/no-string-hints
55+
rev: v0.1.7
56+
hooks:
57+
- id: no-string-hints
2658
- repo: https://github.com/asottile/pyupgrade
2759
rev: v2.10.0
2860
hooks:
2961
- id: pyupgrade
3062
args: [--py37-plus, --keep-runtime-typing]
3163
- repo: https://github.com/pre-commit/pygrep-hooks
32-
rev: v1.7.1
64+
rev: v1.8.0
3365
hooks:
3466
- id: rst-backticks
3567
- id: rst-directive-colons
36-
types: [text]
68+
types: [text] # overwrite types: [rst]
69+
types_or: [python, rst]
3770
- id: rst-inline-touching-normal
38-
types: [text]
71+
types: [text] # overwrite types: [rst]
72+
types_or: [python, rst]
73+
- repo: https://github.com/asottile/yesqa
74+
rev: v1.2.2
75+
hooks:
76+
- id: yesqa
3977
- repo: local
4078
hooks:
41-
- id: pip_to_conda
42-
name: Generate pip dependency from conda
43-
description: This hook checks if the conda environment.yml and requirements-dev.txt are equal
44-
language: python
45-
entry: python scripts/generate_pip_deps_from_conda.py
46-
files: ^(environment.yml|requirements-dev.txt)$
47-
pass_filenames: false
48-
additional_dependencies: [pyyaml]
4979
- id: flake8-rst
5080
name: flake8-rst
5181
description: Run flake8 on code snippets in docstrings or RST files
@@ -54,6 +84,40 @@ repos:
5484
types: [rst]
5585
args: [--filename=*.rst]
5686
additional_dependencies: [flake8-rst==0.7.0, flake8==3.7.9]
87+
- id: frame-or-series-union
88+
name: Check for use of Union[Series, DataFrame] instead of FrameOrSeriesUnion alias
89+
entry: Union\[.*(Series,.*DataFrame|DataFrame,.*Series).*\]
90+
language: pygrep
91+
types: [python]
92+
exclude: ^pandas/_typing\.py$
93+
- id: inconsistent-namespace-usage
94+
name: 'Check for inconsistent use of pandas namespace in tests'
95+
entry: python scripts/check_for_inconsistent_pandas_namespace.py
96+
language: python
97+
types: [python]
98+
files: ^pandas/tests/
99+
- id: incorrect-code-directives
100+
name: Check for incorrect code block or IPython directives
101+
language: pygrep
102+
entry: (\.\. code-block ::|\.\. ipython ::)
103+
types_or: [python, cython, rst]
104+
- id: no-os-remove
105+
name: Check code for instances of os.remove
106+
entry: os\.remove
107+
language: pygrep
108+
types: [python]
109+
files: ^pandas/tests/
110+
exclude: |
111+
(?x)^
112+
pandas/tests/io/excel/test_writers\.py
113+
|pandas/tests/io/pytables/common\.py
114+
|pandas/tests/io/pytables/test_store\.py$
115+
- id: no-pandas-api-types
116+
name: Check code for instances of pd.api.types
117+
entry: (pd|pandas)\.api\.types\.
118+
language: pygrep
119+
types: [python]
120+
files: ^pandas/tests/
57121
- id: non-standard-imports
58122
name: Check for non-standard imports
59123
language: pygrep
@@ -65,17 +129,6 @@ repos:
65129
66130
# Check for imports from collections.abc instead of `from collections import abc`
67131
|from\ collections\.abc\ import
68-
69-
- id: non-standard-numpy.random-related-imports
70-
name: Check for non-standard numpy.random-related imports excluding pandas/_testing.py
71-
language: pygrep
72-
exclude: pandas/_testing.py
73-
entry: |
74-
(?x)
75-
# Check for imports from np.random.<method> instead of `from numpy import random` or `from numpy.random import <method>`
76-
from\ numpy\ import\ random
77-
|from\ numpy.random\ import
78-
types: [python]
79132
- id: non-standard-imports-in-tests
80133
name: Check for non-standard imports in test suite
81134
language: pygrep
@@ -93,62 +146,79 @@ repos:
93146
|pd\.testing\.
94147
types: [python]
95148
files: ^pandas/tests/
96-
- id: incorrect-code-directives
97-
name: Check for incorrect code block or IPython directives
149+
- id: non-standard-numpy-random-related-imports
150+
name: Check for non-standard numpy.random-related imports excluding pandas/_testing.py
151+
language: pygrep
152+
exclude: pandas/_testing.py
153+
entry: |
154+
(?x)
155+
# Check for imports from np.random.<method> instead of `from numpy import random` or `from numpy.random import <method>`
156+
from\ numpy\ import\ random
157+
|from\ numpy.random\ import
158+
types: [python]
159+
- id: np-bool
160+
name: Check for use of np.bool instead of np.bool_
161+
entry: np\.bool[^_8]
98162
language: pygrep
99-
entry: (\.\. code-block ::|\.\. ipython ::)
100163
types_or: [python, cython, rst]
101-
- id: unwanted-patterns-strings-to-concatenate
102-
name: Check for use of not concatenated strings
164+
- id: np-object
165+
name: Check for use of np.object instead of np.object_
166+
entry: np\.object[^_8]
167+
language: pygrep
168+
types_or: [python, cython, rst]
169+
- id: pip-to-conda
170+
name: Generate pip dependency from conda
171+
description: This hook checks if the conda environment.yml and requirements-dev.txt are equal
103172
language: python
104-
entry: python scripts/validate_unwanted_patterns.py --validation-type="strings_to_concatenate"
105-
types_or: [python, cython]
106-
- id: unwanted-patterns-strings-with-wrong-placed-whitespace
107-
name: Check for strings with wrong placed spaces
173+
entry: python scripts/generate_pip_deps_from_conda.py
174+
files: ^(environment.yml|requirements-dev.txt)$
175+
pass_filenames: false
176+
additional_dependencies: [pyyaml]
177+
- id: title-capitalization
178+
name: Validate correct capitalization among titles in documentation
179+
entry: python scripts/validate_rst_title_capitalization.py
108180
language: python
109-
entry: python scripts/validate_unwanted_patterns.py --validation-type="strings_with_wrong_placed_whitespace"
181+
types: [rst]
182+
files: ^doc/source/(development|reference)/
183+
- id: type-not-class
184+
name: Check for use of foo.__class__ instead of type(foo)
185+
entry: \.__class__
186+
language: pygrep
110187
types_or: [python, cython]
111-
- id: unwanted-patterns-private-import-across-module
112-
name: Check for import of private attributes across modules
188+
- id: unwanted-patterns-bare-pytest-raises
189+
name: Check for use of bare pytest raises
113190
language: python
114-
entry: python scripts/validate_unwanted_patterns.py --validation-type="private_import_across_module"
191+
entry: python scripts/validate_unwanted_patterns.py --validation-type="bare_pytest_raises"
115192
types: [python]
116-
exclude: ^(asv_bench|pandas/tests|doc)/
193+
files: ^pandas/tests/
194+
exclude: ^pandas/tests/extension/
117195
- id: unwanted-patterns-private-function-across-module
118196
name: Check for use of private functions across modules
119197
language: python
120198
entry: python scripts/validate_unwanted_patterns.py --validation-type="private_function_across_module"
121199
types: [python]
122200
exclude: ^(asv_bench|pandas/tests|doc)/
123-
- id: unwanted-patterns-bare-pytest-raises
124-
name: Check for use of bare pytest raises
201+
- id: unwanted-patterns-private-import-across-module
202+
name: Check for import of private attributes across modules
125203
language: python
126-
entry: python scripts/validate_unwanted_patterns.py --validation-type="bare_pytest_raises"
204+
entry: python scripts/validate_unwanted_patterns.py --validation-type="private_import_across_module"
127205
types: [python]
128-
files: ^pandas/tests/
129-
exclude: ^pandas/tests/extension/
130-
- id: unwanted-patters-pytest-xfail
206+
exclude: ^(asv_bench|pandas/tests|doc)/
207+
- id: unwanted-patterns-pytest-xfail
131208
name: Check for use of pytest.xfail
132209
entry: pytest\.xfail
133210
language: pygrep
134211
types: [python]
135212
files: ^pandas/tests/
136-
- id: inconsistent-namespace-usage
137-
name: 'Check for inconsistent use of pandas namespace in tests'
138-
entry: python scripts/check_for_inconsistent_pandas_namespace.py
213+
- id: unwanted-patterns-strings-to-concatenate
214+
name: Check for use of not concatenated strings
139215
language: python
140-
types: [python]
141-
files: ^pandas/tests/frame/
142-
- id: FrameOrSeriesUnion
143-
name: Check for use of Union[Series, DataFrame] instead of FrameOrSeriesUnion alias
144-
entry: Union\[.*(Series,.*DataFrame|DataFrame,.*Series).*\]
145-
language: pygrep
146-
types: [python]
147-
exclude: ^pandas/_typing\.py$
148-
- id: type-not-class
149-
name: Check for use of foo.__class__ instead of type(foo)
150-
entry: \.__class__
151-
language: pygrep
216+
entry: python scripts/validate_unwanted_patterns.py --validation-type="strings_to_concatenate"
217+
types_or: [python, cython]
218+
- id: unwanted-patterns-strings-with-wrong-placed-whitespace
219+
name: Check for strings with wrong placed spaces
220+
language: python
221+
entry: python scripts/validate_unwanted_patterns.py --validation-type="strings_with_wrong_placed_whitespace"
152222
types_or: [python, cython]
153223
- id: unwanted-typing
154224
name: Check for outdated annotation syntax and missing error codes
@@ -158,57 +228,3 @@ repos:
158228
|\#\ type:\s?ignore(?!\[)
159229
language: pygrep
160230
types: [python]
161-
- id: np-bool
162-
name: Check for use of np.bool instead of np.bool_
163-
entry: np\.bool[^_8]
164-
language: pygrep
165-
types_or: [python, cython, rst]
166-
- id: no-os-remove
167-
name: Check code for instances of os.remove
168-
entry: os\.remove
169-
language: pygrep
170-
types: [python]
171-
files: ^pandas/tests/
172-
exclude: |
173-
(?x)^
174-
pandas/tests/io/excel/test_writers\.py
175-
|pandas/tests/io/pytables/common\.py
176-
|pandas/tests/io/pytables/test_store\.py$
177-
- id: no-pandas-api-types
178-
name: Check code for instances of pd.api.types
179-
entry: (pd|pandas)\.api\.types\.
180-
language: pygrep
181-
types: [python]
182-
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)/
189-
- repo: https://github.com/asottile/yesqa
190-
rev: v1.2.2
191-
hooks:
192-
- id: yesqa
193-
- repo: https://github.com/pre-commit/pre-commit-hooks
194-
rev: v3.4.0
195-
hooks:
196-
- id: end-of-file-fixer
197-
exclude: \.txt$
198-
- id: trailing-whitespace
199-
- repo: https://github.com/codespell-project/codespell
200-
rev: v2.0.0
201-
hooks:
202-
- id: codespell
203-
types_or: [python, rst, markdown]
204-
files: ^pandas/
205-
exclude: ^pandas/tests/
206-
- repo: https://github.com/MarcoGorelli/no-string-hints
207-
rev: v0.1.7
208-
hooks:
209-
- id: no-string-hints
210-
- repo: https://github.com/MarcoGorelli/abs-imports
211-
rev: v0.1.2
212-
hooks:
213-
- id: abs-imports
214-
files: ^pandas/

Makefile

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,3 @@ doc:
2525
cd doc; \
2626
python make.py clean; \
2727
python make.py html
28-
29-
check:
30-
python3 scripts/validate_unwanted_patterns.py \
31-
--validation-type="private_function_across_module" \
32-
--included-file-extensions="py" \
33-
--excluded-file-paths=pandas/tests,asv_bench/ \
34-
pandas/
35-
36-
python3 scripts/validate_unwanted_patterns.py \
37-
--validation-type="private_import_across_module" \
38-
--included-file-extensions="py" \
39-
--excluded-file-paths=pandas/tests,asv_bench/,doc/
40-
pandas/

0 commit comments

Comments
 (0)