Skip to content

Commit

Permalink
Merge branch 'pandas-dev:main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
yehoshuadimarsky committed Feb 26, 2023
2 parents fcfe87c + 0dd3901 commit f278611
Show file tree
Hide file tree
Showing 1,402 changed files with 76,787 additions and 57,638 deletions.
77 changes: 75 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
test-arm:
machine:
image: ubuntu-2004:202101-01
resource_class: arm.medium
resource_class: arm.large
environment:
ENV_FILE: ci/deps/circle-38-arm64.yaml
PYTEST_WORKERS: auto
Expand All @@ -14,9 +14,82 @@ jobs:
steps:
- checkout
- run: .circleci/setup_env.sh
- run: PATH=$HOME/miniconda3/envs/pandas-dev/bin:$HOME/miniconda3/condabin:$PATH ci/run_tests.sh
- run: >
PATH=$HOME/miniconda3/envs/pandas-dev/bin:$HOME/miniconda3/condabin:$PATH
LD_PRELOAD=$HOME/miniconda3/envs/pandas-dev/lib/libgomp.so.1:$LD_PRELOAD
ci/run_tests.sh
build-aarch64:
parameters:
cibw-build:
type: string
machine:
image: ubuntu-2004:202101-01
resource_class: arm.large
environment:
ENV_FILE: ci/deps/circle-38-arm64.yaml
TRIGGER_SOURCE: << pipeline.trigger_source >>
steps:
- checkout
- run:
name: Check if build is necessary
command: |
# Check if tag is defined or TRIGGER_SOURCE is scheduled
if [[ -n "$CIRCLE_TAG" ]]; then
echo 'export IS_PUSH="true"' >> "$BASH_ENV"
elif [[ $TRIGGER_SOURCE == "scheduled_pipeline" ]]; then
echo 'export IS_SCHEDULE_DISPATCH="true"' >> "$BASH_ENV"
# Look for the build label/[wheel build] in commit
# grep takes a regex, so need to escape brackets
elif (git log --format=oneline -n 1 $CIRCLE_SHA1) | grep -q '\[wheel build\]'; then
: # Do nothing
elif ! (curl https://api.github.com/repos/pandas-dev/pandas/issues/$CIRCLE_PR_NUMBER | jq '.labels' | grep -q 'Build'); then
circleci-agent step halt
fi
- run:
name: Build aarch64 wheels
command: |
pip3 install cibuildwheel==2.9.0
cibuildwheel --output-dir wheelhouse
environment:
CIBW_BUILD: << parameters.cibw-build >>

- run:
name: Install Anaconda Client & Upload Wheels
command: |
echo "Install Mambaforge"
MAMBA_URL="https://github.com/conda-forge/miniforge/releases/download/4.14.0-0/Mambaforge-4.14.0-0-Linux-aarch64.sh"
echo "Downloading $MAMBA_URL"
wget -q $MAMBA_URL -O minimamba.sh
chmod +x minimamba.sh
MAMBA_DIR="$HOME/miniconda3"
rm -rf $MAMBA_DIR
./minimamba.sh -b -p $MAMBA_DIR
export PATH=$MAMBA_DIR/bin:$PATH
mamba install -y -c conda-forge anaconda-client
source ci/upload_wheels.sh
set_upload_vars
upload_wheels
- store_artifacts:
path: wheelhouse/

workflows:
test:
# Don't run trigger this one when scheduled pipeline runs
when:
not:
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
jobs:
- test-arm
build-wheels:
jobs:
- build-aarch64:
filters:
tags:
only: /^v.*/
matrix:
parameters:
cibw-build: ["cp38-manylinux_aarch64", "cp39-manylinux_aarch64", "cp310-manylinux_aarch64", "cp311-manylinux_aarch64"]
66 changes: 12 additions & 54 deletions .circleci/setup_env.sh
Original file line number Diff line number Diff line change
@@ -1,47 +1,16 @@
#!/bin/bash -e

# edit the locale file if needed
if [[ "$(uname)" == "Linux" && -n "$LC_ALL" ]]; then
echo "Adding locale to the first line of pandas/__init__.py"
rm -f pandas/__init__.pyc
SEDC="3iimport locale\nlocale.setlocale(locale.LC_ALL, '$LC_ALL')\n"
sed -i "$SEDC" pandas/__init__.py

echo "[head -4 pandas/__init__.py]"
head -4 pandas/__init__.py
echo
fi
echo "Install Mambaforge"
MAMBA_URL="https://github.com/conda-forge/miniforge/releases/download/4.14.0-0/Mambaforge-4.14.0-0-Linux-aarch64.sh"
echo "Downloading $MAMBA_URL"
wget -q $MAMBA_URL -O minimamba.sh
chmod +x minimamba.sh

MAMBA_DIR="$HOME/miniconda3"
rm -rf $MAMBA_DIR
./minimamba.sh -b -p $MAMBA_DIR

MINICONDA_DIR=/usr/local/miniconda
if [ -e $MINICONDA_DIR ] && [ "$BITS32" != yes ]; then
echo "Found Miniconda installation at $MINICONDA_DIR"
else
echo "Install Miniconda"
DEFAULT_CONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest"
if [[ "$(uname -m)" == 'aarch64' ]]; then
CONDA_URL="https://github.com/conda-forge/miniforge/releases/download/4.10.1-4/Miniforge3-4.10.1-4-Linux-aarch64.sh"
elif [[ "$(uname)" == 'Linux' ]]; then
if [[ "$BITS32" == "yes" ]]; then
CONDA_URL="$DEFAULT_CONDA_URL-Linux-x86.sh"
else
CONDA_URL="$DEFAULT_CONDA_URL-Linux-x86_64.sh"
fi
elif [[ "$(uname)" == 'Darwin' ]]; then
CONDA_URL="$DEFAULT_CONDA_URL-MacOSX-x86_64.sh"
else
echo "OS $(uname) not supported"
exit 1
fi
echo "Downloading $CONDA_URL"
wget -q $CONDA_URL -O miniconda.sh
chmod +x miniconda.sh

MINICONDA_DIR="$HOME/miniconda3"
rm -rf $MINICONDA_DIR
./miniconda.sh -b -p $MINICONDA_DIR
fi
export PATH=$MINICONDA_DIR/bin:$PATH
export PATH=$MAMBA_DIR/bin:$PATH

echo
echo "which conda"
Expand All @@ -51,7 +20,7 @@ echo
echo "update conda"
conda config --set ssl_verify false
conda config --set quiet true --set always_yes true --set changeps1 false
conda install -y -c conda-forge -n base 'mamba>=0.21.2' pip setuptools
mamba install -y -c conda-forge -n base pip setuptools

echo "conda info -a"
conda info -a
Expand All @@ -70,11 +39,6 @@ time mamba env update -n pandas-dev --file="${ENV_FILE}"
echo "conda list -n pandas-dev"
conda list -n pandas-dev

if [[ "$BITS32" == "yes" ]]; then
# activate 32-bit compiler
export CONDA_BUILD=1
fi

echo "activate pandas-dev"
source activate pandas-dev

Expand All @@ -90,15 +54,9 @@ if pip list | grep -q ^pandas; then
pip uninstall -y pandas || true
fi

if [ "$(conda list -f qt --json)" != [] ]; then
echo
echo "remove qt"
echo "causes problems with the clipboard, we use xsel for that"
conda remove qt -y --force || true
fi

echo "Build extensions"
python setup.py build_ext -q -j3
# GH 47305: Parallel build can causes flaky ImportError from pandas/_libs/tslibs
python setup.py build_ext -q -j1

echo "Install pandas"
python -m pip install --no-build-isolation --no-use-pep517 -e .
Expand Down
3 changes: 1 addition & 2 deletions .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.condaPath": "/opt/conda/bin/conda",
"python.pythonPath": "/opt/conda/bin/python",
"python.pythonPath": "/usr/local/bin/python",
"python.formatting.provider": "black",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
Expand Down
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ body:
[latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
required: true
- label: >
I have confirmed this bug exists on the main branch of pandas.
I have confirmed this bug exists on the
[main branch](https://pandas.pydata.org/docs/dev/getting_started/install.html#installing-the-development-version-of-pandas)
of pandas.
- type: textarea
id: example
attributes:
Expand Down
33 changes: 0 additions & 33 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

72 changes: 72 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Feature Request
description: Suggest an idea for pandas
title: "ENH: "
labels: [Enhancement, Needs Triage]

body:
- type: checkboxes
id: checks
attributes:
label: Feature Type
description: Please check what type of feature request you would like to propose.
options:
- label: >
Adding new functionality to pandas
- label: >
Changing existing functionality in pandas
- label: >
Removing existing functionality in pandas
- type: textarea
id: description
attributes:
label: Problem Description
description: >
Please describe what problem the feature would solve, e.g. "I wish I could use pandas to ..."
placeholder: >
I wish I could use pandas to return a Series from a DataFrame when possible.
validations:
required: true
- type: textarea
id: feature
attributes:
label: Feature Description
description: >
Please describe how the new feature would be implemented, using psudocode if relevant.
placeholder: >
Add a new parameter to DataFrame, to_series, to return a Series if possible.
def __init__(self, ..., to_series: bool=False):
"""
Parameters
----------
...
to_series : bool, default False
Return a Series if possible
"""
if to_series:
return Series(data)
validations:
required: true
- type: textarea
id: alternative
attributes:
label: Alternative Solutions
description: >
Please describe any alternative solution (existing functionality, 3rd party package, etc.)
that would satisfy the feature request.
placeholder: >
Write a custom function to return a Series when possible.
def to_series(...)
result = pd.DataFrame(...)
...
validations:
required: true
- type: textarea
id: context
attributes:
label: Additional Context
description: >
Please provide any relevant GitHub issues, code examples or references that help describe and support
the feature request.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/32-bit-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ on:
push:
branches:
- main
- 1.4.x
- 2.0.x
- 1.5.x
pull_request:
branches:
- main
- 1.4.x
- 2.0.x
- 1.5.x
paths-ignore:
- "doc/**"

Expand All @@ -17,7 +19,7 @@ permissions:

jobs:
pytest:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -38,9 +40,11 @@ jobs:
/opt/python/cp38-cp38/bin/python -m venv ~/virtualenvs/pandas-dev && \
. ~/virtualenvs/pandas-dev/bin/activate && \
python -m pip install --no-deps -U pip wheel 'setuptools<60.0.0' && \
pip install cython numpy python-dateutil pytz pytest pytest-xdist pytest-asyncio>=0.17 hypothesis && \
python setup.py build_ext -q -j2 && \
python -m pip install versioneer[toml] && \
python -m pip install cython numpy python-dateutil pytz pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 hypothesis>=6.34.2 && \
python setup.py build_ext -q -j1 && \
python -m pip install --no-build-isolation --no-use-pep517 -e . && \
python -m pip list && \
export PANDAS_CI=1 && \
pytest -m 'not slow and not network and not clipboard and not single_cpu' pandas --junitxml=test-data.xml"
Expand All @@ -50,3 +54,7 @@ jobs:
name: Test results
path: test-data.xml
if: failure()
concurrency:
# https://github.community/t/concurrecy-not-work-for-push/183068/7
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-32bit
cancel-in-progress: true
2 changes: 1 addition & 1 deletion .github/workflows/assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- if: github.event.comment.body == 'take'
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/asv-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
name: "Run benchmarks"
# TODO: Support more benchmarking options later, against different branches, against self, etc
if: startsWith(github.event.comment.body, '@github-actions benchmark')
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -el {0}
Expand Down

0 comments on commit f278611

Please sign in to comment.