Skip to content

Commit a2bf77a

Browse files
committed
WIP
1 parent 007bf4a commit a2bf77a

File tree

6 files changed

+84
-5
lines changed

6 files changed

+84
-5
lines changed

.github/actions/build_pandas/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@ runs:
55
steps:
66

77
- name: Environment Detail
8+
id: env-detail
89
run: |
910
conda info
1011
conda list
12+
echo ::set-output name=python-version::$(conda list -f python --json | jq -r '.[0].version')
1113
shell: bash -el {0}
1214

15+
- name: Set up Ccache
16+
uses: ./.github/actions/setup-ccache
17+
with:
18+
extra-cache-key: ${{ steps.env-detail.outputs.python-version }}
19+
1320
- name: Build Pandas
1421
run: |
1522
python setup.py build_ext -j $N_JOBS
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Setup sccache
2+
inputs:
3+
extra-cache-key:
4+
required: false
5+
default: ''
6+
runs:
7+
using: composite
8+
steps:
9+
- name: Get Date
10+
id: get-date
11+
run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')"
12+
shell: bash
13+
14+
- name: Fix Windows temporary directory
15+
# On Windows, for some reason the default temporary directory provided to sccache
16+
# may become read-only at some point. Work around by having a private tempdir.
17+
id: mktemp
18+
run: echo "::set-output name=tmpdir::$(cygpath -w $(mktemp -d))"
19+
shell: bash
20+
if: ${{ runner.os == 'Windows' }}
21+
22+
- name: Setup sccache
23+
uses: hendrikmuhs/ccache-action@v1.2
24+
with:
25+
variant: sccache
26+
key: ${{ runner.os }}--${{ runner.arch }}--${{ github.workflow }}--${{ steps.get-date.outputs.today }}--${{ inputs.extra-cache-key }}
27+
env:
28+
TMP: "${{ steps.mktemp.outputs.tmpdir }}"

.github/workflows/macos-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
strategy:
2929
matrix:
3030
os: [macos-latest, windows-latest]
31-
env_file: [actions-38.yaml, actions-39.yaml, actions-310.yaml]
31+
env_file: [actions-38.yaml] #, actions-39.yaml, actions-310.yaml]
3232
fail-fast: false
3333
runs-on: ${{ matrix.os }}
3434
name: ${{ format('{0} {1}', matrix.os, matrix.env_file) }}

.github/workflows/posix.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ jobs:
2424
timeout-minutes: 120
2525
strategy:
2626
matrix:
27-
env_file: [actions-38.yaml, actions-39.yaml, actions-310.yaml]
28-
pattern: ["not single_cpu", "single_cpu"]
27+
env_file: [actions-38.yaml] #, actions-39.yaml, actions-310.yaml]
28+
pattern: ["not single_cpu"] #, "single_cpu"]
2929
# Don't test pyarrow v2/3: Causes timeouts in read_csv engine
3030
# even if tests are skipped/xfailed
31-
pyarrow_version: ["5", "6", "7"]
31+
pyarrow_version: ["5"] #, "6", "7"]
3232
include:
3333
- name: "Downstream Compat"
3434
env_file: actions-38-downstream_compat.yaml

ci/run_tests.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/bash -e
2+
which pytest
3+
pytest --help
4+
exit 0
25

36
# Workaround for pytest-xdist (it collects different tests in the workers if PYTHONHASHSEED is not set)
47
# https://github.com/pytest-dev/pytest/issues/920

setup.py

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,48 @@ def is_platform_mac():
7474
_pxi_dep[module] = pxi_files
7575

7676

77-
class build_ext(_build_ext):
77+
class CompilerLauncherMixin:
78+
"""Add "compiler launchers" to distutils.
79+
80+
We use this to be able to run the Pandas build using "ccache".
81+
82+
A compiler launcher is a program that is invoked instead of invoking the
83+
compiler directly. It is passed the full compiler invocation command line.
84+
85+
A similar feature exists in CMake, see
86+
https://cmake.org/cmake/help/latest/prop_tgt/LANG_COMPILER_LAUNCHER.html.
87+
"""
88+
89+
__is_set_up = False
90+
91+
def build_extensions(self):
92+
# Integrate into "build_ext"
93+
self.__setup()
94+
super().build_extensions()
95+
96+
def build_libraries(self):
97+
# Integrate into "build_clib"
98+
self.__setup()
99+
super().build_extensions()
100+
101+
def __setup(self):
102+
if self.__is_set_up:
103+
return
104+
self.__is_set_up = True
105+
compiler_launcher = os.getenv("DISTUTILS_C_COMPILER_LAUNCHER")
106+
if compiler_launcher:
107+
108+
def spawn_with_compiler_launcher(cmd):
109+
exclude_programs = ("link.exe",)
110+
if not cmd[0].endswith(exclude_programs):
111+
cmd = [compiler_launcher] + cmd
112+
return original_spawn(cmd)
113+
114+
original_spawn = self.compiler.spawn
115+
self.compiler.spawn = spawn_with_compiler_launcher
116+
117+
118+
class build_ext(CompilerLauncherMixin, _build_ext):
78119
@classmethod
79120
def render_templates(cls, pxifiles):
80121
for pxifile in pxifiles:

0 commit comments

Comments
 (0)