diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml index 4a607d55..9a766cf7 100755 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -55,7 +55,7 @@ jobs: osx_arm64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingno: CONFIG: osx_arm64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingno UPLOAD_PACKAGES: 'True' - VMIMAGE: macOS-15 + VMIMAGE: macOS-15-arm64 build_workspace_dir: ~/miniforge3/conda-bld free_disk_space: skip pagefile_size: 0 @@ -66,7 +66,7 @@ jobs: osx_arm64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingyes: CONFIG: osx_arm64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingyes UPLOAD_PACKAGES: 'True' - VMIMAGE: macOS-15 + VMIMAGE: macOS-15-arm64 build_workspace_dir: ~/miniforge3/conda-bld free_disk_space: skip pagefile_size: 0 @@ -77,7 +77,7 @@ jobs: osx_arm64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingno: CONFIG: osx_arm64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingno UPLOAD_PACKAGES: 'True' - VMIMAGE: macOS-15 + VMIMAGE: macOS-15-arm64 build_workspace_dir: ~/miniforge3/conda-bld free_disk_space: skip pagefile_size: 0 @@ -88,7 +88,7 @@ jobs: osx_arm64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingyes: CONFIG: osx_arm64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingyes UPLOAD_PACKAGES: 'True' - VMIMAGE: macOS-15 + VMIMAGE: macOS-15-arm64 build_workspace_dir: ~/miniforge3/conda-bld free_disk_space: skip pagefile_size: 0 diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 75d3a7b2..9c460bb6 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -28,6 +28,26 @@ jobs: store_build_artifacts: true tools_install_dir: D:\Miniforge CONFIG_SHORT: win_64_freethreadingyes + win_arm64_freethreadingno: + CONFIG: win_arm64_freethreadingno + UPLOAD_PACKAGES: 'True' + build_workspace_dir: C:\\bld\\ + free_disk_space: skip + pagefile_size: 0 + resize_partitions: false + store_build_artifacts: true + tools_install_dir: C:\Miniforge + CONFIG_SHORT: win_arm64_freethreadingno + win_arm64_freethreadingyes: + CONFIG: win_arm64_freethreadingyes + UPLOAD_PACKAGES: 'True' + build_workspace_dir: C:\\bld\\ + free_disk_space: skip + pagefile_size: 0 + resize_partitions: false + store_build_artifacts: true + tools_install_dir: C:\Miniforge + CONFIG_SHORT: win_arm64_freethreadingyes timeoutInMinutes: 360 variables: UPLOAD_TEMP: D:\\tmp diff --git a/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingno.yaml b/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingno.yaml index d9f01bf1..2bb7c3be 100644 --- a/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingno.yaml +++ b/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingno.yaml @@ -19,7 +19,7 @@ cxx_compiler: cxx_compiler_version: - '14' docker_image: -- quay.io/condaforge/linux-anvil-x86_64:alma10 +- quay.io/condaforge/linux-anvil-aarch64:alma10 expat: - '2' freethreading: diff --git a/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingyes.yaml b/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingyes.yaml index a0b0dcc2..9cc42a3f 100644 --- a/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingyes.yaml +++ b/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingyes.yaml @@ -19,7 +19,7 @@ cxx_compiler: cxx_compiler_version: - '14' docker_image: -- quay.io/condaforge/linux-anvil-x86_64:alma10 +- quay.io/condaforge/linux-anvil-aarch64:alma10 expat: - '2' freethreading: diff --git a/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingno.yaml b/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingno.yaml index af6b6e46..70d5afa7 100644 --- a/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingno.yaml +++ b/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingno.yaml @@ -19,7 +19,7 @@ cxx_compiler: cxx_compiler_version: - '14' docker_image: -- quay.io/condaforge/linux-anvil-x86_64:alma10 +- quay.io/condaforge/linux-anvil-aarch64:alma10 expat: - '2' freethreading: diff --git a/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingyes.yaml b/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingyes.yaml index 5195f087..807862b5 100644 --- a/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingyes.yaml +++ b/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingyes.yaml @@ -19,7 +19,7 @@ cxx_compiler: cxx_compiler_version: - '14' docker_image: -- quay.io/condaforge/linux-anvil-x86_64:alma10 +- quay.io/condaforge/linux-anvil-aarch64:alma10 expat: - '2' freethreading: diff --git a/.ci_support/win_arm64_freethreadingno.yaml b/.ci_support/win_arm64_freethreadingno.yaml new file mode 100644 index 00000000..2f31cb7e --- /dev/null +++ b/.ci_support/win_arm64_freethreadingno.yaml @@ -0,0 +1,43 @@ +build_type: +- release +bzip2: +- '1' +c_compiler: +- vs2022 +c_stdlib: +- vs +channel_sources: +- conda-forge/label/python_rc,conda-forge +channel_targets: +- conda-forge python_dev +cxx_compiler: +- vs2022 +expat: +- '2' +freethreading: +- 'no' +libffi: +- '3.5' +liblzma_devel: +- '5' +libsqlite: +- '3' +openssl: +- '3.5' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- '3.15' +target_platform: +- win-arm64 +tk: +- '8.6' +zip_keys: +- - build_type + - channel_targets +zlib: +- '1' +zstd: +- '1.5' diff --git a/.ci_support/win_arm64_freethreadingyes.yaml b/.ci_support/win_arm64_freethreadingyes.yaml new file mode 100644 index 00000000..b4597acb --- /dev/null +++ b/.ci_support/win_arm64_freethreadingyes.yaml @@ -0,0 +1,43 @@ +build_type: +- release +bzip2: +- '1' +c_compiler: +- vs2022 +c_stdlib: +- vs +channel_sources: +- conda-forge/label/python_rc,conda-forge +channel_targets: +- conda-forge python_dev +cxx_compiler: +- vs2022 +expat: +- '2' +freethreading: +- 'yes' +libffi: +- '3.5' +liblzma_devel: +- '5' +libsqlite: +- '3' +openssl: +- '3.5' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- '3.15' +target_platform: +- win-arm64 +tk: +- '8.6' +zip_keys: +- - build_type + - channel_targets +zlib: +- '1' +zstd: +- '1.5' diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index e0f01c37..b0d24fc0 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -76,7 +76,7 @@ jobs: tools_install_dir: ~/miniforge3 - CONFIG: linux_aarch64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingno CONFIG_SHORT: linux_aarch64_build_typedebugchannel_tar_h158ec98d - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64:alma10 STORE_BUILD_ARTIFACTS: True UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts @@ -85,11 +85,11 @@ jobs: os: ubuntu pagefile_size: 0 resize_partitions: False - runs_on: ['ubuntu-latest'] + runs_on: ['ubuntu-24.04-arm'] tools_install_dir: ~/miniforge3 - CONFIG: linux_aarch64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingyes CONFIG_SHORT: linux_aarch64_build_typedebugchannel_tar_h618840af - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64:alma10 STORE_BUILD_ARTIFACTS: True UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts @@ -98,11 +98,11 @@ jobs: os: ubuntu pagefile_size: 0 resize_partitions: False - runs_on: ['ubuntu-latest'] + runs_on: ['ubuntu-24.04-arm'] tools_install_dir: ~/miniforge3 - CONFIG: linux_aarch64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingno CONFIG_SHORT: linux_aarch64_build_typereleasechannel_t_hbbb47f33 - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64:alma10 STORE_BUILD_ARTIFACTS: True UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts @@ -111,11 +111,11 @@ jobs: os: ubuntu pagefile_size: 0 resize_partitions: False - runs_on: ['ubuntu-latest'] + runs_on: ['ubuntu-24.04-arm'] tools_install_dir: ~/miniforge3 - CONFIG: linux_aarch64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingyes CONFIG_SHORT: linux_aarch64_build_typereleasechannel_t_ha31997ea - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64:alma10 STORE_BUILD_ARTIFACTS: True UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts @@ -124,7 +124,7 @@ jobs: os: ubuntu pagefile_size: 0 resize_partitions: False - runs_on: ['ubuntu-latest'] + runs_on: ['ubuntu-24.04-arm'] tools_install_dir: ~/miniforge3 - CONFIG: linux_ppc64le_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingno CONFIG_SHORT: linux_ppc64le_build_typedebugchannel_tar_he3888cbf diff --git a/.recipe_maintainers.json b/.recipe_maintainers.json new file mode 100644 index 00000000..32e6787d --- /dev/null +++ b/.recipe_maintainers.json @@ -0,0 +1,12 @@ +{ + "chrisburr": 5220533, + "isuruf": 5234427, + "jakirkham": 3019665, + "katietz": 47363620, + "mbargull": 10598343, + "msarahan": 38393, + "ocefpaf": 950575, + "pelson": 810663, + "scopatz": 320553, + "xhochy": 70274 +} \ No newline at end of file diff --git a/README.md b/README.md index 845d26cd..b2d75872 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,34 @@ Current build status variant + + osx_arm64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingno + + + variant + + + + osx_arm64_build_typedebugchannel_targetsconda-forge_python_dev_debugfreethreadingyes + + + variant + + + + osx_arm64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingno + + + variant + + + + osx_arm64_build_typereleasechannel_targetsconda-forge_python_devfreethreadingyes + + + variant + + win_64_freethreadingno @@ -131,14 +159,14 @@ Current release info Installing python ================= -Installing `python` from the `conda-forge/label/python_dev_debug` channel can be achieved by adding `conda-forge/label/python_dev_debug` to your channels with: +Installing `python` from the `conda-forge/label/python_dev` channel can be achieved by adding `conda-forge/label/python_dev` to your channels with: ``` -conda config --add channels conda-forge/label/python_dev_debug +conda config --add channels conda-forge/label/python_dev conda config --set channel_priority strict ``` -Once the `conda-forge/label/python_dev_debug` channel has been enabled, `cpython, libpython, libpython-static, python, python-freethreading, python-gil, python-jit` can be installed with `conda`: +Once the `conda-forge/label/python_dev` channel has been enabled, `cpython, libpython, libpython-static, python, python-freethreading, python-gil, python-jit` can be installed with `conda`: ``` conda install cpython libpython libpython-static python python-freethreading python-gil python-jit @@ -153,26 +181,26 @@ mamba install cpython libpython libpython-static python python-freethreading pyt It is possible to list all of the versions of `cpython` available on your platform with `conda`: ``` -conda search cpython --channel conda-forge/label/python_dev_debug +conda search cpython --channel conda-forge/label/python_dev ``` or with `mamba`: ``` -mamba search cpython --channel conda-forge/label/python_dev_debug +mamba search cpython --channel conda-forge/label/python_dev ``` Alternatively, `mamba repoquery` may provide more information: ``` # Search all versions available on your platform: -mamba repoquery search cpython --channel conda-forge/label/python_dev_debug +mamba repoquery search cpython --channel conda-forge/label/python_dev # List packages depending on `cpython`: -mamba repoquery whoneeds cpython --channel conda-forge/label/python_dev_debug +mamba repoquery whoneeds cpython --channel conda-forge/label/python_dev # List dependencies of `cpython`: -mamba repoquery depends cpython --channel conda-forge/label/python_dev_debug +mamba repoquery depends cpython --channel conda-forge/label/python_dev ``` diff --git a/conda-forge.yml b/conda-forge.yml index 86499239..d04fdbba 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -6,11 +6,8 @@ bot: - '3.12' - '3.13' build_platform: - linux_aarch64: linux_64 linux_ppc64le: linux_64 - osx_arm64: osx_64 -workflow_settings: - store_build_artifacts: true + win_arm64: win_64 conda_build: pkg_format: '2' conda_forge_output_validation: true @@ -19,5 +16,8 @@ github: tooling_branch_name: main provider: linux_aarch64: default - linux_ppc64le: native + osx_arm64: default test: native_and_emulated +workflow_settings: + store_build_artifacts: + - value: true diff --git a/recipe/build_base.bat b/recipe/build_base.bat index 70426723..6a38c578 100644 --- a/recipe/build_base.bat +++ b/recipe/build_base.bat @@ -5,12 +5,30 @@ echo on set PYTHON=%CONDA_PYTHON_EXE% :: Compile python, extensions and external libraries -if "%ARCH%"=="64" ( - set PLATFORM=x64 - set VC_PATH=x64 -) else ( - set PLATFORM=Win32 - set VC_PATH=x86 +if "%target_platform%"=="win-64" ( + set HOST_PLATFORM=x64 + set HOST_DIR=amd64 +) +if "%target_platform%"=="win-32" ( + set HOST_PLATFORM=Win32 + set HOST_DIR=win32 +) +if "%target_platform%"=="win-arm64" ( + set HOST_PLATFORM=ARM64 + set HOST_DIR=arm64 +) + +if "%build_platform%"=="win-64" ( + set BUILD_PLATFORM=x64 + set BUILD_DIR=amd64 +) +if "%build_platform%"=="win-32" ( + set BUILD_PLATFORM=Win32 + set BUILD_DIR=win32 +) +if "%build_platform%"=="win-arm64" ( + set BUILD_PLATFORM=ARM64 + set BUILD_DIR=arm64 ) for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( @@ -38,11 +56,12 @@ if "%PY_INTERP_DEBUG%"=="yes" ( set _D= ) - +set PGO=--pgo if "%DEBUG_C%"=="yes" ( set PGO= -) else ( - set PGO=--pgo +) +if "%CONDA_BUILD_CROSS_COMPILATION%" == "1" ( + set PGO= ) if "%PY_FREETHREADING%" == "yes" ( @@ -51,28 +70,17 @@ if "%PY_FREETHREADING%" == "yes" ( set "EXE_T=%VER%t" :: Free-threaded MSBuild output goes to PCbuild\amd64t\ (or win32t\), not amd64\. :: Upstream python.props sets BuildPath=BuildPath64t when DisableGil=true; all - :: exes, .pyd, and .lib artifacts land there. BUILD_PATH below is used to + :: exes, .pyd, and .lib artifacts land there. HOST_DIR below is used to :: stage those files into %PREFIX% — leaving it at amd64 makes xcopy *.pyd fail :: with "File not found" even though the compile itself succeeded. - if "%ARCH%"=="64" ( - set BUILD_PATH=amd64t - ) else ( - set BUILD_PATH=win32t - ) + set HOST_DIR=%HOST_DIR%t + set BUILD_DIR=%BUILD_DIR%t ) else ( set "FREETHREADING=--experimental-jit-off" set "THREAD=" set "EXE_T=" - if "%ARCH%"=="64" ( - set BUILD_PATH=amd64 - ) else ( - set BUILD_PATH=win32 - ) ) -:: AP doesn't support PGO atm? -set PGO= - :: TODO: remove once tk 9 is available on main :: Pin Tcl/Tk from the `tk` variant in conda_build_config.yaml (single source of :: truth, shared with build_base.sh). Upstream 3.15 tcltk.props defaults @@ -82,24 +90,37 @@ set TCLTK_MSBUILD_PROPS="/p:TclVersion=%tk%" "/p:TkVersion=%tk%" cd PCbuild -call build.bat %PGO% %CONFIG% %FREETHREADING% -m -e -v -p %PLATFORM% %TCLTK_MSBUILD_PROPS% +setlocal EnableDelayedExpansion +if "%CONDA_BUILD_CROSS_COMPILATION%" == "1" ( + REM build for the build platform. LIBRARY_PREFIX is used by the patches + REM No PGO. No externals, i.e. remove building extension modules + REM we don't need. + set LIBRARY_PREFIX=%BUILD_PREFIX%\\Library + call build.bat %CONFIG% %FREETHREADING% -m -E -v -p %BUILD_PLATFORM% %TCLTK_MSBUILD_PROPS% + if errorlevel 1 exit 1 +) +endlocal +:: Twice because: +:: error : importlib_zipimport.h updated. You will need to rebuild pythoncore to see the changes. +call build.bat %PGO% %CONFIG% %FREETHREADING% -m -e -v -p %HOST_PLATFORM% %TCLTK_MSBUILD_PROPS% +call build.bat %PGO% %CONFIG% %FREETHREADING% -m -e -v -p %HOST_PLATFORM% %TCLTK_MSBUILD_PROPS% if errorlevel 1 exit 1 cd .. :: Populate the root package directory for %%x in (python%VERNODOTS%%THREAD%%_D%.dll python3%THREAD%%_D%.dll python%EXE_T%%_D%.exe pythonw%EXE_T%%_D%.exe) do ( - if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x ( - copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x %PREFIX% + if exist %SRC_DIR%\PCbuild\%HOST_DIR%\%%x ( + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\%%x %PREFIX% ) else ( - echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x does not exist" + echo "WARNING :: %SRC_DIR%\PCbuild\%HOST_DIR%\%%x does not exist" ) ) for %%x in (python%THREAD%%_D%.pdb python%VERNODOTS%%THREAD%%_D%.pdb pythonw%THREAD%%_D%.pdb) do ( - if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x ( - copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x %PREFIX% + if exist %SRC_DIR%\PCbuild\%HOST_DIR%\%%x ( + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\%%x %PREFIX% ) else ( - echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x does not exist" + echo "WARNING :: %SRC_DIR%\PCbuild\%HOST_DIR%\%%x does not exist" ) ) @@ -111,7 +132,7 @@ if errorlevel 1 exit 1 :: Populate the DLLs directory mkdir %PREFIX%\lib\python\lib-dynload -xcopy /s /y %SRC_DIR%\PCBuild\%BUILD_PATH%\*.pyd %PREFIX%\lib\python\lib-dynload +xcopy /s /y %SRC_DIR%\PCBuild\%HOST_DIR%\*.pyd %PREFIX%\lib\python\lib-dynload if errorlevel 1 exit 1 copy /Y %SRC_DIR%\PC\icons\py.ico %PREFIX%\lib\python\lib-dynload @@ -150,12 +171,12 @@ for %%x in (idle pydoc) do ( ) :: Populate the libs directory -dir %SRC_DIR%\PCbuild\%BUILD_PATH%\ -if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\python%VERNODOTS%%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python%VERNODOTS%%THREAD%%_D%.lib %PREFIX%\lib\ +dir %SRC_DIR%\PCbuild\%HOST_DIR%\ +if exist %SRC_DIR%\PCbuild\%HOST_DIR%\python%VERNODOTS%%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\python%VERNODOTS%%THREAD%%_D%.lib %PREFIX%\lib\ if errorlevel 1 exit 1 -if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\python3%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python3%THREAD%%_D%.lib %PREFIX%\lib\ +if exist %SRC_DIR%\PCbuild\%HOST_DIR%\python3%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\python3%THREAD%%_D%.lib %PREFIX%\lib\ if errorlevel 1 exit 1 -if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\_tkinter%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\_tkinter%THREAD%%_D%.lib %PREFIX%\lib\ +if exist %SRC_DIR%\PCbuild\%HOST_DIR%\_tkinter%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\_tkinter%THREAD%%_D%.lib %PREFIX%\lib\ if errorlevel 1 exit 1 @@ -166,20 +187,20 @@ if errorlevel 1 exit 1 :: Copy venv[w]launcher scripts to venv\scripts\nt :: See https://github.com/python/cpython/blob/b4a316087c32d83e375087fd35fc511bc430ee8b/lib/python/venv/__init__.py#L334-L376 -if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe ( +if exist %SRC_DIR%\PCbuild\%HOST_DIR%\venvlauncher%THREAD%%_D%.exe ( @rem We did copy pythonw.exe until 3.12 but starting with 3.13 we seem to need the latter. Should we omit the first? - copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\python.exe - copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\venvlauncher%THREAD%%_D%.exe + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\venvlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\python.exe + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\venvlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\venvlauncher%THREAD%%_D%.exe ) else ( - echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe does not exist" + echo "WARNING :: %SRC_DIR%\PCbuild\%HOST_DIR%\venvlauncher%THREAD%%_D%.exe does not exist" ) -if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe ( +if exist %SRC_DIR%\PCbuild\%HOST_DIR%\venvwlauncher%THREAD%%_D%.exe ( @rem We did copy pythonw.exe until 3.12 but starting with 3.13 we seem to need the latter. Should we omit the first? - copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\pythonw.exe - copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\venvwlauncher%THREAD%%_D%.exe + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\pythonw.exe + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\venvwlauncher%THREAD%%_D%.exe ) else ( - echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe does not exist" + echo "WARNING :: %SRC_DIR%\PCbuild\%HOST_DIR%\venvwlauncher%THREAD%%_D%.exe does not exist" ) :: Remove test data to save space. @@ -199,30 +220,37 @@ if errorlevel 1 exit 1 if "%_D%" neq "" copy %PREFIX%\python%_D%.exe %PREFIX%\python.exe if "%EXE_T%" neq "" copy %PREFIX%\python%EXE_T%.exe %PREFIX%\python.exe +if "%CONDA_BUILD_CROSS_COMPILATION%" == "1" ( + set "PYTHON=%SRC_DIR%\PCbuild\%BUILD_DIR%\\python%EXE_T%%_D%.exe" +) else ( + set "PYTHON=%PREFIX%\python.exe" +) :: bytecode compile the standard library -%PREFIX%\python.exe -Wi %PREFIX%\lib\python\compileall.py -f -q -x "bad_coding|badsyntax|py2_" %PREFIX%\lib\python +%PYTHON% -Wi %PREFIX%\lib\python\compileall.py -f -q -x "bad_coding|badsyntax|py2_" %PREFIX%\lib\python if errorlevel 1 exit 1 :: Ensure that scripts are generated :: https://github.com/conda-forge/python-feedstock/issues/384 -%PREFIX%\python.exe %RECIPE_DIR%\fix_staged_scripts.py +%PYTHON% %RECIPE_DIR%\fix_staged_scripts.py if errorlevel 1 exit 1 -:: Some quick tests for common failures -echo "Testing print() does not print: Hello" -%PREFIX%\python.exe -c "print()" 2>&1 | findstr /r /c:"Hello" -if %errorlevel% neq 1 exit /b 1 - -echo "Testing print('Hello') prints: Hello" -%PREFIX%\python.exe -c "print('Hello')" 2>&1 | findstr /r /c:"Hello" -if %errorlevel% neq 0 exit /b 1 - -echo "Testing import of os (no DLL needed) does not print: The specified module could not be found" -%PREFIX%\python.exe -v -c "import os" 2>&1 -%PREFIX%\python.exe -v -c "import os" 2>&1 | findstr /r /c:"The specified module could not be found" -if %errorlevel% neq 1 exit /b 1 - -echo "Testing import of _sqlite3 (DLL located via PATH needed) does not print: The specified module could not be found" -%PREFIX%\python.exe -v -c "import _sqlite3" 2>&1 -%PREFIX%\python.exe -v -c "import _sqlite3" 2>&1 | findstr /r /c:"The specified module could not be found" -if %errorlevel% neq 1 exit /b 1 +if NOT "%CONDA_BUILD_CROSS_COMPILATION%" == "1" ( + REM Some quick tests for common failures + echo "Testing print() does not print: Hello" + %PREFIX%\python.exe -c "print()" 2>&1 | findstr /r /c:"Hello" + if %errorlevel% neq 1 exit /b 1 + + echo "Testing print('Hello') prints: Hello" + %PREFIX%\python.exe -c "print('Hello')" 2>&1 | findstr /r /c:"Hello" + if %errorlevel% neq 0 exit /b 1 + + echo "Testing import of os (no DLL needed) does not print: The specified module could not be found" + %PREFIX%\python.exe -v -c "import os" 2>&1 + %PREFIX%\python.exe -v -c "import os" 2>&1 | findstr /r /c:"The specified module could not be found" + if %errorlevel% neq 1 exit /b 1 + + echo "Testing import of _sqlite3 (DLL located via PATH needed) does not print: The specified module could not be found" + %PREFIX%\python.exe -v -c "import _sqlite3" 2>&1 + %PREFIX%\python.exe -v -c "import _sqlite3" 2>&1 | findstr /r /c:"The specified module could not be found" + if %errorlevel% neq 1 exit /b 1 +) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8e2202e6..3753bf5f 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -4,7 +4,7 @@ {% set ver2 = '.'.join(version.split('.')[0:2]) %} {% set ver2nd = ''.join(version.split('.')[0:2]) %} {% set ver3nd = ''.join(version.split('.')[0:3]) %} -{% set build_number = 0 %} +{% set build_number = 1 %} # this makes the linter happy {% set channel_targets = channel_targets or 'conda-forge main' %} @@ -164,19 +164,20 @@ outputs: - llvm-tools-21 # [not win] - clang 21.* # [win] - llvm-tools 21.* # [win] - - bzip2 # [build_platform != target_platform] - - libsqlite # [build_platform != target_platform] - - liblzma-devel # [build_platform != target_platform] - - zlib # [build_platform != target_platform] - - zstd # [build_platform != target_platform] - - openssl # [build_platform != target_platform] - - readline # [not win and build_platform != target_platform] - - tk # [build_platform != target_platform] - - ncurses # [unix and build_platform != target_platform] - - libffi # [build_platform != target_platform] - - libuuid # [linux and build_platform != target_platform] - - libxcrypt # [linux and build_platform != target_platform] - - expat # [build_platform != target_platform] + - bzip2 # [build_platform != target_platform] + - libsqlite # [build_platform != target_platform] + - liblzma-devel # [build_platform != target_platform] + - zlib # [build_platform != target_platform] + - zstd # [build_platform != target_platform] + - openssl # [build_platform != target_platform] + - readline # [not win and build_platform != target_platform] + - tk # [build_platform != target_platform] + - ncurses # [unix and build_platform != target_platform] + - libffi # [build_platform != target_platform] + - libuuid # [linux and build_platform != target_platform] + - libxcrypt # [linux and build_platform != target_platform] + - libmpdec-devel # [build_platform != target_platform] + - expat # [build_platform != target_platform] host: - bzip2 - libsqlite diff --git a/recipe/run_test.py b/recipe/run_test.py index edb45758..79a5df6a 100644 --- a/recipe/run_test.py +++ b/recipe/run_test.py @@ -110,3 +110,11 @@ # See https://github.com/conda-forge/python-feedstock/issues/718 for context: assert sys.hash_info.algorithm.startswith("siphash") + +# xref https://github.com/conda-forge/openssl-feedstock/issues/237 +import ssl +print("openssl:", ssl.OPENSSL_VERSION) +pem = ssl.get_server_certificate(("pypi.org", 443)) +der = ssl.PEM_cert_to_DER_cert(pem) +ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) +ctx.load_verify_locations(cadata=der)