From 4e7ebbd3a7288ddac5842b0044b426b9c0aa3f33 Mon Sep 17 00:00:00 2001 From: mattip Date: Tue, 29 Oct 2024 10:36:26 +0200 Subject: [PATCH] remove debug cruft, enable windows tests in CI --- .github/workflows/ci.yaml | 10 ++++------ src/cffi/verifier.py | 8 +++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a6909aca..3777df89 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -299,12 +299,12 @@ jobs: CIBW_PRERELEASE_PYTHONS: 'True' CIBW_FREE_THREADED_SUPPORT: 'True' CIBW_TEST_REQUIRES: pytest setuptools # 3.12+ no longer includes distutils, just always ensure setuptools is present - CIBW_TEST_COMMAND: PYTHONUNBUFFERED=1 python -m pytest -s ${{ matrix.test_args || '{project}' }} # default to test all + CIBW_TEST_COMMAND: PYTHONUNBUFFERED=1 python -m pytest ${{ matrix.test_args || '{project}' }} # default to test all run: | set -eux - + mkdir cffi - + tar zxf ${{ steps.fetch_sdist.outputs.download-path }}/cffi*.tar.gz --strip-components=1 -C cffi python -m pip install --upgrade "${{ matrix.cibw_version || 'cibuildwheel' }}" @@ -509,9 +509,7 @@ jobs: CIBW_BUILD: ${{ matrix.spec }} CIBW_PRERELEASE_PYTHONS: 'True' CIBW_TEST_REQUIRES: pytest setuptools - CIBW_TEST_COMMAND: 'python -m pytest {package}/src/c' - # FIXME: /testing takes ~45min on Windows and has some failures... - # CIBW_TEST_COMMAND='python -m pytest {package}/src/c {project}/testing' + CIBW_TEST_COMMAND: 'python -m pytest {package}' run: | set -eux diff --git a/src/cffi/verifier.py b/src/cffi/verifier.py index 8f11d2c0..f7594c2c 100644 --- a/src/cffi/verifier.py +++ b/src/cffi/verifier.py @@ -284,12 +284,12 @@ def cleanup_tmpdir(tmpdir=None, keep_so=False): suffix = _get_so_suffixes()[0].lower() for fn in filelist: if fn.lower().startswith('_cffi_') and ( - fn.lower().endswith(suffix) or - fn.lower().endswith('.c') or + fn.lower().endswith(suffix) or + fn.lower().endswith('.c') or fn.lower().endswith('.o')): try: os.unlink(os.path.join(tmpdir, fn)) - except OSError as e: + except OSError: pass clean_dir = [os.path.join(tmpdir, 'build')] for dir in clean_dir: @@ -302,8 +302,6 @@ def cleanup_tmpdir(tmpdir=None, keep_so=False): os.unlink(fn) except OSError: pass - print("after cleanup_tmp in",tmpdir) - print("files left:\n", "\n".join(os.listdir(tmpdir))) def _get_so_suffixes(): suffixes = _extension_suffixes()