Skip to content

Commit

Permalink
Yet another attempt to fix the windows scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsg committed Jul 9, 2024
1 parent 0fb517a commit 520437f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
6 changes: 1 addition & 5 deletions .kokoro/presubmit.bat
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,9 @@ cd ..
call git config --global --add safe.directory C:/tmpfs/src/github/python-crc32c
call git submodule update --recursive || goto :error

@echo "Build Wheels"
@echo "Build Wheels and Run Tests"
call scripts\windows\build.bat || goto :error

@echo "Run Tests"
call scripts\windows\test.bat || goto :error


for /r %%a in (*.whl) do xcopy "%%a" %KOKORO_ARTIFACTS_DIR% /i

goto :EOF
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ C toolchain.

# Currently Published Wheels

Wheels are currently published for Python 3.8, 3.9, 3.10, 3.11 and 3.12
Wheels are currently published for CPython 3.8, 3.9, 3.10, 3.11 and 3.12
for multiple architectures. PyPy 3.9 and 3.10 are also supported for Linux.
For information on building your own wheels please view [BUILDING.md](BUILDING.md).

Expand All @@ -33,4 +33,4 @@ Wheels are published for `x86_64` and `arm64` architectures.

## Windows

Wheels are published for `win32` and `win_amd64` architectures.
Wheels are published for the `win_amd64` architecture.
8 changes: 7 additions & 1 deletion scripts/windows/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set CRC32C_INSTALL_PREFIX=%cd%\build\%CONFIGURATION%
@rem Iterate through supported Python versions.
@rem Unfortunately pyenv for Windows has an out-of-date versions list. Choco's
@rem installer seems to have some problems with installing multiple versions at
@rem once, but it can be coaxed to try anyways with --force.
@rem once, so as a workaround, we will install and then uninstall every version.
FOR %%P IN (3.8.10, 3.9.13, 3.10.11, 3.11.9, 3.12.4) DO (

echo "Installing Python version %%P"
Expand Down Expand Up @@ -65,6 +65,12 @@ FOR %%P IN (3.8.10, 3.9.13, 3.10.11, 3.11.9, 3.12.4) DO (
py -%%P setup.py build_ext -v --include-dirs=%CRC32C_INSTALL_PREFIX%\include --library-dirs=%CRC32C_INSTALL_PREFIX%\lib
echo "Building Wheel"
py -%%P -m pip wheel . --wheel-dir wheels/

echo "Built wheel, now running tests."
call %~dp0/test.bat

echo "Finished with Python version %%P, now uninstalling"
choco uninstall python -y
)

echo "Windows build has completed successfully"
Expand Down
16 changes: 10 additions & 6 deletions scripts/windows/test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
@rem This test file runs for one Python version at a time, and is intended to
@rem be called from within the build loop.

FOR %%P IN (3.8.10, 3.9.13, 3.10.11, 3.11.9, 3.12.4) DO (
py -%%P -m pip install --no-index --find-links=wheels google-crc32c --force-reinstall
set PYTHON_VERSION=%1
if "%PYTHON_VERSION%"=="" (
echo "Python version was not provided, using Python 3.10"
set PYTHON_VERSION=3.10
)

py -%%P ./scripts/check_crc32c_extension.py
py -%PYTHON_VERSION% -m pip install --no-index --find-links=wheels google-crc32c --force-reinstall

py -%%P -m pip install pytest
py -%%P -m pytest tests
)
py -%PYTHON_VERSION% ./scripts/check_crc32c_extension.py

py -%PYTHON_VERSION% -m pip install pytest
py -%PYTHON_VERSION% -m pytest tests

0 comments on commit 520437f

Please sign in to comment.