Skip to content

Commit

Permalink
Try to remove workaround for setuptools bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Jan 6, 2025
1 parent bd07ce7 commit b3ce08c
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 26 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ VCPKG="943c5ef1c8f6b5e6ced092b242c8299caae2ff01" # 2024.04.26 Release
# This is a workaround for our CI problem that "archery docker build" doesn't
# use pulled built images in dev/tasks/python-wheels/github.windows.yml.
PYTHON_WHEEL_WINDOWS_IMAGE_REVISION=2025-01-06
PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION=2025-01-06a

# Use conanio/${CONAN_BASE}:{CONAN_VERSION} for "docker compose run --rm conan".
# See https://github.com/conan-io/conan-docker-tools#readme and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

# NOTE: You must update PYTHON_WHEEL_WINDOWS_IMAGE_REVISION in .env
# NOTE: You must update PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION in .env
# when you update this file.

# based on mcr.microsoft.com/windows/servercore:ltsc2019
Expand All @@ -41,10 +41,8 @@ RUN %PYTHON_CMD% -m pip install \
--pre \
--prefer-binary \
-r C:/arrow/python/requirements-wheel-test.txt
# 1. cffi-based tests would crash when importing cffi.
# 2. cython-based tests would crash when importing the compiled extension module
# (presumably because of https://github.com/pypa/setuptools/issues/4662)
RUN %PYTHON_CMD% -m pip uninstall -y cffi cython
# cffi-based tests would crash when importing cffi.
RUN %PYTHON_CMD% -m pip uninstall -y cffi

ENV PYTHON="3.13t"
ENV PYTHON_GIL=0
2 changes: 1 addition & 1 deletion ci/docker/python-wheel-windows-test-vs2019-base.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

# NOTE: You must update PYTHON_WHEEL_WINDOWS_IMAGE_REVISION in .env
# NOTE: You must update PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION in .env
# when you update this file.

# based on mcr.microsoft.com/windows/servercore:ltsc2019
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/python-wheel-windows-test-vs2019.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

# NOTE: You must update PYTHON_WHEEL_WINDOWS_IMAGE_REVISION in .env
# NOTE: You must update PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION in .env
# when you update this file.

# based on mcr.microsoft.com/windows/servercore:ltsc2019
Expand Down
7 changes: 1 addition & 6 deletions ci/scripts/python_wheel_windows_test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@echo on

set PYARROW_TEST_ACERO=ON
set PYARROW_TEST_CYTHON=ON
set PYARROW_TEST_DATASET=ON
set PYARROW_TEST_FLIGHT=ON
set PYARROW_TEST_GANDIVA=OFF
Expand All @@ -31,12 +32,6 @@ set PYARROW_TEST_SUBSTRAIT=ON
set PYARROW_TEST_S3=ON
set PYARROW_TEST_TENSORFLOW=ON

if "%PYTHON%"=="3.13t" (
set PYARROW_TEST_CYTHON=OFF
) else (
set PYARROW_TEST_CYTHON=ON
)

set ARROW_TEST_DATA=C:\arrow\testing\data
set PARQUET_TEST_DATA=C:\arrow\cpp\submodules\parquet-testing\data

Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1318,28 +1318,28 @@ services:
command: arrow\\ci\\scripts\\python_wheel_windows_build.bat

python-wheel-windows-test-base:
image: ${REPO}:python-wheel-windows-test-vs2019-base-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
image: ${REPO}:python-wheel-windows-test-vs2019-base-${PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION}
build:
context: .
dockerfile: ci/docker/python-wheel-windows-test-vs2019-base.dockerfile
volumes: *python-wheel-windows-vs2019-volumes

python-wheel-windows-test:
image: ${REPO}:python-${PYTHON}-wheel-windows-test-vs2019-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
image: ${REPO}:python-${PYTHON}-wheel-windows-test-vs2019-${PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION}
build:
args:
base: ${REPO}:python-wheel-windows-test-vs2019-base-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
base: ${REPO}:python-wheel-windows-test-vs2019-base-${PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION}
python: ${PYTHON}
context: .
dockerfile: ci/docker/python-wheel-windows-test-vs2019.dockerfile
volumes: *python-wheel-windows-vs2019-volumes
command: arrow\\ci\\scripts\\python_wheel_windows_test.bat

python-free-threaded-wheel-windows-test:
image: ${REPO}:python-3.13-free-threaded-wheel-windows-test-vs2019-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
image: ${REPO}:python-3.13-free-threaded-wheel-windows-test-vs2019-${PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION}
build:
args:
base: ${REPO}:python-wheel-windows-test-vs2019-base-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION}
base: ${REPO}:python-wheel-windows-test-vs2019-base-${PYTHON_WHEEL_WINDOWS_TEST_IMAGE_REVISION}
context: .
dockerfile: ci/docker/python-free-threaded-wheel-windows-test-vs2019.dockerfile
volumes: *python-wheel-windows-vs2019-volumes
Expand Down
9 changes: 1 addition & 8 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def _run_cmake(self):
f'-DCMAKE_INSTALL_PREFIX={install_prefix}',
f'-DPYTHON_EXECUTABLE={sys.executable}',
f'-DPython3_EXECUTABLE={sys.executable}',
f'-DPYARROW_CXXFLAGS={self._get_cxxflags()}',
f'-DPYARROW_CXXFLAGS={self.cmake_cxxflags}',
]

def append_cmake_bool(value, varname):
Expand Down Expand Up @@ -367,13 +367,6 @@ def _get_cmake_ext_path(self, name):
filename = name + ext_suffix
return pjoin(self._get_build_dir(), filename)

def _get_cxxflags(self):
# Workaround for https://github.com/pypa/setuptools/issues/4662
cxxflags = self.cmake_cxxflags
if os.name == 'nt' and bool(sysconfig.get_config_var('Py_GIL_DISABLED')):
cxxflags += " -DPy_GIL_DISABLED=1"
return cxxflags

def get_ext_generated_cpp_source(self, name):
if sys.platform == 'win32':
head, tail = os.path.split(name)
Expand Down

0 comments on commit b3ce08c

Please sign in to comment.