Skip to content

CI: Add job to validate conda-forge meta.yaml #53027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 37 additions & 4 deletions .github/workflows/package-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
permissions:
contents: read

defaults:
run:
shell: bash -el {0}

jobs:
pip:
if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}}
Expand Down Expand Up @@ -44,9 +48,38 @@ jobs:
run: |
python -m pip install --upgrade pip setuptools wheel python-dateutil pytz numpy cython
python -m pip install versioneer[toml]
shell: bash -el {0}

- name: Pip install with extra
run: |
python -m pip install -e .[${{ matrix.extra }}] --no-build-isolation
shell: bash -el {0}
run: python -m pip install -e .[${{ matrix.extra }}] --no-build-isolation
conda_forge_recipe:
if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}}
runs-on: ubuntu-22.04
name: Test Conda Forge Recipe
concurrency:
# https://github.bestrui.topmunity/t/concurrecy-not-work-for-push/183068/7
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-conda-forge-recipe
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: mamba-org/provision-with-micromamba@v15
with:
environment-file: false
environment-name: recipe-test
extra-specs: |
python=3.11
boa
conda-verify
channels: conda-forge
cache-downloads: true
cache-env: true

- name: Verify Recipe
run: conda-verify ci/meta.yaml

- name: Build conda package:
run: conda mambabuild ci/meta.yaml --no-anaconda-upload --verify --test
88 changes: 88 additions & 0 deletions ci/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{% set version = "2.0.1" %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unusure about the file name. Using the original/standard one makes sense. But at the same time, without more context inside ci/ the file name is not very descriptive. Totally up to you, just a thought, but since we specify the file name when calling conda mambabuild maybe naming this ci/conda-recipe.yml would be better?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I renamed it to ci/conda-recipe.yml

Copy link
Member Author

@mroeschke mroeschke May 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to change this back to meta.yaml to be recognized by conda mambabuild


package:
name: pandas
version: {{ version }}

source:
url: https://github.com/pandas-dev/pandas/releases/download/v{{ version }}/pandas-{{ version }}.tar.gz
sha256: 19b8e5270da32b41ebf12f0e7165efa7024492e9513fb46fb631c5022ae5709d
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we may want to build the package with the lastest pandas from git, not the latest version? Not sure if this will fail when new dependencies are added or similar things, and Dask seems to do that:

https://github.com/dask/dask/blob/main/continuous_integration/recipe/meta.yaml#L11

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. Good call I'll change this


build:
number: 0
script:
- export PYTHONUNBUFFERED=1 # [ppc64le]
- {{ PYTHON }} -m pip install -vv --no-deps --ignore-installed . # [not unix]
- {{ PYTHON }} -m pip install -vv --no-deps --ignore-installed . --global-option="build_ext" --global-option="-j4" --no-use-pep517 # [unix]
skip: true # [py<39]

requirements:
build:
- python # [build_platform != target_platform]
- cross-python_{{ target_platform }} # [build_platform != target_platform]
- cython # [build_platform != target_platform]
- numpy # [build_platform != target_platform]
- {{ compiler('c') }}
- {{ compiler('cxx') }}
host:
- python
- pip
- setuptools >=61.0.0
- cython >=0.29.33,<3
- numpy >=1.21.6 # [py<311]
- numpy >=1.23.2 # [py>=311]
- versioneer
- tomli # [py<311]
run:
- python
- {{ pin_compatible('numpy') }}
- python-dateutil >=2.8.2
- pytz >=2020.1
- python-tzdata >=2022.1

test:
imports:
- pandas
commands:
- pip check
# Skip test suite on PyPy as it segfaults there
# xref: https://github.com/conda-forge/pandas-feedstock/issues/148
#
# Also skip `test_rolling_var_numerical_issues` on `ppc64le` as it is a known test failure.
# xref: https://github.com/conda-forge/pandas-feedstock/issues/149
{% set markers = ["not clipboard", "not single_cpu", "not db", "not network", not slow] %}
{% set markers = markers + ["not arm_slow"] %} # [aarch64 or ppc64le]
{% set extra_args = ["-n=2 -m " + " and ".join(markers)] %}
{% set extra_args = extra_args + ["-k not test_rolling_var_numerical_issues"] %} # [ppc64le]
- python -c "import pandas; pandas.test(extra_args={{ extra_args }})" # [python_impl == "cpython"]
requires:
- pip
- pytest >=7.0.0
- pytest-asyncio >=0.17.0
- pytest-xdist >=2.2.0
- pytest-cov
- hypothesis >=6.46.1
- tomli # [py<311]

about:
home: http://pandas.pydata.org
license: BSD-3-Clause
license_file: LICENSE
summary: Powerful data structures for data analysis, time series, and statistics
doc_url: https://pandas.pydata.org/docs/
dev_url: https://github.com/pandas-dev/pandas

extra:
recipe-maintainers:
- jreback
- jorisvandenbossche
- msarahan
- ocefpaf
- TomAugspurger
- WillAyd
- simonjayhawkins
- mroeschke
- datapythonista
- phofl
- lithomas1
- marcogorelli