Skip to content

Commit 8635712

Browse files
committed
after fixed merge
2 parents 2cde5fc + d066fcd commit 8635712

File tree

241 files changed

+3873
-1844
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+3873
-1844
lines changed

.circleci/setup_env.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ if pip list | grep -q ^pandas; then
5454
pip uninstall -y pandas || true
5555
fi
5656

57-
echo "Build extensions"
58-
python setup.py build_ext -q -j4
59-
6057
echo "Install pandas"
61-
python -m pip install --no-build-isolation --no-use-pep517 -e .
58+
python -m pip install --no-build-isolation -ve .
6259

6360
echo "done"

.github/actions/build_pandas/action.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Build pandas
22
description: Rebuilds the C extensions and installs pandas
3+
inputs:
4+
editable:
5+
description: Whether to build pandas in editable mode (default true)
6+
default: true
37
runs:
48
using: composite
59
steps:
@@ -12,9 +16,9 @@ runs:
1216

1317
- name: Build Pandas
1418
run: |
15-
python setup.py build_ext -j $N_JOBS
16-
python -m pip install -e . --no-build-isolation --no-use-pep517 --no-index
19+
if [[ ${{ inputs.editable }} == "true" ]]; then
20+
pip install -e . --no-build-isolation -v
21+
else
22+
pip install . --no-build-isolation -v
23+
fi
1724
shell: bash -el {0}
18-
env:
19-
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
20-
N_JOBS: ${{ runner.os == 'macOS' && 3 || 2 }}

.github/actions/setup-conda/action.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,14 @@ inputs:
33
environment-file:
44
description: Conda environment file to use.
55
default: environment.yml
6-
environment-name:
7-
description: Name to use for the Conda environment
8-
default: test
9-
extra-specs:
10-
description: Extra packages to install
11-
required: false
126
runs:
137
using: composite
148
steps:
159
- name: Install ${{ inputs.environment-file }}
16-
uses: mamba-org/provision-with-micromamba@v15
10+
uses: mamba-org/setup-micromamba@v1
1711
with:
1812
environment-file: ${{ inputs.environment-file }}
19-
environment-name: ${{ inputs.environment-name }}
20-
extra-specs: ${{ inputs.extra-specs }}
21-
channels: conda-forge
22-
channel-priority: 'strict'
13+
environment-name: test
2314
condarc-file: ci/condarc.yml
24-
cache-env: true
15+
cache-environment: true
2516
cache-downloads: true

.github/workflows/cache-cleanup.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Clean closed branch caches
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
7+
jobs:
8+
cleanup:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Clean Cache
12+
run: |
13+
gh extension install actions/gh-actions-cache
14+
15+
REPO=${{ github.repository }}
16+
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
17+
18+
echo "Fetching list of cache key"
19+
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
20+
21+
## Setting this to not fail the workflow while deleting cache keys.
22+
set +e
23+
echo "Deleting caches..."
24+
for cacheKey in $cacheKeysForPR
25+
do
26+
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
27+
done
28+
echo "Done"
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/code-checks.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,24 @@ jobs:
6363
- name: Build Pandas
6464
id: build
6565
uses: ./.github/actions/build_pandas
66+
with:
67+
editable: false
6668

6769
# The following checks are independent of each other and should still be run if one fails
70+
71+
# TODO: The doctests have to be run first right now, since the Cython doctests only work
72+
# with pandas installed in non-editable mode
73+
# This can be removed once pytest-cython doesn't require C extensions to be installed inplace
74+
- name: Run doctests
75+
run: cd ci && ./code_checks.sh doctests
76+
if: ${{ steps.build.outcome == 'success' && always() }}
77+
78+
- name: Install pandas in editable mode
79+
id: build-editable
80+
uses: ./.github/actions/build_pandas
81+
with:
82+
editable: true
83+
6884
- name: Check for no warnings when building single-page docs
6985
run: ci/code_checks.sh single-docs
7086
if: ${{ steps.build.outcome == 'success' && always() }}
@@ -73,10 +89,6 @@ jobs:
7389
run: ci/code_checks.sh code
7490
if: ${{ steps.build.outcome == 'success' && always() }}
7591

76-
- name: Run doctests
77-
run: ci/code_checks.sh doctests
78-
if: ${{ steps.build.outcome == 'success' && always() }}
79-
8092
- name: Run docstring validation
8193
run: ci/code_checks.sh docstrings
8294
if: ${{ steps.build.outcome == 'success' && always() }}

.github/workflows/package-checks.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,10 @@ jobs:
4444
with:
4545
python-version: '3.10'
4646

47-
- name: Install required dependencies
48-
run: |
49-
python -m pip install --upgrade pip setuptools wheel python-dateutil pytz numpy cython
50-
python -m pip install versioneer[toml]
51-
5247
- name: Pip install with extra
53-
run: python -m pip install -e .[${{ matrix.extra }}] --no-build-isolation
48+
run: |
49+
python -m pip install .[${{ matrix.extra }}] -v
50+
shell: bash -el {0}
5451
conda_forge_recipe:
5552
if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}}
5653
runs-on: ubuntu-22.04
@@ -70,17 +67,15 @@ jobs:
7067
fetch-depth: 0
7168

7269
- name: Set up Python
73-
uses: mamba-org/provision-with-micromamba@v15
70+
uses: mamba-org/setup-micromamba@v1
7471
with:
75-
environment-file: false
7672
environment-name: recipe-test
77-
extra-specs: |
73+
create-args: >-
7874
python=${{ matrix.python-version }}
7975
boa
8076
conda-verify
81-
channels: conda-forge
8277
cache-downloads: true
83-
cache-env: true
78+
cache-environment: true
8479

