Skip to content

Commit

Permalink
try to fix py
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsg committed Jul 9, 2024
1 parent 520437f commit 0d9d7e5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
17 changes: 10 additions & 7 deletions scripts/windows/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ set CRC32C_INSTALL_PREFIX=%cd%\build\%CONFIGURATION%
FOR %%P IN (3.8.10, 3.9.13, 3.10.11, 3.11.9, 3.12.4) DO (

echo "Installing Python version %%P"
choco install python --version=%%P -y --force --no-progress
choco install python --version=%%P -y --no-progress

echo "Listing available Python versions'
py -0

echo "Installing cmake for Python %%P"
py -%%P -m pip install cmake
py -V:%%P -m pip install cmake

@rem Add directory as safe to avoid "detected dubious ownership" fatal issue
git config --global --add safe.directory C:/tmpfs/src/github/python-crc32c
git config --global --add safe.directory .
git submodule update --init --recursive

git config --global --add safe.directory C:/tmpfs/src/github/python-crc32c/google_crc32c
git config --global --add safe.directory google_crc32c
pushd google_crc32c
@rem reset hard to cleanup any changes done by a previous build.
git reset --hard
Expand All @@ -60,11 +63,11 @@ FOR %%P IN (3.8.10, 3.9.13, 3.10.11, 3.11.9, 3.12.4) DO (
echo "Copying Binary to root: %CRC32C_INSTALL_PREFIX%\bin\crc32c.dll"
copy %CRC32C_INSTALL_PREFIX%\bin\crc32c.dll .

py -%%P -m pip install --upgrade pip setuptools wheel
py -V:%%P -m pip install --upgrade pip setuptools wheel
echo "Building C extension"
py -%%P setup.py build_ext -v --include-dirs=%CRC32C_INSTALL_PREFIX%\include --library-dirs=%CRC32C_INSTALL_PREFIX%\lib
py -V:%%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/
py -V:%%P -m pip wheel . --wheel-dir wheels/

echo "Built wheel, now running tests."
call %~dp0/test.bat
Expand Down
8 changes: 4 additions & 4 deletions scripts/windows/test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ if "%PYTHON_VERSION%"=="" (
set PYTHON_VERSION=3.10
)

py -%PYTHON_VERSION% -m pip install --no-index --find-links=wheels google-crc32c --force-reinstall
py -V:%PYTHON_VERSION% -m pip install --no-index --find-links=wheels google-crc32c --force-reinstall

py -%PYTHON_VERSION% ./scripts/check_crc32c_extension.py
py -V:%PYTHON_VERSION% ./scripts/check_crc32c_extension.py

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

0 comments on commit 0d9d7e5

Please sign in to comment.