Skip to content

Commit 66f9277

Browse files
mroeschkeyehoshuadimarsky
authored andcommitted
DEPS: Sync environment.yml with CI dep files (pandas-dev#47287)
1 parent 82cee28 commit 66f9277

30 files changed

+264
-255
lines changed

.github/workflows/code-checks.yml

+29
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,32 @@ jobs:
157157

158158
- name: Build image
159159
run: docker build --pull --no-cache --tag pandas-dev-env .
160+
161+
requirements-dev-text-installable:
162+
name: Test install requirements-dev.txt
163+
runs-on: ubuntu-latest
164+
165+
concurrency:
166+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
167+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-requirements-dev-text-installable
168+
cancel-in-progress: true
169+
170+
steps:
171+
- name: Checkout
172+
uses: actions/checkout@v3
173+
with:
174+
fetch-depth: 0
175+
176+
- name: Setup Python
177+
id: setup_python
178+
uses: actions/setup-python@v3
179+
with:
180+
python-version: '3.8'
181+
cache: 'pip'
182+
cache-dependency-path: 'requirements-dev.txt'
183+
184+
- name: Install requirements-dev.txt
185+
run: pip install -r requirements-dev.txt
186+
187+
- name: Check Pip Cache Hit
188+
run: echo ${{ steps.setup_python.outputs.cache-hit }}

.github/workflows/posix.yml renamed to .github/workflows/ubuntu.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Posix
1+
name: Ubuntu
22

33
on:
44
push:
@@ -145,7 +145,7 @@ jobs:
145145

146146
- name: Extra installs
147147
# xsel for clipboard tests
148-
run: sudo apt-get update && sudo apt-get install -y libc6-dev-i386 xsel ${{ env.EXTRA_APT }}
148+
run: sudo apt-get update && sudo apt-get install -y xsel ${{ env.EXTRA_APT }}
149149

150150
- name: Set up Conda
151151
uses: ./.github/actions/setup-conda

ci/deps/actions-310.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ dependencies:
3131
- jinja2
3232
- lxml
3333
- matplotlib
34-
# TODO: uncomment after numba supports py310
35-
#- numba
34+
- numba
3635
- numexpr
3736
- openpyxl
3837
- odfpy

environment.yml

+77-75
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,85 @@
1+
# Local development dependencies including docs building, website upload, ASV benchmark
12
name: pandas-dev
23
channels:
34
- conda-forge
45
dependencies:
5-
# required
6-
- numpy>=1.19.5
76
- python=3.8
8-
- python-dateutil>=2.8.1
7+
8+
# test dependencies
9+
- cython=0.29.30
10+
- pytest>=6.0
11+
- pytest-cov
12+
- pytest-xdist>=1.31
13+
- psutil
14+
- pytest-asyncio>=0.17
15+
- boto3
16+
17+
# required dependencies
18+
- python-dateutil
19+
- numpy
920
- pytz
1021

22+
# optional dependencies
23+
- beautifulsoup4
24+
- blosc
25+
- brotlipy
26+
- bottleneck
27+
- fastparquet
28+
- fsspec
29+
- html5lib
30+
- hypothesis
31+
- gcsfs
32+
- jinja2
33+
- lxml
34+
- matplotlib
35+
- numba>=0.53.1
36+
- numexpr>=2.8.0 # pin for "Run checks on imported code" job
37+
- openpyxl
38+
- odfpy
39+
- pandas-gbq
40+
- psycopg2
41+
- pyarrow
42+
- pymysql
43+
- pyreadstat
44+
- pytables
45+
- python-snappy
46+
- pyxlsb
47+
- s3fs
48+
- scipy
49+
- sqlalchemy
50+
- tabulate
51+
- xarray
52+
- xlrd
53+
- xlsxwriter
54+
- xlwt
55+
- zstandard
56+
57+
# downstream packages
58+
- aiobotocore<2.0.0 # GH#44311 pinned to fix docbuild
59+
- botocore
60+
- cftime
61+
- dask
62+
- ipython
63+
- geopandas-base
64+
- seaborn
65+
- scikit-learn
66+
- statsmodels
67+
- coverage
68+
- pandas-datareader
69+
- pyyaml
70+
- py
71+
- pytorch
72+
73+
# local testing dependencies
74+
- moto
75+
- flask
76+
1177
# benchmarks
1278
- asv
1379

14-
# building
1580
# The compiler packages are meta-packages and install the correct compiler (activation) packages on the respective platforms.
1681
- c-compiler
1782
- cxx-compiler
18-
- cython>=0.29.30
1983

2084
# code checks
2185
- black=22.3.0
@@ -32,10 +96,11 @@ dependencies:
3296
# documentation
3397
- gitpython # obtain contributors from git for whatsnew
3498
- gitdb
99+
- natsort # DataFrame.sort_values doctest
35100
- numpydoc
36101
- pandas-dev-flaker=0.5.0
37102
- pydata-sphinx-theme=0.8.0
38-
- pytest-cython
103+
- pytest-cython # doctest
39104
- sphinx
40105
- sphinx-panels
41106
- types-python-dateutil
@@ -47,77 +112,14 @@ dependencies:
47112
- nbconvert>=6.4.5
48113
- nbsphinx
49114
- pandoc
50-
51-
# Dask and its dependencies (that dont install with dask)
52-
- dask-core
53-
- toolz>=0.7.3
54-
- partd>=0.3.10
55-
- cloudpickle>=0.2.1
56-
57-
# web (jinja2 is also needed, but it's also an optional pandas dependency)
58-
- markdown
59-
- feedparser
60-
- pyyaml
61-
- requests
62-
63-
# testing
64-
- boto3
65-
- botocore>=1.11
66-
- hypothesis>=5.5.3
67-
- moto # mock S3
68-
- flask
69-
- pytest>=6.0
70-
- pytest-cov
71-
- pytest-xdist>=1.31
72-
- pytest-asyncio>=0.17
73-
- pytest-instafail
74-
75-
# downstream tests
76-
- seaborn
77-
- statsmodels
78-
79-
# unused (required indirectly may be?)
80115
- ipywidgets
81116
- nbformat
82117
- notebook>=6.0.3
83-
84-
# optional
85-
- blosc
86-
- bottleneck>=1.3.1
87118
- ipykernel
88-
- ipython>=7.11.1
89-
- jinja2 # pandas.Styler
90-
- matplotlib>=3.3.2 # pandas.plotting, Series.plot, DataFrame.plot
91-
- numexpr>=2.7.1
92-
- scipy>=1.4.1
93-
- numba>=0.50.1
94-
95-
# optional for io
96-
# ---------------
97-
# pd.read_html
98-
- beautifulsoup4>=4.8.2
99-
- html5lib
100-
- lxml
101-
102-
# pd.read_excel, DataFrame.to_excel, pd.ExcelWriter, pd.ExcelFile
103-
- openpyxl
104-
- xlrd
105-
- xlsxwriter
106-
- xlwt
107-
- odfpy
108-
109-
- fastparquet>=0.4.0 # pandas.read_parquet, DataFrame.to_parquet
110-
- pyarrow>2.0.1 # pandas.read_parquet, DataFrame.to_parquet, pandas.read_feather, DataFrame.to_feather
111-
- python-snappy # required by pyarrow
112119

113-
- pytables>=3.6.1 # pandas.read_hdf, DataFrame.to_hdf
114-
- s3fs>=0.4.0 # file IO when using 's3://...' path
115-
- aiobotocore<2.0.0 # GH#44311 pinned to fix docbuild
116-
- fsspec>=0.7.4 # for generic remote file operations
117-
- gcsfs>=0.6.0 # file IO when using 'gcs://...' path
118-
- sqlalchemy # pandas.read_sql, DataFrame.to_sql
119-
- xarray # DataFrame.to_xarray
120-
- cftime # Needed for downstream xarray.CFTimeIndex test
121-
- pyreadstat # pandas.read_spss
122-
- tabulate>=0.8.3 # DataFrame.to_markdown
123-
- natsort # DataFrame.sort_values
120+
# web
121+
- jinja2 # in optional dependencies, but documented here as needed
122+
- markdown
123+
- feedparser
124+
- pyyaml
125+
- requests

pandas/core/algorithms.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -1064,12 +1064,7 @@ def checked_add_with_arr(
10641064
elif arr_mask is not None:
10651065
not_nan = np.logical_not(arr_mask)
10661066
elif b_mask is not None:
1067-
# Argument 1 to "__call__" of "_UFunc_Nin1_Nout1" has incompatible type
1068-
# "Optional[ndarray[Any, dtype[bool_]]]"; expected
1069-
# "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[An
1070-
# y]]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool,
1071-
# int, float, complex, str, bytes]]]" [arg-type]
1072-
not_nan = np.logical_not(b2_mask) # type: ignore[arg-type]
1067+
not_nan = np.logical_not(b2_mask)
10731068
else:
10741069
not_nan = np.empty(arr.shape, dtype=bool)
10751070
not_nan.fill(True)

pandas/core/array_algos/quantile.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,7 @@ def _nanpercentile_1d(
143143
return np.percentile(
144144
values,
145145
qs,
146-
# error: No overload variant of "percentile" matches argument types
147-
# "ndarray[Any, Any]", "ndarray[Any, dtype[floating[_64Bit]]]",
148-
# "int", "Dict[str, str]"
149-
**{np_percentile_argname: interpolation}, # type: ignore[call-overload]
146+
**{np_percentile_argname: interpolation},
150147
)
151148

152149

@@ -215,8 +212,5 @@ def _nanpercentile(
215212
values,
216213
qs,
217214
axis=1,
218-
# error: No overload variant of "percentile" matches argument types
219-
# "ndarray[Any, Any]", "ndarray[Any, dtype[floating[_64Bit]]]",
220-
# "int", "Dict[str, str]"
221-
**{np_percentile_argname: interpolation}, # type: ignore[call-overload]
215+
**{np_percentile_argname: interpolation},
222216
)

pandas/core/arraylike.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,11 @@ def array_ufunc(self, ufunc: np.ufunc, method: str, *inputs: Any, **kwargs: Any)
265265
return result
266266

267267
# Determine if we should defer.
268-
no_defer = (np.ndarray.__array_ufunc__, cls.__array_ufunc__)
268+
# error: "Type[ndarray[Any, Any]]" has no attribute "__array_ufunc__"
269+
no_defer = (
270+
np.ndarray.__array_ufunc__, # type: ignore[attr-defined]
271+
cls.__array_ufunc__,
272+
)
269273

270274
for item in inputs:
271275
higher_priority = (

pandas/core/arrays/arrow/array.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def _indexing_key_to_indices(
496496
if isinstance(key, slice):
497497
indices = np.arange(n)[key]
498498
elif is_integer(key):
499-
indices = np.arange(n)[[key]] # type: ignore[index]
499+
indices = np.arange(n)[[key]]
500500
elif is_bool_dtype(key):
501501
key = np.asarray(key)
502502
if len(key) != n:

pandas/core/arrays/datetimes.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,10 @@ def _generate_range(
487487
np.linspace(0, end.value - start.value, periods, dtype="int64")
488488
+ start.value
489489
)
490-
if i8values.dtype != "i8":
490+
# error: Non-overlapping equality check
491+
# (left operand type: "dtype[signedinteger[Any]]",
492+
# right operand type: "Literal['i8']")
493+
if i8values.dtype != "i8": # type: ignore[comparison-overlap]
491494
# 2022-01-09 I (brock) am not sure if it is possible for this
492495
# to overflow and cast to e.g. f8, but if it does we need to cast
493496
i8values = i8values.astype("i8")

pandas/core/arrays/interval.py

+16-8
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,21 @@ def __getitem__(
687687
if is_scalar(left) and isna(left):
688688
return self._fill_value
689689
return Interval(left, right, inclusive=self.inclusive)
690-
if np.ndim(left) > 1:
690+
# error: Argument 1 to "ndim" has incompatible type
691+
# "Union[ndarray[Any, Any], ExtensionArray]"; expected
692+
# "Union[Sequence[Sequence[Sequence[Sequence[Sequence[Any]]]]],
693+
# Union[Union[_SupportsArray[dtype[Any]],
694+
# Sequence[_SupportsArray[dtype[Any]]],
695+
# Sequence[Sequence[_SupportsArray[dtype[Any]]]],
696+
# Sequence[Sequence[Sequence[_SupportsArray[dtype[Any]]]]],
697+
# Sequence[Sequence[Sequence[Sequence[_SupportsArray[dtype[Any]]]]]]],
698+
# Union[bool, int, float, complex, str, bytes,
699+
# Sequence[Union[bool, int, float, complex, str, bytes]],
700+
# Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]],
701+
# Sequence[Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]]],
702+
# Sequence[Sequence[Sequence[Sequence[Union[bool, int, float,
703+
# complex, str, bytes]]]]]]]]"
704+
if np.ndim(left) > 1: # type: ignore[arg-type]
691705
# GH#30588 multi-dimensional indexer disallowed
692706
raise ValueError("multi-dimensional indexing not allowed")
693707
return self._shallow_copy(left, right)
@@ -1665,13 +1679,7 @@ def isin(self, values) -> np.ndarray:
16651679
# complex128 ndarray is much more performant.
16661680
left = self._combined.view("complex128")
16671681
right = values._combined.view("complex128")
1668-
# Argument 1 to "in1d" has incompatible type "Union[ExtensionArray,
1669-
# ndarray[Any, Any], ndarray[Any, dtype[Any]]]"; expected
1670-
# "Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[
1671-
# dtype[Any]]], bool, int, float, complex, str, bytes,
1672-
# _NestedSequence[Union[bool, int, float, complex, str, bytes]]]"
1673-
# [arg-type]
1674-
return np.in1d(left, right) # type: ignore[arg-type]
1682+
return np.in1d(left, right)
16751683

16761684
elif needs_i8_conversion(self.left.dtype) ^ needs_i8_conversion(
16771685
values.left.dtype

pandas/core/arrays/masked.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,13 @@ def __init__(
110110
self, values: np.ndarray, mask: npt.NDArray[np.bool_], copy: bool = False
111111
) -> None:
112112
# values is supposed to already be validated in the subclass
113-
if not (isinstance(mask, np.ndarray) and mask.dtype == np.bool_):
113+
if not (
114+
isinstance(mask, np.ndarray)
115+
and
116+
# error: Non-overlapping equality check
117+
# (left operand type: "dtype[bool_]", right operand type: "Type[bool_]")
118+
mask.dtype == np.bool_ # type: ignore[comparison-overlap]
119+
):
114120
raise TypeError(
115121
"mask should be boolean numpy array. Use "
116122
"the 'pd.array' function instead"
@@ -1151,11 +1157,7 @@ def any(self, *, skipna: bool = True, **kwargs):
11511157
nv.validate_any((), kwargs)
11521158

11531159
values = self._data.copy()
1154-
# Argument 3 to "putmask" has incompatible type "object"; expected
1155-
# "Union[_SupportsArray[dtype[Any]], _NestedSequence[
1156-
# _SupportsArray[dtype[Any]]], bool, int, float, complex, str, bytes, _Nested
1157-
# Sequence[Union[bool, int, float, complex, str, bytes]]]" [arg-type]
1158-
np.putmask(values, self._mask, self._falsey_value) # type: ignore[arg-type]
1160+
np.putmask(values, self._mask, self._falsey_value)
11591161
result = values.any()
11601162
if skipna:
11611163
return result
@@ -1231,11 +1233,7 @@ def all(self, *, skipna: bool = True, **kwargs):
12311233
nv.validate_all((), kwargs)
12321234

12331235
values = self._data.copy()
1234-
# Argument 3 to "putmask" has incompatible type "object"; expected
1235-
# "Union[_SupportsArray[dtype[Any]], _NestedSequence[
1236-
# _SupportsArray[dtype[Any]]], bool, int, float, complex, str, bytes, _Neste
1237-
# dSequence[Union[bool, int, float, complex, str, bytes]]]" [arg-type]
1238-
np.putmask(values, self._mask, self._truthy_value) # type: ignore[arg-type]
1236+
np.putmask(values, self._mask, self._truthy_value)
12391237
result = values.all()
12401238

12411239
if skipna:

0 commit comments

Comments
 (0)