8580
- name: Build conda package
8681
run: conda mambabuild ci --no-anaconda-upload --verify --strict-verify --output --output-folder .

.github/workflows/unit-tests.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,10 @@ jobs:
229229
run: |
230230
/opt/python/cp39-cp39/bin/python -m venv ~/virtualenvs/pandas-dev
231231
. ~/virtualenvs/pandas-dev/bin/activate
232-
python -m pip install --no-cache-dir --no-deps -U pip wheel setuptools
232+
python -m pip install -U pip wheel setuptools meson[ninja]==1.0.1 meson-python==0.13.1
233233
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 hypothesis>=6.46.1
234-
python setup.py build_ext -q -j$(nproc)
235-
python -m pip install --no-cache-dir --no-build-isolation --no-use-pep517 -e .
236-
python -m pip list
234+
python -m pip install --no-cache-dir --no-build-isolation -e .
235+
python -m pip list --no-cache-dir
237236
export PANDAS_CI=1
238237
python -m pytest -m 'not slow and not network and not clipboard and not single_cpu' pandas --junitxml=test-data.xml
239238
concurrency:
@@ -268,10 +267,9 @@ jobs:
268267
run: |
269268
/opt/python/cp39-cp39/bin/python -m venv ~/virtualenvs/pandas-dev
270269
. ~/virtualenvs/pandas-dev/bin/activate
271-
python -m pip install --no-cache-dir --no-deps -U pip wheel setuptools
270+
python -m pip install -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.0.1
272271
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 hypothesis>=6.46.1
273-
python setup.py build_ext -q -j$(nproc)
274-
python -m pip install --no-cache-dir --no-build-isolation --no-use-pep517 -e .
272+
python -m pip install --no-cache-dir --no-build-isolation -e .
275273
python -m pip list --no-cache-dir
276274
277275
- name: Run Tests
@@ -347,8 +345,7 @@ jobs:
347345
348346
- name: Build Pandas
349347
run: |
350-
python setup.py build_ext -q -j4
351-
python -m pip install -e . --no-build-isolation --no-use-pep517 --no-index
348+
python -m pip install -e . --no-build-isolation --no-index
352349
353350
- name: Build Version
354351
run: |

.github/workflows/wheels.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ jobs:
5656
- [ubuntu-20.04, manylinux_x86_64]
5757
- [macos-11, macosx_*]
5858
- [windows-2019, win_amd64]
59-
- [windows-2019, win32]
6059
# TODO: support PyPy?
6160
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"]]# "pp39"]
6261
env:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
*.py[ocd]
3737
*.so
3838
.build_cache_dir
39+
.mesonpy-native-file.ini
3940
MANIFEST
4041

4142
# Python files #
@@ -76,6 +77,8 @@ coverage_html_report
7677
__pycache__
7778
# pytest-monkeytype
7879
monkeytype.sqlite3
80+
# meson editable install folder
81+
.mesonpy
7982

8083

8184
# OS generated files #

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ repos:
8383
hooks:
8484
- id: pylint
8585
stages: [manual]
86+
args: [--load-plugins=pylint.extensions.redefined_loop_name]
8687
- id: pylint
8788
alias: redefined-outer-name
8889
name: Redefining name from outer scope

asv_bench/asv.conf.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
// pip (with all the conda available packages installed first,
4242
// followed by the pip installed packages).
4343
"matrix": {
44-
"numpy": [],
4544
"Cython": ["0.29.33"],
4645
"matplotlib": [],
4746
"sqlalchemy": [],
@@ -56,6 +55,9 @@
5655
"xlrd": [],
5756
"odfpy": [],
5857
"jinja2": [],
58+
"meson": [],
59+
"meson-python": [],
60+
"python-build": [],
5961
},
6062
"conda_channels": ["conda-forge"],
6163
// Combinations of libraries/python versions can be excluded/included
@@ -125,7 +127,5 @@
125127
"regression_thresholds": {
126128
},
127129
"build_command":
128-
["python -m pip install versioneer[toml]",
129-
"python setup.py build -j4",
130-
"PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}"],
130+
["python -m build -Cbuilddir=builddir --wheel --outdir {build_cache_dir} {build_dir}"]
131131
}

asv_bench/benchmarks/indexing.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
lower-level methods directly on Index and subclasses, see index_object.py,
44
indexing_engine.py, and index_cached.py
55
"""
6+
from datetime import datetime
67
import warnings
78

89
import numpy as np
@@ -531,4 +532,25 @@ def time_chained_indexing(self, mode):
531532
df2["C"] = 1.0
532533

533534

535+
class Block:
536+
params = [
537+
(True, "True"),
538+
(np.array(True), "np.array(True)"),
539+
]
540+
541+
def setup(self, true_value, mode):
542+
self.df = DataFrame(
543+
False,
544+
columns=np.arange(500).astype(str),
545+
index=date_range("2010-01-01", "2011-01-01"),
546+
)
547+
548+
self.true_value = true_value
549+
550+
def time_test(self, true_value, mode):
551+
start = datetime(2010, 5, 1)
552+
end = datetime(2010, 9, 1)
553+
self.df.loc[start:end, :] = true_value
554+
555+
534556
from .pandas_vb_common import setup # noqa: F401 isort:skip

0 commit comments

Comments
 (0)