Skip to content

Commit eee6995

Browse files
committed
WIP
1 parent 9a29ba1 commit eee6995

File tree

13 files changed

+190
-180
lines changed

13 files changed

+190
-180
lines changed

.circleci/config.yml

-21
This file was deleted.
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build pandas
2+
description: Rebuilds the C extensions and installs pandas
3+
inputs:
4+
use-login-shell:
5+
description: "Use 'bash -l' as shell (required for Conda envs)"
6+
default: true
7+
runs:
8+
using: composite
9+
steps:
10+
# Create a shell wrapper to be able to call "bash" or "bash -l" depending
11+
# on the "use-login-shell" arguments.
12+
# We need this because GHA does not allow ${{ inputs. }} in "shell: " arguments.
13+
- name: Set shell
14+
shell: bash
15+
run: |
16+
if [ ${{ inputs.use-login-shell }} = true ]; then
17+
args="-l"
18+
fi
19+
echo "exec bash $args \"\$@\"" > /tmp/_build_pandas_shell
20+
21+
- name: Environment Detail
22+
shell: bash /tmp/_build_pandas_shell {0}
23+
run: |
24+
if which conda; then
25+
conda info
26+
conda list
27+
fi
28+
if which pip; then
29+
pip list
30+
fi
31+
python --version
32+
33+
- name: Get Python version
34+
id: get-python-version
35+
shell: bash /tmp/_build_pandas_shell {0}
36+
run: python3 -c "import platform as p; print(f'::set-output name=version::{p.python_version()}-{p.python_branch()}')"
37+
38+
- name: Set up ccache
39+
uses: ./.github/actions/setup_ccache
40+
with:
41+
extra-cache-key: ${{ steps.get-python-version.outputs.version }}
42+
if: ${{ runner.os != 'Windows' }}
43+
44+
- name: Build Pandas
45+
shell: bash /tmp/_build_pandas_shell {0}
46+
run: |
47+
# For some reason, linking fails with ccache
48+
set +e
49+
env
50+
exit 1
51+
CC="ccache $CC" python setup.py build_ext -j 2
52+
set -e
53+
python setup.py build_ext -j 2
54+
python -m pip install -e . --no-build-isolation --no-use-pep517 --no-index
55+
56+
- name: Build Version
57+
shell: bash /tmp/_build_pandas_shell {0}
58+
run: pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd

.github/actions/build_pandas/action.yml

-17
This file was deleted.
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Setup ccache
2+
description: Installs ccache and prepends it to $PATH
3+
inputs:
4+
extra-cache-key:
5+
required: false
6+
default: ''
7+
runs:
8+
using: composite
9+
steps:
10+
- name: Get Date
11+
id: get-date
12+
run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')"
13+
shell: bash
14+
15+
- name: Setup ccache
16+
uses: hendrikmuhs/ccache-action@940a79df1711f4d50b87e19ddf3b0a3c182abe68
17+
with:
18+
key: ${{ runner.os }}--${{ runner.arch }}--${{ github.workflow }}--${{ steps.get-date.outputs.today }}--${{ inputs.extra-cache-key }}

.github/actions/setup/action.yml

+43-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,49 @@
11
name: Set up pandas
22
description: Runs all the setup steps required to have a built pandas ready to use
3+
inputs:
4+
environment-file:
5+
default: environment.yml
6+
is-pypy:
7+
default: false
8+
activate-environment:
9+
default: pandas-dev
10+
python-version:
11+
required: false
312
runs:
413
using: composite
514
steps:
6-
- name: Setting conda path
7-
run: echo "${HOME}/miniconda3/bin" >> $GITHUB_PATH
8-
shell: bash -l {0}
15+
- name: Get Date
16+
id: get-date
17+
run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')"
18+
shell: bash
919

