diff --git a/.github/workflows/package-checks.yml b/.github/workflows/package-checks.yml new file mode 100644 index 0000000000000..762cb509be136 --- /dev/null +++ b/.github/workflows/package-checks.yml @@ -0,0 +1,56 @@ +name: Package Checks + +on: + push: + branches: + - main + - 1.5.x + pull_request: + branches: + - main + - 1.5.x + +permissions: + contents: read + +jobs: + pip: + runs-on: ubuntu-latest + strategy: + matrix: + 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"] + fail-fast: false + name: Install Extras - ${{ matrix.extra }} + concurrency: + # https://github.community/t/concurrecy-not-work-for-push/183068/7 + group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-pip-extras-${{ matrix.extra }} + cancel-in-progress: true + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Python + id: setup_python + uses: actions/setup-python@v3 + with: + python-version: '3.8' + + # Hacky patch to disable building cython extensions. + # This job should only check that the extras successfully install. + - name: Disable building ext_modules + run: | + sed -i '/ext_modules=/d' setup.py + shell: bash -el {0} + + - name: Install required dependencies + run: | + python -m pip install --upgrade pip setuptools wheel python-dateutil pytz numpy cython + shell: bash -el {0} + + - name: Pip install with extra + run: | + python -m pip install -e .[${{ matrix.extra }}] --no-build-isolation + shell: bash -el {0} diff --git a/doc/source/getting_started/install.rst b/doc/source/getting_started/install.rst index 11c419c399877..d4d7ee5efcbb0 100644 --- a/doc/source/getting_started/install.rst +++ b/doc/source/getting_started/install.rst @@ -415,7 +415,7 @@ depending on required compatibility. Dependency Minimum Version optional_extra Notes ========================= ================== ================ ============================================================= PyTables 3.6.1 hdf5 HDF5-based reading / writing -blosc 1.21.0 hdf5 Compression for HDF5 +blosc 1.21.0 hdf5 Compression for HDF5; only available on ``conda`` zlib hdf5 Compression for HDF5 fastparquet 0.6.3 - Parquet reading / writing (pyarrow is default) pyarrow 6.0.0 parquet, feather Parquet, ORC, and feather reading / writing diff --git a/scripts/validate_min_versions_in_sync.py b/scripts/validate_min_versions_in_sync.py index ad0375a4320a2..a69bdb95c0f9b 100755 --- a/scripts/validate_min_versions_in_sync.py +++ b/scripts/validate_min_versions_in_sync.py @@ -24,7 +24,7 @@ ) CODE_PATH = pathlib.Path("pandas/compat/_optional.py").resolve() SETUP_PATH = pathlib.Path("setup.cfg").resolve() -EXCLUDE_DEPS = {"tzdata"} +EXCLUDE_DEPS = {"tzdata", "blosc"} # pandas package is not available # in pre-commit environment sys.path.append("pandas/compat") @@ -38,10 +38,11 @@ def get_versions_from_code() -> dict[str, str]: + """Min versions for checking within pandas code.""" install_map = _optional.INSTALL_MAPPING versions = _optional.VERSIONS for item in EXCLUDE_DEPS: - versions.pop(item) + versions.pop(item, None) return { install_map.get(k, k).casefold(): v for k, v in versions.items() @@ -50,6 +51,7 @@ def get_versions_from_code() -> dict[str, str]: def get_versions_from_ci(content: list[str]) -> tuple[dict[str, str], dict[str, str]]: + """Min versions in CI job for testing all optional dependencies.""" # Don't parse with pyyaml because it ignores comments we're looking for seen_required = False seen_optional = False @@ -79,6 +81,7 @@ def get_versions_from_ci(content: list[str]) -> tuple[dict[str, str], dict[str, def get_versions_from_setup() -> dict[str, str]: + """Min versions in setup.cfg for pip install pandas[extra].""" install_map = _optional.INSTALL_MAPPING optional_dependencies = {} @@ -99,7 +102,7 @@ def get_versions_from_setup() -> dict[str, str]: optional_dependencies[install_map.get(package, package).casefold()] = version for item in EXCLUDE_DEPS: - optional_dependencies.pop(item) + optional_dependencies.pop(item, None) return optional_dependencies diff --git a/setup.cfg b/setup.cfg index 785143c7b647c..62bebac8a2885 100644 --- a/setup.cfg +++ b/setup.cfg @@ -85,7 +85,8 @@ parquet = feather = pyarrow>=6.0.0 hdf5 = - blosc>=1.20.1 + # blosc only available on conda (https://github.com/Blosc/python-blosc/issues/297) + # blosc>=1.20.1 tables>=3.6.1 spss = pyreadstat>=1.1.2 @@ -121,7 +122,8 @@ compression = # `all ` should be kept as the complete set of pandas optional dependencies for general use. all = beautifulsoup4>=4.9.3 - blosc>=1.21.0 + # blosc only available on conda (https://github.com/Blosc/python-blosc/issues/297) + # blosc>=1.21.0 bottleneck>=1.3.2 brotlipy>=0.7.0 fastparquet>=0.6.3