From 6128a88a6780af29825c73af0e32100e93c2f0b5 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Wed, 19 Aug 2020 11:34:06 +0200 Subject: python code coverage on python circleci target. Fix language_level cython warning --- .circleci/config.yml | 10 ++++++---- src/python/setup.py.in | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b04efd52..f8dae062 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,20 +57,22 @@ jobs: cmake -DUSER_VERSION_DIR=version ..; make user_version; cd version; - mkdir build; - cd build; - cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=ON -DPython_ADDITIONAL_VERSIONS=3 ..; + cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=ON -DPython_ADDITIONAL_VERSIONS=3 .; cd python; python3 setup.py build_ext --inplace; make sphinx; cp -R sphinx /tmp/sphinx; python3 setup.py install; python3 setup.py clean --all; - ctest -j 2 --output-on-failure; + python3 -B -m pytest test/*.py --cov-report html --cov=gudhi; + cp -R htmlcov /tmp/htmlcov; - store_artifacts: path: /tmp/sphinx + - store_artifacts: + path: /tmp/htmlcov + doxygen: docker: - image: gudhi/ci_for_gudhi:latest diff --git a/src/python/setup.py.in b/src/python/setup.py.in index 98d058fc..3602fa42 100644 --- a/src/python/setup.py.in +++ b/src/python/setup.py.in @@ -32,7 +32,7 @@ runtime_library_dirs=[@GUDHI_PYTHON_RUNTIME_LIBRARY_DIRS@] # Create ext_modules list from module list ext_modules = [] for module in cython_modules: - ext_modules.append(Extension( + extension = Extension( 'gudhi.' + module, sources = [source_dir + module + '.pyx',], language = 'c++', @@ -41,8 +41,8 @@ for module in cython_modules: libraries=libraries, library_dirs=library_dirs, include_dirs=include_dirs, - runtime_library_dirs=runtime_library_dirs, - cython_directives = {'language_level': str(sys.version_info[0])},)) + runtime_library_dirs=runtime_library_dirs,) + extension.cython_directives = {'language_level': str(sys.version_info[0])} ext_modules = cythonize(ext_modules) -- cgit v1.2.3 From bcad92a18c40b9926b3b25688ab5435c301990df Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Wed, 19 Aug 2020 11:40:40 +0200 Subject: need to append --- src/python/setup.py.in | 1 + 1 file changed, 1 insertion(+) diff --git a/src/python/setup.py.in b/src/python/setup.py.in index 3602fa42..f211f5d2 100644 --- a/src/python/setup.py.in +++ b/src/python/setup.py.in @@ -43,6 +43,7 @@ for module in cython_modules: include_dirs=include_dirs, runtime_library_dirs=runtime_library_dirs,) extension.cython_directives = {'language_level': str(sys.version_info[0])} + ext_modules.append(extension) ext_modules = cythonize(ext_modules) -- cgit v1.2.3 From 52cb44a02ad8ce9884db63724ea0a5f1e35c6172 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Wed, 19 Aug 2020 12:00:27 +0200 Subject: Try to setup.py clean failure --- .circleci/config.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f8dae062..77fad2ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,14 +57,16 @@ jobs: cmake -DUSER_VERSION_DIR=version ..; make user_version; cd version; - cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=ON -DPython_ADDITIONAL_VERSIONS=3 .; + mkdir build; + cd build; + cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=ON -DPython_ADDITIONAL_VERSIONS=3 ..; cd python; python3 setup.py build_ext --inplace; make sphinx; cp -R sphinx /tmp/sphinx; python3 setup.py install; python3 setup.py clean --all; - python3 -B -m pytest test/*.py --cov-report html --cov=gudhi; + python3 -B -m pytest ../../python/test/*.py --cov-report html --cov=gudhi; cp -R htmlcov /tmp/htmlcov; - store_artifacts: -- cgit v1.2.3 From 4a572af654afc22e2f5c26766f611b1918313509 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Thu, 20 Aug 2020 08:15:19 +0200 Subject: Roll back - why cannot clean ? --- .circleci/config.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 77fad2ee..eca9f91e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -66,15 +66,11 @@ jobs: cp -R sphinx /tmp/sphinx; python3 setup.py install; python3 setup.py clean --all; - python3 -B -m pytest ../../python/test/*.py --cov-report html --cov=gudhi; - cp -R htmlcov /tmp/htmlcov; + ctest -j 2 --output-on-failure; - store_artifacts: path: /tmp/sphinx - - store_artifacts: - path: /tmp/htmlcov - doxygen: docker: - image: gudhi/ci_for_gudhi:latest -- cgit v1.2.3 From 37786db094d0251bf070215e89e4446384dbe871 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Thu, 20 Aug 2020 09:35:31 +0200 Subject: Let's clean fail --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eca9f91e..129fdc23 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,19 +57,19 @@ jobs: cmake -DUSER_VERSION_DIR=version ..; make user_version; cd version; - mkdir build; - cd build; - cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=ON -DPython_ADDITIONAL_VERSIONS=3 ..; + cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=ON -DPython_ADDITIONAL_VERSIONS=3 .; cd python; python3 setup.py build_ext --inplace; make sphinx; cp -R sphinx /tmp/sphinx; python3 setup.py install; - python3 setup.py clean --all; - ctest -j 2 --output-on-failure; - + python3 setup.py clean --all || true; + python3 -B -m pytest test/*.py --cov-report html --cov=gudhi; + cp -R htmlcov /tmp/htmlcov; - store_artifacts: path: /tmp/sphinx + - store_artifacts: + path: /tmp/htmlcov doxygen: docker: -- cgit v1.2.3 From 151350f85c2799bcb2fde04c6746db7ab7e1ac95 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Thu, 20 Aug 2020 10:28:48 +0200 Subject: Add some debug traces and install pytest-cov for code coverage --- .circleci/config.yml | 1 + .github/test-requirements.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 129fdc23..167cb4db 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,6 +64,7 @@ jobs: cp -R sphinx /tmp/sphinx; python3 setup.py install; python3 setup.py clean --all || true; + python3 -m pip list python3 -B -m pytest test/*.py --cov-report html --cov=gudhi; cp -R htmlcov /tmp/htmlcov; - store_artifacts: diff --git a/.github/test-requirements.txt b/.github/test-requirements.txt index 98f1007e..7d69c0b9 100644 --- a/.github/test-requirements.txt +++ b/.github/test-requirements.txt @@ -1,4 +1,5 @@ pytest +pytest-cov sphinx sphinxcontrib-bibtex sphinx-paramlinks -- cgit v1.2.3 From 129e85610cfd5a1e3db7f7d656e99915b96a3be5 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Thu, 20 Aug 2020 14:17:31 +0200 Subject: Some cleanup. CircleCI docker image build requires update --- .circleci/config.yml | 76 ++++++++++++++++++++++--------------------- Dockerfile_for_circleci_image | 3 ++ 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 167cb4db..285a66a5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,11 +8,11 @@ jobs: - run: name: Build and test examples command: | - mkdir build; - cd build; - cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=ON -DWITH_GUDHI_TEST=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=OFF ..; - make all; - ctest --output-on-failure; + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=ON -DWITH_GUDHI_TEST=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=OFF .. + make all + ctest --output-on-failure tests: docker: @@ -22,11 +22,11 @@ jobs: - run: name: Build and test unitary tests command: | - mkdir build; - cd build; - cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_TEST=ON -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=OFF ..; - make all; - ctest --output-on-failure; + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_TEST=ON -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=OFF .. + make all + ctest --output-on-failure utils: docker: @@ -36,11 +36,11 @@ jobs: - run: name: Build and test utilities command: | - mkdir build; - cd build; - cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_TEST=OFF -DWITH_GUDHI_UTILITIES=ON -DWITH_GUDHI_PYTHON=OFF ..; - make all; - ctest --output-on-failure; + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_TEST=OFF -DWITH_GUDHI_UTILITIES=ON -DWITH_GUDHI_PYTHON=OFF .. + make all + ctest --output-on-failure python: docker: @@ -52,25 +52,26 @@ jobs: command: | git submodule init git submodule update - mkdir build; - cd build; - cmake -DUSER_VERSION_DIR=version ..; - make user_version; - cd version; - cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=ON -DPython_ADDITIONAL_VERSIONS=3 .; - cd python; - python3 setup.py build_ext --inplace; - make sphinx; - cp -R sphinx /tmp/sphinx; - python3 setup.py install; - python3 setup.py clean --all || true; - python3 -m pip list - python3 -B -m pytest test/*.py --cov-report html --cov=gudhi; - cp -R htmlcov /tmp/htmlcov; + mkdir build + cd build + cmake -DUSER_VERSION_DIR=version .. + make user_version + cd version + cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=ON -DPython_ADDITIONAL_VERSIONS=3 . + cd python + python3 setup.py build_ext --inplace + make sphinx + cp -R sphinx /tmp/sphinx + python3 setup.py install + python3 setup.py clean --all + python3 -B -m pytest test/*.py --cov-report html --cov=gudhi + cp -R htmlcov /tmp/htmlcov - store_artifacts: path: /tmp/sphinx + destination: sphinx - store_artifacts: path: /tmp/htmlcov + destination: htmlcov doxygen: docker: @@ -82,16 +83,17 @@ jobs: command: | git submodule init git submodule update - mkdir build; - cd build; - cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_TEST=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=OFF -DUSER_VERSION_DIR=version ..; - make doxygen 2>&1 | tee dox.log; - grep warning dox.log; - cp dox.log version/doc/html/; - cp -R version/doc/html /tmp/doxygen; + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_TEST=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=OFF -DUSER_VERSION_DIR=version .. + make doxygen 2>&1 | tee dox.log + grep warning dox.log + cp dox.log version/doc/html/ + cp -R version/doc/html /tmp/doxygen - store_artifacts: path: /tmp/doxygen + destination: doxygen workflows: version: 2 diff --git a/Dockerfile_for_circleci_image b/Dockerfile_for_circleci_image index 464097e7..87f57071 100644 --- a/Dockerfile_for_circleci_image +++ b/Dockerfile_for_circleci_image @@ -23,6 +23,9 @@ ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 +# Update again +RUN apt-get update + # Required for Gudhi compilation RUN apt-get install -y make \ git \ -- cgit v1.2.3 From 625ff957479c8a37b4ae02bba29dfffc0d3f1a84 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Fri, 28 Aug 2020 14:38:28 +0200 Subject: code review: Rollback as these changes does not help --- src/python/setup.py.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/python/setup.py.in b/src/python/setup.py.in index f211f5d2..d2708177 100644 --- a/src/python/setup.py.in +++ b/src/python/setup.py.in @@ -32,7 +32,7 @@ runtime_library_dirs=[@GUDHI_PYTHON_RUNTIME_LIBRARY_DIRS@] # Create ext_modules list from module list ext_modules = [] for module in cython_modules: - extension = Extension( + ext_modules.append(Extension( 'gudhi.' + module, sources = [source_dir + module + '.pyx',], language = 'c++', @@ -41,9 +41,8 @@ for module in cython_modules: libraries=libraries, library_dirs=library_dirs, include_dirs=include_dirs, - runtime_library_dirs=runtime_library_dirs,) - extension.cython_directives = {'language_level': str(sys.version_info[0])} - ext_modules.append(extension) + runtime_library_dirs=runtime_library_dirs, + cython_directives = {'language_level': str(sys.version_info[0])},)) ext_modules = cythonize(ext_modules) -- cgit v1.2.3 From 4e794277bfa2158ecaeb7e9db303b92ec84a2f3c Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Fri, 28 Aug 2020 14:40:22 +0200 Subject: bad identation --- src/python/setup.py.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/setup.py.in b/src/python/setup.py.in index d2708177..98d058fc 100644 --- a/src/python/setup.py.in +++ b/src/python/setup.py.in @@ -42,7 +42,7 @@ for module in cython_modules: library_dirs=library_dirs, include_dirs=include_dirs, runtime_library_dirs=runtime_library_dirs, - cython_directives = {'language_level': str(sys.version_info[0])},)) + cython_directives = {'language_level': str(sys.version_info[0])},)) ext_modules = cythonize(ext_modules) -- cgit v1.2.3