Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

try to make cairo work with windoze??

safinsingh6c8a4754cc14
diff --git a/.travis.yml b/.travis.yml
index 0fe1f67a2..08ffb2986 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 000000000..9cde2b37c
--- /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 000000000..39a7643f0
--- /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 3e16ff633..000000000
--- 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