From 875a81803b6e22bd75645fbf112024e0187ddac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 21 Oct 2019 17:53:52 +0200 Subject: [PATCH] python: avoid clash with the builtin platform module when running tests. --- src/python/magnum/platform/CMakeLists.txt | 6 +++++- src/python/magnum/platform/{__init__.py => _init.py} | 0 2 files changed, 5 insertions(+), 1 deletion(-) rename src/python/magnum/platform/{__init__.py => _init.py} (100%) diff --git a/src/python/magnum/platform/CMakeLists.txt b/src/python/magnum/platform/CMakeLists.txt index 861e85e..988f478 100644 --- a/src/python/magnum/platform/CMakeLists.txt +++ b/src/python/magnum/platform/CMakeLists.txt @@ -79,5 +79,9 @@ if(NOT MAGNUM_BUILD_STATIC) endif() endif() +# Not named __init__.py so this directory is not treated as a module by python +# when running python -m unittest in the parent directory (because numpy uses +# python's builtin platform module to check for PyPy and it's all downhill from +# there) file(GENERATE OUTPUT ${output_dir}/magnum/platform/__init__.py - INPUT ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py) + INPUT ${CMAKE_CURRENT_SOURCE_DIR}/_init.py) diff --git a/src/python/magnum/platform/__init__.py b/src/python/magnum/platform/_init.py similarity index 100% rename from src/python/magnum/platform/__init__.py rename to src/python/magnum/platform/_init.py