Skip to content

Commit 883ac0b

Browse files
committed
Unlink on generate_dist.py if they exist and copy again. Build wheel from sdist
1 parent 00be9c8 commit 883ac0b

4 files changed

Lines changed: 19 additions & 5 deletions

File tree

ci/scripts/python_wheel_macos_build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,11 @@ export ARROW_HOME=${build_dir}/install
228228
# Set PyArrow version explicitly
229229
export SETUPTOOLS_SCM_PRETEND_VERSION=${PYARROW_VERSION}
230230

231+
# Meson sdist requires setuptools_scm to be able to get the version from git
232+
git config --global --add safe.directory ${source_dir}
233+
231234
pushd ${source_dir}/python
232-
python -m build --wheel . \
235+
python -m build --sdist --wheel . \
233236
-Csetup-args="-Dbuildtype=${PYARROW_BUILD_TYPE}" \
234237
-Csetup-args="-Dacero=${PYARROW_WITH_ACERO}" \
235238
-Csetup-args="-Dazure=${PYARROW_WITH_AZURE}" \

ci/scripts/python_wheel_windows_build.bat

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,17 @@ if %ARROW_S3% == ON (
193193
set PYARROW_WITH_S3=auto
194194
)
195195

196+
@REM Meson sdist requires setuptools_scm to be able to get the version from git
197+
git config --global --add safe.directory C:\arrow
198+
196199
pushd C:\arrow\python
197200

198201
@REM TODO: Remove once docker rebuild works correctly
199202
@REM See: https://github.com/apache/arrow/issues/48947
200203
%PYTHON_CMD% -m pip install -U build || exit /B 1
201204

202205
@REM Build wheel
203-
%PYTHON_CMD% -m build --wheel . ^
206+
%PYTHON_CMD% -m build --sdist --wheel . ^
204207
-Csetup-args="-Dbuildtype=%CMAKE_BUILD_TYPE%" ^
205208
-Csetup-args="-Dacero=%PYARROW_WITH_ACERO%" ^
206209
-Csetup-args="-Ddataset=%PYARROW_WITH_DATASET%" ^

ci/scripts/python_wheel_xlinux_build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,11 @@ export ARROW_HOME=/tmp/arrow-dist
219219
# PyArrow build configuration
220220
export CMAKE_PREFIX_PATH=/tmp/arrow-dist
221221

222+
# Meson sdist requires setuptools_scm to be able to get the version from git
223+
git config --global --add safe.directory /arrow
224+
222225
pushd /arrow/python
223-
python -m build --wheel . \
226+
python -m build --sdist --wheel . \
224227
-Csetup-args="-Dbuildtype=${PYARROW_BUILD_TYPE}" \
225228
-Csetup-args="-Dacero=${PYARROW_WITH_ACERO}" \
226229
-Csetup-args="-Dazure=${PYARROW_WITH_AZURE}" \

python/scripts/generate_dist.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,14 @@ def main():
2626
dest_dir = pathlib.Path(os.environ["MESON_DIST_ROOT"]).resolve()
2727

2828
license_file = parent_dir / 'LICENSE.txt'
29-
shutil.copy(license_file, dest_dir)
29+
dest_license = dest_dir / 'LICENSE.txt'
30+
dest_license.unlink(missing_ok=True)
31+
shutil.copy(license_file, dest_license)
32+
3033
notice_file = parent_dir / 'NOTICE.txt'
31-
shutil.copy(notice_file, dest_dir)
34+
dest_notice = dest_dir / 'NOTICE.txt'
35+
dest_notice.unlink(missing_ok=True)
36+
shutil.copy(notice_file, dest_notice)
3237

3338

3439
if __name__ == "__main__":

0 commit comments

Comments
 (0)