Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion recipe/install_base.bat
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if "%PY_FREETHREADING%" == "yes" (
)

:: 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 (
for %%x in (python%EXE_T%%_D%.exe pythonw%EXE_T%%_D%.exe) do (
if exist %SRC_DIR%\PCbuild\%HOST_DIR%\%%x (
copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\%%x %PREFIX%
) else (
Expand Down
37 changes: 37 additions & 0 deletions recipe/install_shared.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
setlocal EnableDelayedExpansion
echo on

if "%target_platform%"=="win-64" (
set HOST_DIR=amd64
)
if "%target_platform%"=="win-32" (
set HOST_DIR=win32
)
if "%target_platform%"=="win-arm64" (
set HOST_DIR=arm64
)

for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do (
set "VERNODOTS=%%i%%j"
)

if "%PY_INTERP_DEBUG%"=="yes" (
set _D=_d
) else (
set _D=
)

if "%PY_FREETHREADING%" == "yes" (
set "THREAD=t"
) else (
set "THREAD="
)

:: move python*.dll
for %%x in (python%VERNODOTS%%THREAD%%_D%.dll python3%THREAD%%_D%.dll) do (
if exist %SRC_DIR%\PCbuild\%HOST_DIR%\%%x (
copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\%%x %PREFIX%
) else (
echo "WARNING :: %SRC_DIR%\PCbuild\%HOST_DIR%\%%x does not exist"
)
)
37 changes: 9 additions & 28 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 1 %}
{% set build_number = 2 %}

# this makes the linter happy
{% set channel_targets = channel_targets or 'conda-forge main' %}
Expand Down Expand Up @@ -265,10 +265,13 @@ outputs:
files:
- tests/cmake/*
- tests/cython/*
- tests/prefix-replacement/*
- run_test.py
commands:
- echo on # [win]
- set # [win]
# ensure we don't pick up python from the image by accident
- rmdir /s /q C:\hostedtoolcache\windows\Python # [win]
- python -V
- python3 -V # [not win]
- pydoc -h
Expand Down Expand Up @@ -308,7 +311,11 @@ outputs:
- if not exist %PREFIX%\\Scripts\\pydoc.exe exit 1 # [win]
- if not exist %PREFIX%\\include\\pyconfig.h exit 1 # [win]
- pushd tests
- pushd prefix-replacement # [unix]
- bash build-and-test.sh # [unix]
- popd # [unix]
- pushd cmake
- cmake -GNinja {{ cmake_test_args }} -DPY_VER={{ version }} -DEXTRA_COMPONENTS="Development.Embed" {{ cmake_debug }} .
- cmake -GNinja {{ cmake_test_args }} -DPY_VER={{ version }} -DEXTRA_COMPONENTS="Development.Module" {{ cmake_debug }} .
- popd
- popd
Expand All @@ -322,11 +329,7 @@ outputs:

- name: libpython
script: install_shared.sh # [unix]
files: # [win]
- python3.dll # [win]
- python3t.dll # [win]
- python{{ ver2nd }}.dll # [win]
- python{{ ver2nd }}t.dll # [win]
script: install_shared.bat # [win]
build:
number: {{ build_number }}
activate_in_script: true
Expand All @@ -342,20 +345,6 @@ outputs:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
test:
files:
- tests/cmake/*
- tests/prefix-replacement/*
requires:
- {{ stdlib('c') }}
- {{ compiler('c') }}
# cmake expects a C++ compiler for some reason
- {{ compiler('cxx') }}
# build-and-test.sh needs to find `Python.h`; can't do pin_subpackage
# due to the way conda-build (mis-)populates the package hashes
- python {{ version }} *_{{ PKG_BUILDNUM }}{{ debug }}_{{ abi_tag }}
- ripgrep
- cmake
- ninja
commands:
- VER=${PKG_VERSION%.*} # [not win]
- VERABI=${VER} # [not win]
Expand All @@ -376,14 +365,6 @@ outputs:
- if not exist %PREFIX%\python3.dll exit 1 # [win]
- if not exist %PREFIX%\python{{ ver2nd }}.dll exit 1 # [win]
{% endif %}
- pushd tests
- pushd prefix-replacement # [unix]
- bash build-and-test.sh # [unix]
- popd # [unix]
- pushd cmake
- cmake -GNinja {{ cmake_test_args }} -DPY_VER={{ version }} -DEXTRA_COMPONENTS="Development.Embed" {{ cmake_debug }} .
- popd
- popd

- name: libpython-static
script: install_static.sh # [unix]
Expand Down
2 changes: 1 addition & 1 deletion recipe/tests/prefix-replacement/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -ex

case ${PKG_NAME} in
libpython)
python)
# see bpo44182 for why -L${CONDA_PREFIX}/lib is added
${CC} a.c $(python3-config --cflags) \
$(python3-config --embed --ldflags) \
Expand Down