10-
- name: Setup environment and build pandas
11-
run: ci/setup_env.sh
12-
shell: bash -l {0}
20+
- name: Cache Conda packages
21+
uses: actions/cache@v2
22+
with:
23+
path: ~/conda_pkgs_dir
24+
key: conda-${{ runner.os }}-${{ runner.arch }}-${{ inputs.environment-file }}-${{ steps.get-date.outputs.today }}
25+
26+
- uses: conda-incubator/setup-miniconda@v2
27+
with:
28+
mamba-version: "*"
29+
use-mamba: true
30+
channels: conda-forge
31+
activate-environment: ${{ inputs.activate-environment }}
32+
channel-priority: flexible
33+
environment-file: ${{ inputs.environment-file }}
34+
python-version: ${{ inputs.python-version }}
35+
use-only-tar-bz2: true
36+
if: ${{ inputs.is_pypy == 'false' }} # No pypy3.8 support
37+
38+
- name: Setup PyPy
39+
uses: actions/setup-python@v2
40+
with:
41+
python-version: "pypy-3.8"
42+
if: ${{ inputs.is_pypy == 'true' }}
43+
44+
- name: Setup PyPy dependencies
45+
# TODO: re-enable cov, its slowing the tests down though
46+
# TODO: Unpin Cython, the new Cython 0.29.26 is causing compilation errors
47+
run: pip install Cython==0.29.25 numpy python-dateutil pytz pytest>=6.0 pytest-xdist>=1.31.0 hypothesis>=5.5.3
48+
shell: bash
49+
if: ${{ inputs.is_pypy == 'true' }}

.github/workflows/asv-bot.yml

+7-13
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ on:
44
issue_comment: # Pull requests are issues
55
types:
66
- created
7+
push:
8+
branches:
9+
- main
10+
- 1.4.x
711

812
env:
913
ENV_FILE: environment.yml
10-
COMMENT: ${{github.event.comment.body}}
14+
COMMENT: ${{ github.event.comment.body }}
1115

1216
jobs:
1317
autotune:
@@ -33,20 +37,10 @@ jobs:
3337
with:
3438
fetch-depth: 0
3539

36-
- name: Cache conda
37-
uses: actions/cache@v2
40+
- name: Set up pandas
41+
uses: ./.github/actions/setup
3842
with:
39-
path: ~/conda_pkgs_dir
40-
key: ${{ runner.os }}-conda-${{ hashFiles('${{ env.ENV_FILE }}') }}
41-
42-
# Although asv sets up its own env, deps are still needed
43-
# during discovery process
44-
- uses: conda-incubator/setup-miniconda@v2
45-
with:
46-
activate-environment: pandas-dev
47-
channel-priority: strict
4843
environment-file: ${{ env.ENV_FILE }}
49-
use-only-tar-bz2: true
5044

5145
- name: Run benchmarks
5246
id: bench

.github/workflows/code-checks.yml

+7-39
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,11 @@ jobs:
5252
with:
5353
fetch-depth: 0
5454

55-
- name: Cache conda
56-
uses: actions/cache@v2
57-
with:
58-
path: ~/conda_pkgs_dir
59-
key: ${{ runner.os }}-conda-${{ hashFiles('${{ env.ENV_FILE }}') }}
55+
- name: Set up pandas
56+
uses: ./.github/actions/setup
6057

61-
- uses: conda-incubator/setup-miniconda@v2
62-
with:
63-
mamba-version: "*"
64-
channels: conda-forge
65-
activate-environment: pandas-dev
66-
channel-priority: strict
67-
environment-file: ${{ env.ENV_FILE }}
68-
use-only-tar-bz2: true
58+
- name: Build Pandas
59+
uses: ./.github/actions/build-pandas
6960

7061
- name: Install node.js (for pyright)
7162
uses: actions/setup-node@v2
@@ -76,29 +67,20 @@ jobs:
7667
# note: keep version in sync with .pre-commit-config.yaml
7768
run: npm install -g [email protected]
7869

79-
- name: Build Pandas
80-
id: build
81-
uses: ./.github/actions/build_pandas
82-
8370
- name: Run checks on imported code
8471
run: ci/code_checks.sh code
85-
if: ${{ steps.build.outcome == 'success' }}
8672

8773
- name: Run doctests
8874
run: ci/code_checks.sh doctests
89-
if: ${{ steps.build.outcome == 'success' }}
9075

9176
- name: Run docstring validation
9277
run: ci/code_checks.sh docstrings
93-
if: ${{ steps.build.outcome == 'success' }}
9478

9579
- name: Run typing validation
9680
run: ci/code_checks.sh typing
97-
if: ${{ steps.build.outcome == 'success' }}
9881

