From 705b960f70725265e367ee02d8a7f933b18bf259 Mon Sep 17 00:00:00 2001 From: leotrs Date: Sun, 24 May 2020 11:59:46 -0400 Subject: [PATCH 01/36] setup Travis-CI by adding a .travis.yml file. Add pytest to requirements.txt. Add a couple of dummy tests for now. --- .travis.yml | 25 +++++++++++++++++++ requirements.txt | 1 + tests/test_imports.py | 2 ++ ...sample_scenes.py => test_sample_scenes.py} | 24 +++++++++++------- 4 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 .travis.yml create mode 100644 tests/test_imports.py rename tests/{tests_sample_scenes.py => test_sample_scenes.py} (85%) diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..86f6822a41 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +language: python + +python: + - "3.6" + - "3.7" + - "3.8" + +os: + - linux + - osx + - windows + +# command to install dependencies +install: + - pip install -r requirements.txt + - pip install . + +# command to run tests +script: + - pytest + +# branches that trigger Travis builds +branches: + only: + - travis-setup diff --git a/requirements.txt b/requirements.txt index 7dec25c9b3..45cea631f5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ pydub pygments pyreadline; sys_platform == 'win32', rich +pytest diff --git a/tests/test_imports.py b/tests/test_imports.py new file mode 100644 index 0000000000..4bb8824f36 --- /dev/null +++ b/tests/test_imports.py @@ -0,0 +1,2 @@ +def test_import(): + import manim.imports diff --git a/tests/tests_sample_scenes.py b/tests/test_sample_scenes.py similarity index 85% rename from tests/tests_sample_scenes.py rename to tests/test_sample_scenes.py index 438568822a..0cddf211a4 100644 --- a/tests/tests_sample_scenes.py +++ b/tests/test_sample_scenes.py @@ -1,13 +1,14 @@ from manim.imports import * -# This file is intended to test any new feature added. -# Feel free to add a test or to modify one when adding a new/changing a feature. -class Test(Scene): - def construct(self): +# This file is intended to test any new feature added. +# Feel free to add a test or to modify one when adding a new/changing a feature. +class BasicScene(Scene): + def construct(self): square = Square() self.play(ShowCreation(square)) - -class Test_geometry(Scene): + + +class GeometryScene(Scene): def construct(self): circle = Circle() square = Square() @@ -39,7 +40,8 @@ def construct(self): ) self.wait() -class Test_plotting(GraphScene): + +class PlottingScene(GraphScene): CONFIG = { "x_min" : -10, "x_max" : 10.3, @@ -49,8 +51,12 @@ class Test_plotting(GraphScene): "function_color" : RED , "axes_color" : GREEN, "x_labeled_nums" :range(-10,12,2), - } - def construct(self): + } + def construct(self): self.setup_axes(animate=False) func_graph = self.get_graph(lambda x : x**2, self.function_color) self.play(ShowCreation(func_graph)) + + +def test_scenes(): + BasicScene() From 67b88aa2092999ae054cfc6da7f5359a25e8aac0 Mon Sep 17 00:00:00 2001 From: leotrs Date: Sun, 24 May 2020 16:42:10 -0400 Subject: [PATCH 02/36] add pytest to setup --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4552d4c3cb..6c667faa71 100755 --- a/setup.py +++ b/setup.py @@ -25,6 +25,7 @@ "pydub", "pygments", "pyreadline; sys_platform == 'win32'", - "rich" + "rich", + "pytest" ], ) From da9d4a8ba19fe2ea1b0a4170e3fde561767a564f Mon Sep 17 00:00:00 2001 From: leotrs Date: Sun, 24 May 2020 16:48:50 -0400 Subject: [PATCH 03/36] fix: remove trailing comma --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 45cea631f5..23172f734b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,6 @@ opencv-python pycairo pydub pygments -pyreadline; sys_platform == 'win32', +pyreadline; sys_platform == 'win32' rich pytest From 6077328408629dd171fd343bc3e7c7223e0f0aca Mon Sep 17 00:00:00 2001 From: leotrs Date: Sun, 24 May 2020 16:53:24 -0400 Subject: [PATCH 04/36] Remove windows from the build matrix, as Travis-CI does not currently support python on windows --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 86f6822a41..14f3b206b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,8 @@ python: os: - linux - osx - - windows + # Travis-CI does not currently support python builds on windows + # - windows # command to install dependencies install: @@ -22,4 +23,4 @@ script: # branches that trigger Travis builds branches: only: - - travis-setup + - travis-setup From 032c0972163d9fefb0a7f2e89c198b91a9a9a37b Mon Sep 17 00:00:00 2001 From: leotrs Date: Sun, 24 May 2020 17:01:50 -0400 Subject: [PATCH 05/36] remove macOS from the build matrix as it is not currently supported by travis --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 14f3b206b7..5d985a51b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,10 @@ python: os: - linux - - osx - # Travis-CI does not currently support python builds on windows + + # Travis does not currently support python builds on windows or macos + # https://docs.travis-ci.com/user/languages/python/ + # - osx # - windows # command to install dependencies From ceb6a1dd95caeaa4d8ba81855fa4af9ffcd6deed Mon Sep 17 00:00:00 2001 From: leotrs Date: Sun, 24 May 2020 17:17:25 -0400 Subject: [PATCH 06/36] try a better build matrix --- .travis.yml | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5d985a51b4..834f88e667 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,33 @@ language: python +matrix: + include: + - os: linux + python: "3.6" -python: - - "3.6" - - "3.7" - - "3.8" + - os: linux + python: "3.7" + + - os: linux + python: "3.8" + + - os: osx + language: generic + python: "3.6" + env: PYVER="3.6.9" + + - os: osx + language: generic + python: "3.7" + env: PYVER="3.7.5" + + - os: osx + language: generic + python: "3.8" + env: PYVER="3.8.0" os: - linux + - osx # Travis does not currently support python builds on windows or macos # https://docs.travis-ci.com/user/languages/python/ @@ -15,6 +36,7 @@ os: # command to install dependencies install: + - pip install --upgrade pip - pip install -r requirements.txt - pip install . From 66d24c6b38c8fd5a0ecbb4f4868f2f02f415779d Mon Sep 17 00:00:00 2001 From: leotrs Date: Sun, 24 May 2020 17:25:07 -0400 Subject: [PATCH 07/36] keep trying on macOS --- .travis.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 834f88e667..fc7324b7c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,15 @@ -language: python matrix: include: - os: linux + language: python python: "3.6" - os: linux + language: python python: "3.7" - os: linux + language: python python: "3.8" - os: osx @@ -34,7 +36,21 @@ os: # - osx # - windows -# command to install dependencies +before_install: + - | + if [ "$TRAVIS_OS_NAME" == "osx" ]; then + brew update + brew install openssl readline + brew outdated pyenv || brew upgrade pyenv + brew install pyenv-virtualenv + pyenv install $PYVER + export PYENV_VERSION=$PYVER + export PATH="/Users/travis/.pyenv/shims:${PATH}" + pyenv virtualenv venv + source ~/.pyenv/versions/venv/bin/activate + python --version + fi + install: - pip install --upgrade pip - pip install -r requirements.txt From 3ec1bd7afb05821d2dbdf088f15220dbe5d1ea56 Mon Sep 17 00:00:00 2001 From: leotrs Date: Sun, 24 May 2020 17:36:27 -0400 Subject: [PATCH 08/36] fix the build matrix (the os section was triggering unnecessary builds). Also update to latest python versions --- .travis.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index fc7324b7c9..e956629b7f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,29 +12,24 @@ matrix: language: python python: "3.8" + # Travis does not currently support python builds on windows. For + # macOS, we need to do some magic (see before_install section). + # https://docs.travis-ci.com/user/languages/python/ - os: osx language: generic python: "3.6" - env: PYVER="3.6.9" + env: PYVER="3.6.10" - os: osx language: generic python: "3.7" - env: PYVER="3.7.5" + env: PYVER="3.7.7" - os: osx language: generic python: "3.8" - env: PYVER="3.8.0" + env: PYVER="3.8.3" -os: - - linux - - osx - - # Travis does not currently support python builds on windows or macos - # https://docs.travis-ci.com/user/languages/python/ - # - osx - # - windows before_install: - | From 60c9235f5f67bf86fc7fc30b19ff9636ae67d2af Mon Sep 17 00:00:00 2001 From: leotrs Date: Sun, 24 May 2020 17:56:48 -0400 Subject: [PATCH 09/36] fix: apparently, rich does not support python 3.8.3 yet, but it does support 3.8.0 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e956629b7f..8564057413 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ matrix: - os: osx language: generic python: "3.8" - env: PYVER="3.8.3" + env: PYVER="3.8.0" before_install: From 87068170ea3a030f0aa343c05683804a2912ebae Mon Sep 17 00:00:00 2001 From: safinsingh Date: Sun, 24 May 2020 15:28:52 -0700 Subject: [PATCH 10/36] Test new travis job matrix (with Windows too) --- .travis.yml | 103 ++++++++++++++++++++++----------------------- .travis/osx.sh | 12 ++++++ .travis/windows.sh | 4 ++ 3 files changed, 66 insertions(+), 53 deletions(-) create mode 100644 .travis/osx.sh create mode 100644 .travis/windows.sh diff --git a/.travis.yml b/.travis.yml index 8564057413..8425a5bd8a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,61 +1,58 @@ -matrix: - include: - - os: linux - language: python - python: "3.6" - - - os: linux - language: python - python: "3.7" - - - os: linux - language: python - python: "3.8" - - # Travis does not currently support python builds on windows. For - # macOS, we need to do some magic (see before_install section). - # https://docs.travis-ci.com/user/languages/python/ - - os: osx - language: generic - python: "3.6" - env: PYVER="3.6.10" - - - os: osx - language: generic - python: "3.7" - env: PYVER="3.7.7" - - - os: osx - language: generic - python: "3.8" - env: PYVER="3.8.0" - +language: python +python: + - "3.6" + - "3.7" + - "3.8" + +jobs: + include: + # Linux Jobs + - os: linux + language: python + python: 3.6 + - os: linux + language: python + python: 3.7 + - os: linux + language: python + python: 3.8 + + # MacOS (OSX) Jobs + - os: osx + language: sh + python: 3.6 + env: PYVER="3.6.10" + - os: osx + language: sh + python: 3.7 + env: PYVER="3.7.7" + - os: osx + language: sh + python: 3.8 + env: PYVER="3.8.2" + + # Windows Jobs + - os: windows + language: sh + python: 3.6 + env: PYVER=Python36 + - os: windows + language: sh + python: 3.7 + env: PYVER=Python37 + - os: windows + language: sh + python: 3.8 + env: PYVER=Python38 before_install: - - | - if [ "$TRAVIS_OS_NAME" == "osx" ]; then - brew update - brew install openssl readline - brew outdated pyenv || brew upgrade pyenv - brew install pyenv-virtualenv - pyenv install $PYVER - export PYENV_VERSION=$PYVER - export PATH="/Users/travis/.pyenv/shims:${PATH}" - pyenv virtualenv venv - source ~/.pyenv/versions/venv/bin/activate - python --version - fi - + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then chmod +x .travis/linux.sh; sh .travis/linux.sh; fi + - if [ "$TRAVIS_OS_NAME" == "windows" ]; then chmod +x .travis/windows.sh; sh .travis/windows.sh; fi + install: - pip install --upgrade pip - pip install -r requirements.txt - pip install . -# command to run tests script: - - pytest - -# branches that trigger Travis builds -branches: - only: - - travis-setup + - pytest \ No newline at end of file diff --git a/.travis/osx.sh b/.travis/osx.sh new file mode 100644 index 0000000000..1d3ec02b0f --- /dev/null +++ b/.travis/osx.sh @@ -0,0 +1,12 @@ +##### THIS IS FOR TRAVIS BUILDS, DO NOT RUN THIS ON YOUR COMPUTER! ##### + +brew update +brew install openssl readline +brew outdated pyenv || brew upgrade pyenv +brew install pyenv-virtualenv +pyenv install $PYVER +export PYENV_VERSION=$PYVER +export PATH="/Users/travis/.pyenv/shims:${PATH}" +pyenv virtualenv venv +source ~/.pyenv/versions/venv/bin/activate +python --version \ No newline at end of file diff --git a/.travis/windows.sh b/.travis/windows.sh new file mode 100644 index 0000000000..e726dfc10d --- /dev/null +++ b/.travis/windows.sh @@ -0,0 +1,4 @@ +##### THIS IS FOR TRAVIS BUILDS, DO NOT RUN THIS ON YOUR COMPUTER! ##### + +choco install python3 +export PATH="/c/$PYVER:/c/$PYVER/Scripts:$PATH" \ No newline at end of file From e4ecc2f4b0c992343a64831f2f250293649545ca Mon Sep 17 00:00:00 2001 From: safinsingh Date: Sun, 24 May 2020 15:30:51 -0700 Subject: [PATCH 11/36] use the right branch --- .travis.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8425a5bd8a..a2bc6ed9c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,15 +35,15 @@ jobs: - os: windows language: sh python: 3.6 - env: PYVER=Python36 + env: PYVER="Python36" - os: windows language: sh python: 3.7 - env: PYVER=Python37 + env: PYVER="Python37" - os: windows language: sh python: 3.8 - env: PYVER=Python38 + env: PYVER="Python38" before_install: - if [ "$TRAVIS_OS_NAME" == "osx" ]; then chmod +x .travis/linux.sh; sh .travis/linux.sh; fi @@ -55,4 +55,8 @@ install: - pip install . script: - - pytest \ No newline at end of file + - pytest + +branches: + only: + - travis-setup \ No newline at end of file From cda168a3b37adaaa784c1b19f527b3fb0b1f9c5f Mon Sep 17 00:00:00 2001 From: safinsingh Date: Sun, 24 May 2020 15:36:52 -0700 Subject: [PATCH 12/36] Rename linux to mac in build config --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a2bc6ed9c8..275ca3e380 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,8 +46,8 @@ jobs: env: PYVER="Python38" before_install: - - if [ "$TRAVIS_OS_NAME" == "osx" ]; then chmod +x .travis/linux.sh; sh .travis/linux.sh; fi - - if [ "$TRAVIS_OS_NAME" == "windows" ]; then chmod +x .travis/windows.sh; sh .travis/windows.sh; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then chmod +x ./.travis/osx.sh; sh ./.travis/osx.sh; fi + - if [ "$TRAVIS_OS_NAME" == "windows" ]; then chmod +x ./.travis/windows.sh; sh ./.travis/windows.sh; fi install: - pip install --upgrade pip From 786031ebbbf25b964a4df969d9e5e7b4faae77be Mon Sep 17 00:00:00 2001 From: safinsingh Date: Sun, 24 May 2020 15:46:45 -0700 Subject: [PATCH 13/36] Add refreshenv to windows --- .travis/windows.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis/windows.sh b/.travis/windows.sh index e726dfc10d..d39b226cbd 100644 --- a/.travis/windows.sh +++ b/.travis/windows.sh @@ -1,4 +1,5 @@ ##### THIS IS FOR TRAVIS BUILDS, DO NOT RUN THIS ON YOUR COMPUTER! ##### choco install python3 -export PATH="/c/$PYVER:/c/$PYVER/Scripts:$PATH" \ No newline at end of file +export PATH="/c/$PYVER:/c/$PYVER/Scripts:$PATH" +refreshenv \ No newline at end of file From cc5dd14e495e304622d100a0f49045b1f61975dc Mon Sep 17 00:00:00 2001 From: leotrs Date: Sun, 24 May 2020 18:54:10 -0400 Subject: [PATCH 14/36] try python version 3.8.0, as rich does not seem to support it --- .travis.yml | 6 +++--- .travis/windows.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 275ca3e380..058cd4be57 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ jobs: - os: osx language: sh python: 3.8 - env: PYVER="3.8.2" + env: PYVER="3.8.0" # Windows Jobs - os: windows @@ -48,7 +48,7 @@ jobs: before_install: - if [ "$TRAVIS_OS_NAME" == "osx" ]; then chmod +x ./.travis/osx.sh; sh ./.travis/osx.sh; fi - if [ "$TRAVIS_OS_NAME" == "windows" ]; then chmod +x ./.travis/windows.sh; sh ./.travis/windows.sh; fi - + install: - pip install --upgrade pip - pip install -r requirements.txt @@ -59,4 +59,4 @@ script: branches: only: - - travis-setup \ No newline at end of file + - travis-setup diff --git a/.travis/windows.sh b/.travis/windows.sh index d39b226cbd..972894ee3c 100644 --- a/.travis/windows.sh +++ b/.travis/windows.sh @@ -1,5 +1,5 @@ ##### THIS IS FOR TRAVIS BUILDS, DO NOT RUN THIS ON YOUR COMPUTER! ##### -choco install python3 +choco install python --version=3.8.0 export PATH="/c/$PYVER:/c/$PYVER/Scripts:$PATH" -refreshenv \ No newline at end of file +refreshenv From 2572a0145fce8cdec4fabbc93df99165d1aa5a2c Mon Sep 17 00:00:00 2001 From: leotrs Date: Sun, 24 May 2020 19:00:08 -0400 Subject: [PATCH 15/36] specify both the python version and the destination folder --- .travis.yml | 9 ++++++--- .travis/windows.sh | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 058cd4be57..7eee20a4bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,15 +35,18 @@ jobs: - os: windows language: sh python: 3.6 - env: PYVER="Python36" + env: PYVER="3.6.10" + env: PYDIR="Python36" - os: windows language: sh python: 3.7 - env: PYVER="Python37" + env: PYVER="3.7.7" + env: PYDIR="Python37" - os: windows language: sh python: 3.8 - env: PYVER="Python38" + env: PYVER="3.8.0" + env: PYDIR="Python38" before_install: - if [ "$TRAVIS_OS_NAME" == "osx" ]; then chmod +x ./.travis/osx.sh; sh ./.travis/osx.sh; fi diff --git a/.travis/windows.sh b/.travis/windows.sh index 972894ee3c..ce4ac4e0de 100644 --- a/.travis/windows.sh +++ b/.travis/windows.sh @@ -1,5 +1,5 @@ ##### THIS IS FOR TRAVIS BUILDS, DO NOT RUN THIS ON YOUR COMPUTER! ##### -choco install python --version=3.8.0 -export PATH="/c/$PYVER:/c/$PYVER/Scripts:$PATH" +choco install python --version=$PYVER +export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH" refreshenv From f7c7cefa1523d0a8a6ca3d9dc8e70257a17601f8 Mon Sep 17 00:00:00 2001 From: leotrs Date: Sun, 24 May 2020 19:02:05 -0400 Subject: [PATCH 16/36] travis environment variables go on the same line --- .travis.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7eee20a4bf..3838742741 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,18 +35,15 @@ jobs: - os: windows language: sh python: 3.6 - env: PYVER="3.6.10" - env: PYDIR="Python36" + env: PYVER="3.6.10" PYDIR="Python36" - os: windows language: sh python: 3.7 - env: PYVER="3.7.7" - env: PYDIR="Python37" + env: PYVER="3.7.7" PYDIR="Python37" - os: windows language: sh python: 3.8 - env: PYVER="3.8.0" - env: PYDIR="Python38" + env: PYVER="3.8.0" PYDIR="Python38" before_install: - if [ "$TRAVIS_OS_NAME" == "osx" ]; then chmod +x ./.travis/osx.sh; sh ./.travis/osx.sh; fi From f8fa8232947dae1e959881cc35deb63f991dc676 Mon Sep 17 00:00:00 2001 From: leotrs Date: Sun, 24 May 2020 19:18:58 -0400 Subject: [PATCH 17/36] try with pip3 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3838742741..f5f953addc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,9 +50,9 @@ before_install: - if [ "$TRAVIS_OS_NAME" == "windows" ]; then chmod +x ./.travis/windows.sh; sh ./.travis/windows.sh; fi install: - - pip install --upgrade pip - - pip install -r requirements.txt - - pip install . + - pip3 install --upgrade pip + - pip3 install -r requirements.txt + - pip3 install . script: - pytest From 409f7025c9e52d973cb55f751d7a218d589a1e35 Mon Sep 17 00:00:00 2001 From: leotrs Date: Sun, 24 May 2020 19:28:52 -0400 Subject: [PATCH 18/36] here goes nothing --- .travis.yml | 3 ++- .travis/windows.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f5f953addc..769e005129 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,8 @@ jobs: - os: windows language: sh python: 3.6 - env: PYVER="3.6.10" PYDIR="Python36" + # the latest version available on chocolatey is 3.6.8 + env: PYVER="3.6.8" PYDIR="Python36" - os: windows language: sh python: 3.7 diff --git a/.travis/windows.sh b/.travis/windows.sh index ce4ac4e0de..e562066314 100644 --- a/.travis/windows.sh +++ b/.travis/windows.sh @@ -2,4 +2,4 @@ choco install python --version=$PYVER export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH" -refreshenv +cmd.exe //c "RefreshEnv.cmd" From 2b69de104833ea4b32858ba0260af5970358efde Mon Sep 17 00:00:00 2001 From: Devin Neal Date: Sun, 24 May 2020 19:04:20 -0700 Subject: [PATCH 19/36] Try using pip from python --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 769e005129..c4f951e8ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,9 +51,9 @@ before_install: - if [ "$TRAVIS_OS_NAME" == "windows" ]; then chmod +x ./.travis/windows.sh; sh ./.travis/windows.sh; fi install: - - pip3 install --upgrade pip - - pip3 install -r requirements.txt - - pip3 install . + - python3 -m pip install --upgrade pip + - python3 -m pip install -r requirements.txt + - python3 -m pip install . script: - pytest From 8afc7d2aaf92f0bb0429dc77c3e9e5a74157e2e7 Mon Sep 17 00:00:00 2001 From: Devin Neal Date: Sun, 24 May 2020 19:19:12 -0700 Subject: [PATCH 20/36] It didn't work --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c4f951e8ca..769e005129 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,9 +51,9 @@ before_install: - if [ "$TRAVIS_OS_NAME" == "windows" ]; then chmod +x ./.travis/windows.sh; sh ./.travis/windows.sh; fi install: - - python3 -m pip install --upgrade pip - - python3 -m pip install -r requirements.txt - - python3 -m pip install . + - pip3 install --upgrade pip + - pip3 install -r requirements.txt + - pip3 install . script: - pytest From facbcaa04e476a7670c60c783b50c2d7c141fb5a Mon Sep 17 00:00:00 2001 From: safinsingh Date: Sun, 24 May 2020 21:04:28 -0700 Subject: [PATCH 21/36] update PATH --- .travis/windows.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis/windows.sh b/.travis/windows.sh index e562066314..56035d6305 100644 --- a/.travis/windows.sh +++ b/.travis/windows.sh @@ -3,3 +3,4 @@ choco install python --version=$PYVER export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH" cmd.exe //c "RefreshEnv.cmd" +exec $SHELL \ No newline at end of file From d28dfcab3b8c62eeb6162fcfcf365a7634669bc3 Mon Sep 17 00:00:00 2001 From: safinsingh Date: Sun, 24 May 2020 21:16:52 -0700 Subject: [PATCH 22/36] Add user option to pip --- .travis.yml | 7 +++++-- .travis/windows.sh | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 769e005129..ab93ab5fc4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,8 +52,8 @@ before_install: install: - pip3 install --upgrade pip - - pip3 install -r requirements.txt - - pip3 install . + - pip3 install --user -r requirements.txt + - pip3 install --user . script: - pytest @@ -61,3 +61,6 @@ script: branches: only: - travis-setup + +notifications: + email: false \ No newline at end of file diff --git a/.travis/windows.sh b/.travis/windows.sh index 56035d6305..d1f5da20a7 100644 --- a/.travis/windows.sh +++ b/.travis/windows.sh @@ -3,4 +3,4 @@ choco install python --version=$PYVER export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH" cmd.exe //c "RefreshEnv.cmd" -exec $SHELL \ No newline at end of file +python -m pip install --upgrade pip \ No newline at end of file From 791a67293379f80ac377ac4f0fb9848d68576109 Mon Sep 17 00:00:00 2001 From: safinsingh Date: Sun, 24 May 2020 21:21:19 -0700 Subject: [PATCH 23/36] Well that broke it --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ab93ab5fc4..0fe1f67a28 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,8 +52,8 @@ before_install: install: - pip3 install --upgrade pip - - pip3 install --user -r requirements.txt - - pip3 install --user . + - pip3 install -r requirements.txt + - pip3 install . script: - pytest From 2ce0ffac0332597cb94ebc80b72f4b7bf8d2b2f1 Mon Sep 17 00:00:00 2001 From: safinsingh Date: Sun, 24 May 2020 21:22:16 -0700 Subject: [PATCH 24/36] Add python -m on windows --- .travis/windows.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis/windows.sh b/.travis/windows.sh index d1f5da20a7..3e16ff633c 100644 --- a/.travis/windows.sh +++ b/.travis/windows.sh @@ -3,4 +3,6 @@ choco install python --version=$PYVER export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH" cmd.exe //c "RefreshEnv.cmd" -python -m pip install --upgrade pip \ No newline at end of file +python -m pip install --upgrade pip +python -m pip install --user -r requirements.txt +python -m pip install --user . \ No newline at end of file From 6c8a4754cc1493d8a8ff518521f5b5898b1a578f Mon Sep 17 00:00:00 2001 From: safinsingh Date: Sun, 24 May 2020 21:38:19 -0700 Subject: [PATCH 25/36] try to make cairo work with windoze?? --- .travis.yml | 52 +++++++++++++++++++++++++++++---- .travis/cairo-windows.py | 51 ++++++++++++++++++++++++++++++++ .travis/travis-requirements.txt | 14 +++++++++ .travis/windows.sh | 8 ----- 4 files changed, 111 insertions(+), 14 deletions(-) create mode 100644 .travis/cairo-windows.py create mode 100644 .travis/travis-requirements.txt delete mode 100644 .travis/windows.sh diff --git a/.travis.yml b/.travis.yml index 0fe1f67a28..08ffb29861 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,26 +10,56 @@ jobs: - os: linux language: python python: 3.6 + install: + - pip3 install --upgrade pip + - pip3 install -r ./.travis/travis-requirements.txt + - pip3 install pycairo + - pip3 install . - os: linux language: python python: 3.7 + install: + - pip3 install --upgrade pip + - pip3 install -r ./.travis/travis-requirements.txt + - pip3 install pycairo + - pip3 install . - os: linux language: python python: 3.8 + install: + - pip3 install --upgrade pip + - pip3 install -r ./.travis/travis-requirements.txt + - pip3 install pycairo + - pip3 install . # MacOS (OSX) Jobs - os: osx language: sh python: 3.6 env: PYVER="3.6.10" + install: + - pip3 install --upgrade pip + - pip3 install -r ./.travis/travis-requirements.txt + - pip3 install pycairo + - pip3 install . - os: osx language: sh python: 3.7 env: PYVER="3.7.7" + install: + - pip3 install --upgrade pip + - pip3 install -r ./.travis/travis-requirements.txt + - pip3 install pycairo + - pip3 install . - os: osx language: sh python: 3.8 env: PYVER="3.8.0" + install: + - pip3 install --upgrade pip + - pip3 install -r ./.travis/travis-requirements.txt + - pip3 install pycairo + - pip3 install . # Windows Jobs - os: windows @@ -37,23 +67,33 @@ jobs: python: 3.6 # the latest version available on chocolatey is 3.6.8 env: PYVER="3.6.8" PYDIR="Python36" + install: + - choco install python --version=$PYVER + - export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH" + - cmd.exe //c "RefreshEnv.cmd" + - python -m pip install --upgrade pip + - python -m pip install --user -r ./.travis/travis-requirements.txt + - python ./.travis/cairo-windows.py + - python -m pip install --user . - os: windows language: sh python: 3.7 env: PYVER="3.7.7" PYDIR="Python37" + install: + - pip3 install --upgrade pip + - pip3 install -r ./.travis/travis-requirements.txt + - pip3 install . - os: windows language: sh python: 3.8 env: PYVER="3.8.0" PYDIR="Python38" + install: + - pip3 install --upgrade pip + - pip3 install -r ./.travis/travis-requirements.txt + - pip3 install . before_install: - if [ "$TRAVIS_OS_NAME" == "osx" ]; then chmod +x ./.travis/osx.sh; sh ./.travis/osx.sh; fi - - if [ "$TRAVIS_OS_NAME" == "windows" ]; then chmod +x ./.travis/windows.sh; sh ./.travis/windows.sh; fi - -install: - - pip3 install --upgrade pip - - pip3 install -r requirements.txt - - pip3 install . script: - pytest diff --git a/.travis/cairo-windows.py b/.travis/cairo-windows.py new file mode 100644 index 0000000000..9cde2b37cd --- /dev/null +++ b/.travis/cairo-windows.py @@ -0,0 +1,51 @@ +import platform +import os +import sys +import urllib.request + +if 'Windows' in platform.system(): + #In case the python version is 3.6 and the system is 32-bit, try pycairo‑1.19.1‑cp37‑cp37m‑win32.whl version of cairo + if sys.version[:3]=='3.6' and platform.machine()=='x86': + urllib.request.urlretrieve("https://download.lfd.uci.edu/pythonlibs/s2jqpv5t/pycairo-1.19.1-cp36-cp36m-win32.whl", "pycairo-1.19.1-cp36-cp36m-win32.whl") + os.system("pip install pycairo-1.19.1-cp36-cp36m-win32.whl") + os.remove("pycairo-1.19.1-cp37-cp37m-win32.whl") + + #In case the python version is 3.6 and the system is 64-bit, try pycairo‑1.19.1‑cp37‑cp37m‑win32.whl version of cairo + elif sys.version[:3]=='3.6' and platform.machine()=='AMD64': + urllib.request.urlretrieve("https://download.lfd.uci.edu/pythonlibs/s2jqpv5t/pycairo-1.19.1-cp36-cp36m-win_amd64.whl", "pycairo-1.19.1-cp36-cp36m-win_amd64.whl") + print("Sucessfully downloaded Cairo for your system") + print("Installing Cairo") + os.system("pip install pycairo-1.19.1-cp36-cp36m-win_amd64.whl") + os.remove("pycairo-1.19.1-cp36-cp36m-win_amd64.whl") + + #In case the python version is 3.7 and the system is 32-bit, try pycairo‑1.19.1‑cp37‑cp37m‑win32.whl version of cairo + if sys.version[:3]=='3.7' and platform.machine()=='x86': + urllib.request.urlretrieve("https://download.lfd.uci.edu/pythonlibs/s2jqpv5t/pycairo-1.19.1-cp37-cp37m-win32.whl", "pycairo-1.19.1-cp37-cp37m-win32.whl") + print("Sucessfully downloaded Cairo for your system") + print("Installing Cairo") + os.system("pip install pycairo-1.19.1-cp37-cp37m-win32.whl") + os.remove("pycairo-1.19.1-cp37-cp37m-win32.whl") + + #In case the python version is 3.7 and the system is AMD64, try pycairo-1.19.1-cp37-cp37m-win_amd64.whl version of cairo + elif sys.version[:3]=='3.7' and platform.machine()=='AMD64': + urllib.request.urlretrieve("https://download.lfd.uci.edu/pythonlibs/s2jqpv5t/pycairo-1.19.1-cp37-cp37m-win_amd64.whl", "pycairo-1.19.1-cp37-cp37m-win_amd64.whl") + print("Sucessfully downloaded Cairo for your system") + print("Installing Cairo") + os.system("pip install pycairo-1.19.1-cp37-cp37m-win_amd64.whl") + os.remove("pycairo-1.19.1-cp37-cp37m-win_amd64.whl") + + #In case the python version is 3.8 and the system is 32-bit, try pycairo-1.19.1-cp38-cp38-win32.whl version of cairo + elif sys.version[:3]=='3.8' and platform.machine()=='x86': + urllib.request.urlretrieve("https://download.lfd.uci.edu/pythonlibs/s2jqpv5t/pycairo-1.19.1-cp38-cp38-win32.whl", "pycairo-1.19.1-cp38-cp38-win32.whl") + print("Sucessfully downloaded Cairo for your system") + print("Installing Cairo") + os.system("pip install pycairo-1.19.1-cp38-cp38-win32.whl") + os.remove("pycairo-1.19.1-cp38-cp38-win32.whl") + + #In case the python version is 3.8 and the system is AMD64, try pycairo-1.19.1-cp38-cp38-win_amd64.whl version of cairo + elif sys.version[:3]=='3.8' and platform.machine()=='AMD64': + urllib.request.urlretrieve("https://download.lfd.uci.edu/pythonlibs/s2jqpv5t/pycairo-1.19.1-cp38-cp38-win_amd64.whl", "pycairo-1.19.1-cp38-cp38-win_amd64.whl") + print("Sucessfully downloaded Cairo for your system") + print("Installing Cairo") + os.system("pip install pycairo-1.19.1-cp38-cp38-win_amd64.whl") + os.remove("pycairo-1.19.1-cp38-cp38-win_amd64.whl") \ No newline at end of file diff --git a/.travis/travis-requirements.txt b/.travis/travis-requirements.txt new file mode 100644 index 0000000000..39a7643f00 --- /dev/null +++ b/.travis/travis-requirements.txt @@ -0,0 +1,14 @@ +argparse +colour +numpy +Pillow +progressbar +scipy +tqdm +opencv-python +#pycairo +pydub +pygments +pyreadline; sys_platform == 'win32' +rich +pytest \ No newline at end of file diff --git a/.travis/windows.sh b/.travis/windows.sh deleted file mode 100644 index 3e16ff633c..0000000000 --- a/.travis/windows.sh +++ /dev/null @@ -1,8 +0,0 @@ -##### THIS IS FOR TRAVIS BUILDS, DO NOT RUN THIS ON YOUR COMPUTER! ##### - -choco install python --version=$PYVER -export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH" -cmd.exe //c "RefreshEnv.cmd" -python -m pip install --upgrade pip -python -m pip install --user -r requirements.txt -python -m pip install --user . \ No newline at end of file From 44b200f5e195f142500d9b1b3c37370b8da343e6 Mon Sep 17 00:00:00 2001 From: safinsingh Date: Sun, 24 May 2020 21:41:09 -0700 Subject: [PATCH 26/36] Clarify lines and fix windows installs --- .travis.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 08ffb29861..c4208a8529 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ jobs: - pip3 install -r ./.travis/travis-requirements.txt - pip3 install pycairo - pip3 install . + - os: linux language: python python: 3.7 @@ -23,6 +24,7 @@ jobs: - pip3 install -r ./.travis/travis-requirements.txt - pip3 install pycairo - pip3 install . + - os: linux language: python python: 3.8 @@ -42,6 +44,7 @@ jobs: - pip3 install -r ./.travis/travis-requirements.txt - pip3 install pycairo - pip3 install . + - os: osx language: sh python: 3.7 @@ -51,6 +54,7 @@ jobs: - pip3 install -r ./.travis/travis-requirements.txt - pip3 install pycairo - pip3 install . + - os: osx language: sh python: 3.8 @@ -75,22 +79,32 @@ jobs: - python -m pip install --user -r ./.travis/travis-requirements.txt - python ./.travis/cairo-windows.py - python -m pip install --user . + - os: windows language: sh python: 3.7 env: PYVER="3.7.7" PYDIR="Python37" install: - - pip3 install --upgrade pip - - pip3 install -r ./.travis/travis-requirements.txt - - pip3 install . + - choco install python --version=$PYVER + - export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH" + - cmd.exe //c "RefreshEnv.cmd" + - python -m pip install --upgrade pip + - python -m pip install --user -r ./.travis/travis-requirements.txt + - python ./.travis/cairo-windows.py + - python -m pip install --user . + - os: windows language: sh python: 3.8 env: PYVER="3.8.0" PYDIR="Python38" install: - - pip3 install --upgrade pip - - pip3 install -r ./.travis/travis-requirements.txt - - pip3 install . + - choco install python --version=$PYVER + - export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH" + - cmd.exe //c "RefreshEnv.cmd" + - python -m pip install --upgrade pip + - python -m pip install --user -r ./.travis/travis-requirements.txt + - python ./.travis/cairo-windows.py + - python -m pip install --user . before_install: - if [ "$TRAVIS_OS_NAME" == "osx" ]; then chmod +x ./.travis/osx.sh; sh ./.travis/osx.sh; fi From 4338520c16f67911c9d402afba7ea56100b83a36 Mon Sep 17 00:00:00 2001 From: safinsingh Date: Sun, 24 May 2020 21:42:06 -0700 Subject: [PATCH 27/36] Remove double build --- .travis.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index c4208a8529..68efc01e53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,3 @@ -language: python -python: - - "3.6" - - "3.7" - - "3.8" - jobs: include: # Linux Jobs @@ -92,7 +86,7 @@ jobs: - python -m pip install --user -r ./.travis/travis-requirements.txt - python ./.travis/cairo-windows.py - python -m pip install --user . - + - os: windows language: sh python: 3.8 From e08c1c8e2b778586626a8175963b84c42f00dcc3 Mon Sep 17 00:00:00 2001 From: safinsingh Date: Sun, 24 May 2020 21:46:43 -0700 Subject: [PATCH 28/36] Refresh env vars after pytest install (win) --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 68efc01e53..28f2f18fc2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -72,6 +72,7 @@ jobs: - python -m pip install --upgrade pip - python -m pip install --user -r ./.travis/travis-requirements.txt - python ./.travis/cairo-windows.py + - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --user . - os: windows @@ -85,6 +86,7 @@ jobs: - python -m pip install --upgrade pip - python -m pip install --user -r ./.travis/travis-requirements.txt - python ./.travis/cairo-windows.py + - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --user . - os: windows @@ -98,6 +100,7 @@ jobs: - python -m pip install --upgrade pip - python -m pip install --user -r ./.travis/travis-requirements.txt - python ./.travis/cairo-windows.py + - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --user . before_install: From f9bb278d410aac76f5c10679baac26655d692541 Mon Sep 17 00:00:00 2001 From: safinsingh Date: Mon, 25 May 2020 10:05:43 -0700 Subject: [PATCH 29/36] Add python -m for windows pytest --- .travis.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 28f2f18fc2..479eb9a728 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,8 @@ jobs: - pip3 install -r ./.travis/travis-requirements.txt - pip3 install pycairo - pip3 install . + script: + - pytest - os: linux language: python @@ -18,6 +20,8 @@ jobs: - pip3 install -r ./.travis/travis-requirements.txt - pip3 install pycairo - pip3 install . + script: + - pytest - os: linux language: python @@ -27,6 +31,8 @@ jobs: - pip3 install -r ./.travis/travis-requirements.txt - pip3 install pycairo - pip3 install . + script: + - pytest # MacOS (OSX) Jobs - os: osx @@ -38,6 +44,8 @@ jobs: - pip3 install -r ./.travis/travis-requirements.txt - pip3 install pycairo - pip3 install . + script: + - pytest - os: osx language: sh @@ -48,6 +56,8 @@ jobs: - pip3 install -r ./.travis/travis-requirements.txt - pip3 install pycairo - pip3 install . + script: + - pytest - os: osx language: sh @@ -58,6 +68,8 @@ jobs: - pip3 install -r ./.travis/travis-requirements.txt - pip3 install pycairo - pip3 install . + script: + - pytest # Windows Jobs - os: windows @@ -74,6 +86,8 @@ jobs: - python ./.travis/cairo-windows.py - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --user . + script: + - python -m pytest - os: windows language: sh @@ -88,6 +102,8 @@ jobs: - python ./.travis/cairo-windows.py - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --user . + script: + - python -m pytest - os: windows language: sh @@ -102,13 +118,12 @@ jobs: - python ./.travis/cairo-windows.py - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --user . + script: + - python -m pytest before_install: - if [ "$TRAVIS_OS_NAME" == "osx" ]; then chmod +x ./.travis/osx.sh; sh ./.travis/osx.sh; fi -script: - - pytest - branches: only: - travis-setup From 7221634a3e6929e6605b8d04154e91af9cf6b59c Mon Sep 17 00:00:00 2001 From: safinsingh Date: Mon, 25 May 2020 10:19:21 -0700 Subject: [PATCH 30/36] Try to fix opencv + ffmpeg on win --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 479eb9a728..0413c771d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -80,9 +80,11 @@ jobs: install: - choco install python --version=$PYVER - export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH" + - choco install ffmpeg - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --upgrade pip - python -m pip install --user -r ./.travis/travis-requirements.txt + - python -m pip install opencv-contrib-python - python ./.travis/cairo-windows.py - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --user . @@ -96,9 +98,11 @@ jobs: install: - choco install python --version=$PYVER - export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH" + - choco install ffmpeg - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --upgrade pip - python -m pip install --user -r ./.travis/travis-requirements.txt + - python -m pip install opencv-contrib-python - python ./.travis/cairo-windows.py - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --user . @@ -112,9 +116,11 @@ jobs: install: - choco install python --version=$PYVER - export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH" + - choco install ffmpeg - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --upgrade pip - python -m pip install --user -r ./.travis/travis-requirements.txt + - python -m pip install opencv-contrib-python - python ./.travis/cairo-windows.py - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --user . From 3c0643af14ab7c71145c53bae57d0e4086f0f25e Mon Sep 17 00:00:00 2001 From: safinsingh Date: Mon, 25 May 2020 10:50:53 -0700 Subject: [PATCH 31/36] Remove OpenCV completely --- .travis.yml | 3 -- .travis/travis-requirements.txt | 4 +- manim/imports.py | 2 +- manim/scene/scene_from_video.py | 94 ++++++++++++++++----------------- requirements.txt | 2 +- 5 files changed, 51 insertions(+), 54 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0413c771d3..7e13ea35c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -84,7 +84,6 @@ jobs: - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --upgrade pip - python -m pip install --user -r ./.travis/travis-requirements.txt - - python -m pip install opencv-contrib-python - python ./.travis/cairo-windows.py - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --user . @@ -102,7 +101,6 @@ jobs: - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --upgrade pip - python -m pip install --user -r ./.travis/travis-requirements.txt - - python -m pip install opencv-contrib-python - python ./.travis/cairo-windows.py - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --user . @@ -120,7 +118,6 @@ jobs: - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --upgrade pip - python -m pip install --user -r ./.travis/travis-requirements.txt - - python -m pip install opencv-contrib-python - python ./.travis/cairo-windows.py - cmd.exe //c "RefreshEnv.cmd" - python -m pip install --user . diff --git a/.travis/travis-requirements.txt b/.travis/travis-requirements.txt index 39a7643f00..e51d737699 100644 --- a/.travis/travis-requirements.txt +++ b/.travis/travis-requirements.txt @@ -5,8 +5,8 @@ Pillow progressbar scipy tqdm -opencv-python -#pycairo +# opencv-python +# pycairo pydub pygments pyreadline; sys_platform == 'win32' diff --git a/manim/imports.py b/manim/imports.py index 72b9cb2128..69f990468b 100644 --- a/manim/imports.py +++ b/manim/imports.py @@ -66,7 +66,7 @@ from .scene.scene import * from .scene.sample_space_scene import * from .scene.graph_scene import * -from .scene.scene_from_video import * +# from .scene.scene_from_video import * from .scene.three_d_scene import * from .scene.vector_space_scene import * from .scene.zoomed_scene import * diff --git a/manim/scene/scene_from_video.py b/manim/scene/scene_from_video.py index 170c6f0162..1e21251407 100644 --- a/manim/scene/scene_from_video.py +++ b/manim/scene/scene_from_video.py @@ -1,54 +1,54 @@ -from tqdm import tqdm as show_progress -import cv2 +# from tqdm import tqdm as show_progress +# import cv2 -from ..scene.scene import Scene -from ..logger import logger +# from ..scene.scene import Scene +# from ..logger import logger -# TODO, is this depricated? -class SceneFromVideo(Scene): - def construct(self, file_name, - freeze_last_frame=True, - time_range=None): - cap = cv2.VideoCapture(file_name) - self.shape = ( - int(cap.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)), - int(cap.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH)) - ) - fps = cap.get(cv2.cv.CV_CAP_PROP_FPS) - self.camera.frame_rate = fps - frame_count = int(cap.get(cv2.cv.CV_CAP_PROP_FRAME_COUNT)) - if time_range is None: - start_frame = 0 - end_frame = frame_count - else: - start_frame, end_frame = [fps * t for t in time_range] +# # TODO, is this depricated? +# class SceneFromVideo(Scene): +# def construct(self, file_name, +# freeze_last_frame=True, +# time_range=None): +# cap = cv2.VideoCapture(file_name) +# self.shape = ( +# int(cap.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)), +# int(cap.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH)) +# ) +# fps = cap.get(cv2.cv.CV_CAP_PROP_FPS) +# self.camera.frame_rate = fps +# frame_count = int(cap.get(cv2.cv.CV_CAP_PROP_FRAME_COUNT)) +# if time_range is None: +# start_frame = 0 +# end_frame = frame_count +# else: +# start_frame, end_frame = [fps * t for t in time_range] - frame_count = end_frame - start_frame - logger.info("Reading in " + file_name + "...") - for count in show_progress(list(range(start_frame, end_frame + 1))): - returned, frame = cap.read() - if not returned: - break - # b, g, r = cv2.split(frame) - # self.frames.append(cv2.merge([r, g, b])) - self.frames.append(frame) - cap.release() +# frame_count = end_frame - start_frame +# logger.info("Reading in " + file_name + "...") +# for count in show_progress(list(range(start_frame, end_frame + 1))): +# returned, frame = cap.read() +# if not returned: +# break +# # b, g, r = cv2.split(frame) +# # self.frames.append(cv2.merge([r, g, b])) +# self.frames.append(frame) +# cap.release() - if freeze_last_frame and len(self.frames) > 0: - self.original_background = self.background = self.frames[-1] +# if freeze_last_frame and len(self.frames) > 0: +# self.original_background = self.background = self.frames[-1] - def apply_gaussian_blur(self, ksize=(5, 5), sigmaX=5): - self.frames = [ - cv2.GaussianBlur(frame, ksize, sigmaX) - for frame in self.frames - ] +# def apply_gaussian_blur(self, ksize=(5, 5), sigmaX=5): +# self.frames = [ +# cv2.GaussianBlur(frame, ksize, sigmaX) +# for frame in self.frames +# ] - def apply_edge_detection(self, threshold1=50, threshold2=100): - edged_frames = [ - cv2.Canny(frame, threshold1, threshold2) - for frame in self.frames - ] - for index in range(len(self.frames)): - for i in range(3): - self.frames[index][:, :, i] = edged_frames[index] \ No newline at end of file +# def apply_edge_detection(self, threshold1=50, threshold2=100): +# edged_frames = [ +# cv2.Canny(frame, threshold1, threshold2) +# for frame in self.frames +# ] +# for index in range(len(self.frames)): +# for i in range(3): +# self.frames[index][:, :, i] = edged_frames[index] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 23172f734b..fdf2042f58 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ Pillow progressbar scipy tqdm -opencv-python +# opencv-python pycairo pydub pygments From e9b02b3652e710032591150d967c274bbe867560 Mon Sep 17 00:00:00 2001 From: safinsingh Date: Mon, 25 May 2020 11:05:20 -0700 Subject: [PATCH 32/36] Remove .imports --- logo/logo.py | 2 +- tests/test_sample_scenes.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/logo/logo.py b/logo/logo.py index 41bb7e3930..a4b485fc47 100644 --- a/logo/logo.py +++ b/logo/logo.py @@ -1,4 +1,4 @@ -from manim.imports import * +from manim import * NEW_BLUE = "#68a8e1" diff --git a/tests/test_sample_scenes.py b/tests/test_sample_scenes.py index 0cddf211a4..af2c318a91 100644 --- a/tests/test_sample_scenes.py +++ b/tests/test_sample_scenes.py @@ -1,4 +1,4 @@ -from manim.imports import * +from manim import * # This file is intended to test any new feature added. # Feel free to add a test or to modify one when adding a new/changing a feature. From acbd4eb9230d5c08127e9a14581f8d11eb058205 Mon Sep 17 00:00:00 2001 From: safinsingh Date: Mon, 25 May 2020 11:08:04 -0700 Subject: [PATCH 33/36] One more import --- tests/test_imports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_imports.py b/tests/test_imports.py index 4bb8824f36..55ed89a48a 100644 --- a/tests/test_imports.py +++ b/tests/test_imports.py @@ -1,2 +1,2 @@ def test_import(): - import manim.imports + import manim From ab9ac29f3be1287d6e6c9ff39d2fbf29e838ce0c Mon Sep 17 00:00:00 2001 From: safinsingh Date: Mon, 25 May 2020 11:16:14 -0700 Subject: [PATCH 34/36] Add build badge to readme [skip ci] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e0f4f8fa68..dfa75f45bc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![logo](logo/cropped.png) -[![Build Status](https://travis-ci.org/3b1b/manim.svg?branch=master)](https://travis-ci.org/3b1b/manim) +[![Build Status](https://travis-ci.com/ManimCommunity/manim.svg?branch=master)](https://travis-ci.com/ManimCommunity/manim) [![Documentation](https://img.shields.io/badge/docs-EulerTour-blue.svg)](https://www.eulertour.com/docs) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://choosealicense.com/licenses/mit/) [![Manim Subreddit](https://img.shields.io/reddit/subreddit-subscribers/manim.svg?color=ff4301&label=reddit)](https://www.reddit.com/r/manim/) From 963d66eb4ddec0169e155db68014a19421c94865 Mon Sep 17 00:00:00 2001 From: safinsingh Date: Mon, 25 May 2020 12:04:02 -0700 Subject: [PATCH 35/36] Housekeeping & pytest dev-only req [skip-ci] --- .travis.yml | 18 +++++++++--------- requirements.txt | 2 +- setup.py | 1 - 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7e13ea35c8..3d23e1bbe5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ jobs: install: - pip3 install --upgrade pip - pip3 install -r ./.travis/travis-requirements.txt - - pip3 install pycairo + - pip3 install pycairo pytest - pip3 install . script: - pytest @@ -18,7 +18,7 @@ jobs: install: - pip3 install --upgrade pip - pip3 install -r ./.travis/travis-requirements.txt - - pip3 install pycairo + - pip3 install pycairo pytest - pip3 install . script: - pytest @@ -29,7 +29,7 @@ jobs: install: - pip3 install --upgrade pip - pip3 install -r ./.travis/travis-requirements.txt - - pip3 install pycairo + - pip3 install pycairo pytest - pip3 install . script: - pytest @@ -42,7 +42,7 @@ jobs: install: - pip3 install --upgrade pip - pip3 install -r ./.travis/travis-requirements.txt - - pip3 install pycairo + - pip3 install pycairo pytest - pip3 install . script: - pytest @@ -54,7 +54,7 @@ jobs: install: - pip3 install --upgrade pip - pip3 install -r ./.travis/travis-requirements.txt - - pip3 install pycairo + - pip3 install pycairo pytest - pip3 install . script: - pytest @@ -62,11 +62,11 @@ jobs: - os: osx language: sh python: 3.8 - env: PYVER="3.8.0" + env: PYVER="3.8.0" # Using Python 3.8.0 due to error with rich install: - pip3 install --upgrade pip - pip3 install -r ./.travis/travis-requirements.txt - - pip3 install pycairo + - pip3 install pycairo pytest - pip3 install . script: - pytest @@ -110,7 +110,7 @@ jobs: - os: windows language: sh python: 3.8 - env: PYVER="3.8.0" PYDIR="Python38" + env: PYVER="3.8.0" PYDIR="Python38" # Using Python 3.8.0 due to error with rich install: - choco install python --version=$PYVER - export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH" @@ -132,4 +132,4 @@ branches: - travis-setup notifications: - email: false \ No newline at end of file + email: false diff --git a/requirements.txt b/requirements.txt index fdf2042f58..4221c80dc5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,4 +11,4 @@ pydub pygments pyreadline; sys_platform == 'win32' rich -pytest +# pytest (for development only) diff --git a/setup.py b/setup.py index 42d65f9c85..15a0c90a3a 100755 --- a/setup.py +++ b/setup.py @@ -27,6 +27,5 @@ "pygments", "pyreadline; sys_platform == 'win32'", "rich", - "pytest" ], ) From af53017f3ec39b51cc3931226527cf3c0b03dd4e Mon Sep 17 00:00:00 2001 From: safinsingh Date: Mon, 25 May 2020 12:05:16 -0700 Subject: [PATCH 36/36] Test master [skip ci] --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3d23e1bbe5..19b2fa691c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -129,7 +129,7 @@ before_install: branches: only: - - travis-setup + - master notifications: email: false