diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index b5db15e..9924a91 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -13,6 +13,52 @@ jobs: fail-fast: false matrix: include: + # Windows 64 bits + - os: windows-latest + python: 310 + platform_id: win_amd64 + - os: windows-latest + python: 311 + platform_id: win_amd64 + - os: windows-latest + python: 312 + platform_id: win_amd64 + - os: windows-latest + python: 313 + platform_id: win_amd64 + - os: windows-latest + python: 313t + platform_id: win_amd64 + - os: windows-latest + python: 314 + platform_id: win_amd64 + - os: windows-latest + python: 314t + platform_id: win_amd64 + + # Windows ARM + - os: windows-11-arm + python: 310 + platform_id: win_arm64 + - os: windows-11-arm + python: 311 + platform_id: win_arm64 + - os: windows-11-arm + python: 312 + platform_id: win_arm64 + - os: windows-11-arm + python: 313 + platform_id: win_arm64 + - os: windows-11-arm + python: 313t + platform_id: win_arm64 + - os: windows-11-arm + python: 314 + platform_id: win_arm64 + - os: windows-11-arm + python: 314t + platform_id: win_arm64 + # Linux 64 bit manylinux_2_28 - os: ubuntu-latest python: 310 @@ -143,6 +189,16 @@ jobs: with: python-version: '3.13' + # We need to copy the tests in a new dir, because we are above CPT, not in the folder CPT. + # Maybe fix `from .cpt import cpt`, so we can test wherever the built wheel is? + - name: Prepare test command for Windows + if: matrix.os == 'windows-latest' + run: echo 'CIBW_TEST_COMMAND=cmd /c "mkdir tmp_for_test && xcopy /E /I {project}\\tests tmp_for_test\\tests && pytest tmp_for_test/tests"' >> $GITHUB_ENV + + - name: Prepare test command for Unix-like + if: matrix.os != 'windows-latest' + run: echo 'CIBW_TEST_COMMAND=bash -c "mkdir -p tmp_for_test && cp -r {project}/tests tmp_for_test && pytest tmp_for_test/tests"' >> $GITHUB_ENV + - name: Build and test wheels env: CIBW_BEFORE_BUILD: "python -m pip install --upgrade pip" @@ -150,9 +206,8 @@ jobs: CIBW_ARCHS: all CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }} - CIBW_BEFORE_TEST: "CC=gcc CXX=g++" + CIBW_BEFORE_TEST: ${{ matrix.os != 'windows-latest' && 'CC=gcc CXX=g++' || '' }} CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: "mkdir tmp_for_test; cp -r {project}/tests tmp_for_test; pytest tmp_for_test/tests" CIBW_BUILD_VERBOSITY: 1 CIBW_ENVIRONMENT_MACOS: ${{ format('MACOSX_DEPLOYMENT_TARGET={0}', matrix.deployment_target) }} CIBW_ENABLE: cpython-freethreading diff --git a/CI/github/osx/run_cibw_test.sh b/CI/github/osx/run_cibw_test.sh new file mode 100644 index 0000000..a2be939 --- /dev/null +++ b/CI/github/osx/run_cibw_test.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -e +mkdir -p tmp_for_test +cp -r {project}/tests tmp_for_test +pytest tmp_for_test/tests diff --git a/CI/github/windows/run_cibw_test.cmd b/CI/github/windows/run_cibw_test.cmd new file mode 100644 index 0000000..7600b33 --- /dev/null +++ b/CI/github/windows/run_cibw_test.cmd @@ -0,0 +1,5 @@ +@echo off +REM copy recursively; /E copies all subdirs, /I assumes destination is directory +mkdir tmp_for_test +xcopy /E /I {project}\tests tmp_for_test\tests +pytest tmp_for_test/tests diff --git a/CI/run_with_env.cmd b/CI/run_with_env.cmd deleted file mode 100644 index b63b2b6..0000000 --- a/CI/run_with_env.cmd +++ /dev/null @@ -1,88 +0,0 @@ -:: To build extensions for 64 bit Python 3, we need to configure environment -:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of: -:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1) -:: -:: To build extensions for 64 bit Python 2, we need to configure environment -:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of: -:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0) -:: -:: 32 bit builds, and 64-bit builds for 3.5 and beyond, do not require specific -:: environment configurations. -:: -:: Note: this script needs to be run with the /E:ON and /V:ON flags for the -:: cmd interpreter, at least for (SDK v7.0) -:: -:: More details at: -:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows -:: http://stackoverflow.com/a/13751649/163740 -:: -:: Author: Olivier Grisel -:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ -:: -:: Notes about batch files for Python people: -:: -:: Quotes in values are literally part of the values: -:: SET FOO="bar" -:: FOO is now five characters long: " b a r " -:: If you don't want quotes, don't include them on the right-hand side. -:: -:: The CALL lines at the end of this file look redundant, but if you move them -:: outside of the IF clauses, they do not run properly in the SET_SDK_64==Y -:: case, I don't know why. -@ECHO OFF - -SET COMMAND_TO_RUN=%* -SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows -SET WIN_WDK=c:\Program Files (x86)\Windows Kits\10\Include\wdf - -:: Extract the major and minor versions, and allow for the minor version to be -:: more than 9. This requires the version number to have two dots in it. -SET MAJOR_PYTHON_VERSION=%PYTHON_VERSION:~0,1% -IF "%PYTHON_VERSION:~3,1%" == "." ( - SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,1% -) ELSE ( - SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,2% -) - -:: Based on the Python version, determine what SDK version to use, and whether -:: to set the SDK for 64-bit. -IF %MAJOR_PYTHON_VERSION% == 2 ( - SET WINDOWS_SDK_VERSION="v7.0" - SET SET_SDK_64=Y -) ELSE ( - IF %MAJOR_PYTHON_VERSION% == 3 ( - SET WINDOWS_SDK_VERSION="v7.1" - IF %MINOR_PYTHON_VERSION% LEQ 4 ( - SET SET_SDK_64=Y - ) ELSE ( - SET SET_SDK_64=N - IF EXIST "%WIN_WDK%" ( - :: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/ - REN "%WIN_WDK%" 0wdf - ) - ) - ) ELSE ( - ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" - EXIT 1 - ) -) - -IF %PYTHON_ARCH% == 64 ( - IF %SET_SDK_64% == Y ( - ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture - SET DISTUTILS_USE_SDK=1 - SET MSSdk=1 - "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% - "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 - ) ELSE ( - ECHO Using default MSVC build environment for 64 bit architecture - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 - ) -) ELSE ( - ECHO Using default MSVC build environment for 32 bit architecture - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 -) \ No newline at end of file diff --git a/CI/upload_wheels.sh b/CI/upload_wheels.sh deleted file mode 100755 index 5bdcd6a..0000000 --- a/CI/upload_wheels.sh +++ /dev/null @@ -1,9 +0,0 @@ -upload_wheels() { - pwd - ls -l - python3 -m pip install twine - if [[ $TRAVIS_TAG ]]; then - python3 -m pip install twine - python3 -m twine upload ./wheelhouse/*.whl - fi -} \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 9901ccb..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,62 +0,0 @@ -# Heavily inspired from https://github.com/CheetahTemplate3/cheetah3 - -version: '{branch}-{build}' - -cache: - - '%LOCALAPPDATA%\pip\Cache' - -# Match travis -clone_depth: 50 - -skip_branch_with_pr: true - -environment: - global: - # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the - # /E:ON and /V:ON options are not enabled in the batch script intepreter - # See: http://stackoverflow.com/a/13751649/163740 - CMD_IN_ENV: "cmd /E:ON /V:ON /C CI\\run_with_env.cmd" - - matrix: - - PYTHON_VERSION: "3.10" - PYTHON_ARCH: "64" - PYTHON_HOME: "C:\\Python310-x64" - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - - PYTHON_VERSION: "3.11" - PYTHON_ARCH: "64" - PYTHON_HOME: "C:\\Python311-x64" - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - - PYTHON_VERSION: "3.12" - PYTHON_ARCH: "64" - PYTHON_HOME: "C:\\Python312-x64" - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - - PYTHON_VERSION: "3.13" - PYTHON_ARCH: "64" - PYTHON_HOME: "C:\\Python313-x64" - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - # Python 3.14 is not yet available - # https://www.appveyor.com/docs/windows-images-software/ -install: - # Ensure we use the right python version - - "SET PATH=%PYTHON_HOME%;%PYTHON_HOME%\\Scripts;%PATH%" - - "SET TOXPYTHON=%PYTHON_HOME%\\python.exe" - - "python --version" - - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" - - "python -m pip install --upgrade pip cython pytest tox ppu setuptools" - - "pip --version" - -build_script: - - "%WITH_ENV% python setup.py build_ext --inplace" - -test_script: - - "%CMD_IN_ENV% pytest" - -deploy_script: - # If tests are successful and we've tested a tag, deploy binary wheel - # TWINE_USERNAME / TWINE_PASSWORD / TWINE_REPOSITORY_URL - # must be set in AppVeyor settings. - - if "%APPVEYOR_REPO_TAG%" == "true" ( - pip install --upgrade twine "wheel==0.45.1" && - %CMD_IN_ENV% python setup.py bdist_wheel && - twine upload --skip-existing dist\\*.whl --repository-url %TWINE_REPOSITORY_URL% -u %TWINE_USERNAME% -p %TWINE_PASSWORD% - )