9982
- name: Run docstring validation script tests
10083
run: pytest scripts
101-
if: ${{ steps.build.outcome == 'success' }}
10284

10385
asv-benchmarks:
10486
name: ASV Benchmarks
@@ -118,24 +100,11 @@ jobs:
118100
with:
119101
fetch-depth: 0
120102

121-
- name: Cache conda
122-
uses: actions/cache@v2
123-
with:
124-
path: ~/conda_pkgs_dir
125-
key: ${{ runner.os }}-conda-${{ hashFiles('${{ env.ENV_FILE }}') }}
126-
127-
- uses: conda-incubator/setup-miniconda@v2
128-
with:
129-
mamba-version: "*"
130-
channels: conda-forge
131-
activate-environment: pandas-dev
132-
channel-priority: strict
133-
environment-file: ${{ env.ENV_FILE }}
134-
use-only-tar-bz2: true
103+
- name: Set up pandas
104+
uses: ./.github/actions/setup
135105

136106
- name: Build Pandas
137-
id: build
138-
uses: ./.github/actions/build_pandas
107+
uses: ./.github/actions/build-pandas
139108

140109
- name: Run ASV benchmarks
141110
run: |
@@ -148,7 +117,6 @@ jobs:
148117
if grep "failed" benchmarks.log > /dev/null ; then
149118
exit 1
150119
fi
151-
if: ${{ steps.build.outcome == 'success' }}
152120
153121
- name: Publish benchmarks artifact
154122
uses: actions/upload-artifact@v2

.github/workflows/datamanger.yml renamed to .github/workflows/datamanager.yml

+12-7
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,20 @@ on:
1313
- "doc/**"
1414

1515
env:
16-
ENV_FILE: environment.yml
1716
PANDAS_CI: 1
17+
PYTEST_WORKERS: "auto"
18+
PYTEST_TARGET: pandas
19+
PATTERN: "not network and not clipboard"
20+
PANDAS_DATA_MANAGER: array
1821

1922
jobs:
2023
data_manager:
2124
name: Test experimental data manager
2225
runs-on: ubuntu-latest
26+
defaults:
27+
run:
28+
shell: bash -l {0}
29+
2330
services:
2431
moto:
2532
image: motoserver/moto
@@ -28,6 +35,7 @@ jobs:
2835
AWS_SECRET_ACCESS_KEY: foobar_secret
2936
ports:
3037
- 5000:5000
38+
3139
concurrency:
3240
# https://github.community/t/concurrecy-not-work-for-push/183068/7
3341
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-data_manager
@@ -42,12 +50,9 @@ jobs:
4250
- name: Set up pandas
4351
uses: ./.github/actions/setup
4452

53+
- name: Build pandas
54+
uses: ./.github/actions/build-pandas
55+
4556
- name: Run tests
46-
env:
47-
PANDAS_DATA_MANAGER: array
48-
PATTERN: "not network and not clipboard"
49-
PYTEST_WORKERS: "auto"
50-
PYTEST_TARGET: pandas
5157
run: |
52-
source activate pandas-dev
5358
ci/run_tests.sh

.github/workflows/docbuild-and-upload.yml

+9-7
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ on:
1111
- 1.4.x
1212

1313
env:
14-
ENV_FILE: environment.yml
1514
PANDAS_CI: 1
1615

1716
jobs:
1817
web_and_docs:
1918
name: Doc Build and Upload
2019
runs-on: ubuntu-latest
20+
defaults:
21+
run:
22+
shell: bash -l {0}
2123

2224
concurrency:
2325
# https://github.community/t/concurrecy-not-work-for-push/183068/7
@@ -33,14 +35,14 @@ jobs:
3335
- name: Set up pandas
3436
uses: ./.github/actions/setup
3537

38+
- name: Build pandas
39+
uses: ./.github/actions/build-pandas
40+
3641
- name: Build website
37-
run: |
38-
source activate pandas-dev
39-
python web/pandas_web.py web/pandas --target-path=web/build
42+
run: python web/pandas_web.py web/pandas --target-path=web/build
43+
4044
- name: Build documentation
41-
run: |
42-
source activate pandas-dev
43-
doc/make.py --warnings-are-errors
45+
run: doc/make.py --warnings-are-errors
4446

4547
- name: Install ssh key
4648
run: |

0 commit comments

Comments
 (0)