Skip to content

Commit ce05232

Browse files
committed
Fix test and cleanup
1 parent e1a4055 commit ce05232

2 files changed

Lines changed: 14 additions & 19 deletions

File tree

recipe/build_base.bat

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe (
164164
echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe does not exist"
165165
)
166166

167-
168167
:: Remove test data to save space.
169168
:: Though keep `support` as some things use that.
170169
mkdir %PREFIX%\Lib\test_keep
@@ -177,44 +176,35 @@ rd /s /q %PREFIX%\Lib\test
177176
if errorlevel 1 exit 1
178177
move %PREFIX%\Lib\test_keep %PREFIX%\Lib\test
179178
if errorlevel 1 exit 1
180-
rd /s /q %PREFIX%\Lib\lib2to3\tests\
181-
if errorlevel 1 exit 1
182-
183-
:: bytecode compile the standard library
184-
185-
rd /s /q %PREFIX%\Lib\lib2to3\tests\
186-
if errorlevel 1 exit 1
187179

188180
:: We need our Python to be found!
189181
if "%_D%" neq "" copy %PREFIX%\python%_D%.exe %PREFIX%\python.exe
190182
if "%EXE_T%" neq "" copy %PREFIX%\python%EXE_T%.exe %PREFIX%\python.exe
191183

184+
:: bytecode compile the standard library
192185
%PREFIX%\python.exe -Wi %PREFIX%\Lib\compileall.py -f -q -x "bad_coding|badsyntax|py2_" %PREFIX%\Lib
193186
if errorlevel 1 exit 1
194187

195-
:: Pickle lib2to3 Grammar
196-
%PREFIX%\python.exe -m lib2to3 --help
197-
198188
:: Ensure that scripts are generated
199189
:: https://github.com/conda-forge/python-feedstock/issues/384
200190
%PREFIX%\python.exe %RECIPE_DIR%\fix_staged_scripts.py
201191
if errorlevel 1 exit 1
202192

203193
:: Some quick tests for common failures
204194
echo "Testing print() does not print: Hello"
205-
%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe -c "print()" 2>&1 | findstr /r /c:"Hello"
195+
%PREFIX%\python.exe -c "print()" 2>&1 | findstr /r /c:"Hello"
206196
if %errorlevel% neq 1 exit /b 1
207197

208198
echo "Testing print('Hello') prints: Hello"
209-
%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe "print('Hello')" 2>&1 | findstr /r /c:"Hello"
199+
%PREFIX%\python.exe -c "print('Hello')" 2>&1 | findstr /r /c:"Hello"
210200
if %errorlevel% neq 0 exit /b 1
211201

212202
echo "Testing import of os (no DLL needed) does not print: The specified module could not be found"
213-
%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe -v -c "import os" 2>&1
214-
%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe -v -c "import os" 2>&1 | findstr /r /c:"The specified module could not be found"
203+
%PREFIX%\python.exe -v -c "import os" 2>&1
204+
%PREFIX%\python.exe -v -c "import os" 2>&1 | findstr /r /c:"The specified module could not be found"
215205
if %errorlevel% neq 1 exit /b 1
216206

217207
echo "Testing import of _sqlite3 (DLL located via PATH needed) does not print: The specified module could not be found"
218-
%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe -v -c "import _sqlite3" 2>&1
219-
%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe -v -c "import _sqlite3" 2>&1 | findstr /r /c:"The specified module could not be found"
208+
%PREFIX%\python.exe -v -c "import _sqlite3" 2>&1
209+
%PREFIX%\python.exe -v -c "import _sqlite3" 2>&1 | findstr /r /c:"The specified module could not be found"
220210
if %errorlevel% neq 1 exit /b 1

recipe/meta.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,13 @@ outputs:
229229
- for f in ${CONDA_PREFIX}/lib/python*/_sysconfig*.py; do echo "Checking $f:"; if [[ `rg @[^@]*@ $f` ]]; then echo "FAILED ON $f"; cat $f; exit 1; fi; done # [linux64 or osx]
230230
- test ! -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}.a # [unix]
231231
- test ! -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}.nolto.a # [unix]
232-
- if not exist %PREFIX%\\libs\\python3.lib exit 1 # [win]
233-
- if not exist %PREFIX%\\libs\\python3{{ ver2nd }}.lib exit 1 # [win]
232+
{% if freethreading == "yes" %}
233+
- if not exist %PREFIX%\\libs\\python3t.lib exit 1 # [win]
234+
- if not exist %PREFIX%\\libs\\python{{ ver2nd }}t.lib exit 1 # [win]
235+
{%e else %}
236+
- if not exist %PREFIX%\\libs\\python3.lib exit 1 # [win]
237+
- if not exist %PREFIX%\\libs\\python{{ ver2nd }}.lib exit 1 # [win]
238+
{% endif %}
234239
# https://github.com/conda-forge/python-feedstock/issues/384
235240
- if exist %PREFIX%\\Scripts\\pydoc exit 1 # [win]
236241
- if exist %PREFIX%\\Scripts\\idle exit 1 # [win]

0 commit comments

Comments
 (0)