Skip to content

Commit 18aca9c

Browse files
authored
CI/TST: pip extras install (#49241)
1 parent ec5b62e commit 18aca9c

File tree

4 files changed

+67
-6
lines changed

4 files changed

+67
-6
lines changed

.github/workflows/package-checks.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Package Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 1.5.x
8+
pull_request:
9+
branches:
10+
- main
11+
- 1.5.x
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
pip:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
extra: ["test", "performance", "timezone", "computation", "fss", "aws", "gcp", "excel", "parquet", "feather", "hdf5", "spss", "postgresql", "mysql", "sql-other", "html", "xml", "plot", "output_formatting", "clipboard", "compression", "all"]
22+
fail-fast: false
23+
name: Install Extras - ${{ matrix.extra }}
24+
concurrency:
25+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
26+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-pip-extras-${{ matrix.extra }}
27+
cancel-in-progress: true
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v3
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Setup Python
36+
id: setup_python
37+
uses: actions/setup-python@v3
38+
with:
39+
python-version: '3.8'
40+
41+
# Hacky patch to disable building cython extensions.
42+
# This job should only check that the extras successfully install.
43+
- name: Disable building ext_modules
44+
run: |
45+
sed -i '/ext_modules=/d' setup.py
46+
shell: bash -el {0}
47+
48+
- name: Install required dependencies
49+
run: |
50+
python -m pip install --upgrade pip setuptools wheel python-dateutil pytz numpy cython
51+
shell: bash -el {0}
52+
53+
- name: Pip install with extra
54+
run: |
55+
python -m pip install -e .[${{ matrix.extra }}] --no-build-isolation
56+
shell: bash -el {0}

doc/source/getting_started/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ depending on required compatibility.
415415
Dependency Minimum Version optional_extra Notes
416416
========================= ================== ================ =============================================================
417417
PyTables 3.6.1 hdf5 HDF5-based reading / writing
418-
blosc 1.21.0 hdf5 Compression for HDF5
418+
blosc 1.21.0 hdf5 Compression for HDF5; only available on ``conda``
419419
zlib hdf5 Compression for HDF5
420420
fastparquet 0.6.3 - Parquet reading / writing (pyarrow is default)
421421
pyarrow 6.0.0 parquet, feather Parquet, ORC, and feather reading / writing

scripts/validate_min_versions_in_sync.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
)
2525
CODE_PATH = pathlib.Path("pandas/compat/_optional.py").resolve()
2626
SETUP_PATH = pathlib.Path("setup.cfg").resolve()
27-
EXCLUDE_DEPS = {"tzdata"}
27+
EXCLUDE_DEPS = {"tzdata", "blosc"}
2828
# pandas package is not available
2929
# in pre-commit environment
3030
sys.path.append("pandas/compat")
@@ -38,10 +38,11 @@
3838

3939

4040
def get_versions_from_code() -> dict[str, str]:
41+
"""Min versions for checking within pandas code."""
4142
install_map = _optional.INSTALL_MAPPING
4243
versions = _optional.VERSIONS
4344
for item in EXCLUDE_DEPS:
44-
versions.pop(item)
45+
versions.pop(item, None)
4546
return {
4647
install_map.get(k, k).casefold(): v
4748
for k, v in versions.items()
@@ -50,6 +51,7 @@ def get_versions_from_code() -> dict[str, str]:
5051

5152

5253
def get_versions_from_ci(content: list[str]) -> tuple[dict[str, str], dict[str, str]]:
54+
"""Min versions in CI job for testing all optional dependencies."""
5355
# Don't parse with pyyaml because it ignores comments we're looking for
5456
seen_required = False
5557
seen_optional = False
@@ -79,6 +81,7 @@ def get_versions_from_ci(content: list[str]) -> tuple[dict[str, str], dict[str,
7981

8082

8183
def get_versions_from_setup() -> dict[str, str]:
84+
"""Min versions in setup.cfg for pip install pandas[extra]."""
8285
install_map = _optional.INSTALL_MAPPING
8386
optional_dependencies = {}
8487

@@ -99,7 +102,7 @@ def get_versions_from_setup() -> dict[str, str]:
99102
optional_dependencies[install_map.get(package, package).casefold()] = version
100103

101104
for item in EXCLUDE_DEPS:
102-
optional_dependencies.pop(item)
105+
optional_dependencies.pop(item, None)
103106

104107
return optional_dependencies
105108

setup.cfg

+4-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ parquet =
8585
feather =
8686
pyarrow>=6.0.0
8787
hdf5 =
88-
blosc>=1.20.1
88+
# blosc only available on conda (https://github.com/Blosc/python-blosc/issues/297)
89+
# blosc>=1.20.1
8990
tables>=3.6.1
9091
spss =
9192
pyreadstat>=1.1.2
@@ -121,7 +122,8 @@ compression =
121122
# `all ` should be kept as the complete set of pandas optional dependencies for general use.
122123
all =
123124
beautifulsoup4>=4.9.3
124-
blosc>=1.21.0
125+
# blosc only available on conda (https://github.com/Blosc/python-blosc/issues/297)
126+
# blosc>=1.21.0
125127
bottleneck>=1.3.2
126128
brotlipy>=0.7.0
127129
fastparquet>=0.6.3

0 commit comments

Comments
 (0)