Skip to content

Commit 1591d15

Browse files
authored
Merge pull request #86 from ManimCommunity/travis-setup
Travis setup
2 parents 5874cb8 + af53017 commit 1591d15

11 files changed

+282
-61
lines changed

.travis.yml

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
jobs:
2+
include:
3+
# Linux Jobs
4+
- os: linux
5+
language: python
6+
python: 3.6
7+
install:
8+
- pip3 install --upgrade pip
9+
- pip3 install -r ./.travis/travis-requirements.txt
10+
- pip3 install pycairo pytest
11+
- pip3 install .
12+
script:
13+
- pytest
14+
15+
- os: linux
16+
language: python
17+
python: 3.7
18+
install:
19+
- pip3 install --upgrade pip
20+
- pip3 install -r ./.travis/travis-requirements.txt
21+
- pip3 install pycairo pytest
22+
- pip3 install .
23+
script:
24+
- pytest
25+
26+
- os: linux
27+
language: python
28+
python: 3.8
29+
install:
30+
- pip3 install --upgrade pip
31+
- pip3 install -r ./.travis/travis-requirements.txt
32+
- pip3 install pycairo pytest
33+
- pip3 install .
34+
script:
35+
- pytest
36+
37+
# MacOS (OSX) Jobs
38+
- os: osx
39+
language: sh
40+
python: 3.6
41+
env: PYVER="3.6.10"
42+
install:
43+
- pip3 install --upgrade pip
44+
- pip3 install -r ./.travis/travis-requirements.txt
45+
- pip3 install pycairo pytest
46+
- pip3 install .
47+
script:
48+
- pytest
49+
50+
- os: osx
51+
language: sh
52+
python: 3.7
53+
env: PYVER="3.7.7"
54+
install:
55+
- pip3 install --upgrade pip
56+
- pip3 install -r ./.travis/travis-requirements.txt
57+
- pip3 install pycairo pytest
58+
- pip3 install .
59+
script:
60+
- pytest
61+
62+
- os: osx
63+
language: sh
64+
python: 3.8
65+
env: PYVER="3.8.0" # Using Python 3.8.0 due to error with rich
66+
install:
67+
- pip3 install --upgrade pip
68+
- pip3 install -r ./.travis/travis-requirements.txt
69+
- pip3 install pycairo pytest
70+
- pip3 install .
71+
script:
72+
- pytest
73+
74+
# Windows Jobs
75+
- os: windows
76+
language: sh
77+
python: 3.6
78+
# the latest version available on chocolatey is 3.6.8
79+
env: PYVER="3.6.8" PYDIR="Python36"
80+
install:
81+
- choco install python --version=$PYVER
82+
- export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH"
83+
- choco install ffmpeg
84+
- cmd.exe //c "RefreshEnv.cmd"
85+
- python -m pip install --upgrade pip
86+
- python -m pip install --user -r ./.travis/travis-requirements.txt
87+
- python ./.travis/cairo-windows.py
88+
- cmd.exe //c "RefreshEnv.cmd"
89+
- python -m pip install --user .
90+
script:
91+
- python -m pytest
92+
93+
- os: windows
94+
language: sh
95+
python: 3.7
96+
env: PYVER="3.7.7" PYDIR="Python37"
97+
install:
98+
- choco install python --version=$PYVER
99+
- export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH"
100+
- choco install ffmpeg
101+
- cmd.exe //c "RefreshEnv.cmd"
102+
- python -m pip install --upgrade pip
103+
- python -m pip install --user -r ./.travis/travis-requirements.txt
104+
- python ./.travis/cairo-windows.py
105+
- cmd.exe //c "RefreshEnv.cmd"
106+
- python -m pip install --user .
107+
script:
108+
- python -m pytest
109+
110+
- os: windows
111+
language: sh
112+
python: 3.8
113+
env: PYVER="3.8.0" PYDIR="Python38" # Using Python 3.8.0 due to error with rich
114+
install:
115+
- choco install python --version=$PYVER
116+
- export PATH="/c/$PYDIR:/c/$PYDIR/Scripts:$PATH"
117+
- choco install ffmpeg
118+
- cmd.exe //c "RefreshEnv.cmd"
119+
- python -m pip install --upgrade pip
120+
- python -m pip install --user -r ./.travis/travis-requirements.txt
121+
- python ./.travis/cairo-windows.py
122+
- cmd.exe //c "RefreshEnv.cmd"
123+
- python -m pip install --user .
124+
script:
125+
- python -m pytest
126+
127+
before_install:
128+
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then chmod +x ./.travis/osx.sh; sh ./.travis/osx.sh; fi
129+
130+
branches:
131+
only:
132+
- master
133+
134+
notifications:
135+
email: false

.travis/cairo-windows.py

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import platform
2+
import os
3+
import sys
4+
import urllib.request
5+
6+
if 'Windows' in platform.system():
7+
#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
8+
if sys.version[:3]=='3.6' and platform.machine()=='x86':
9+
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")
10+
os.system("pip install pycairo-1.19.1-cp36-cp36m-win32.whl")
11+
os.remove("pycairo-1.19.1-cp37-cp37m-win32.whl")
12+
13+
#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
14+
elif sys.version[:3]=='3.6' and platform.machine()=='AMD64':
15+
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")
16+
print("Sucessfully downloaded Cairo for your system")
17+
print("Installing Cairo")
18+
os.system("pip install pycairo-1.19.1-cp36-cp36m-win_amd64.whl")
19+
os.remove("pycairo-1.19.1-cp36-cp36m-win_amd64.whl")
20+
21+
#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
22+
if sys.version[:3]=='3.7' and platform.machine()=='x86':
23+
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")
24+
print("Sucessfully downloaded Cairo for your system")
25+
print("Installing Cairo")
26+
os.system("pip install pycairo-1.19.1-cp37-cp37m-win32.whl")
27+
os.remove("pycairo-1.19.1-cp37-cp37m-win32.whl")
28+
29+
#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
30+
elif sys.version[:3]=='3.7' and platform.machine()=='AMD64':
31+
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")
32+
print("Sucessfully downloaded Cairo for your system")
33+
print("Installing Cairo")
34+
os.system("pip install pycairo-1.19.1-cp37-cp37m-win_amd64.whl")
35+
os.remove("pycairo-1.19.1-cp37-cp37m-win_amd64.whl")
36+
37+
#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
38+
elif sys.version[:3]=='3.8' and platform.machine()=='x86':
39+
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")
40+
print("Sucessfully downloaded Cairo for your system")
41+
print("Installing Cairo")
42+
os.system("pip install pycairo-1.19.1-cp38-cp38-win32.whl")
43+
os.remove("pycairo-1.19.1-cp38-cp38-win32.whl")
44+
45+
#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
46+
elif sys.version[:3]=='3.8' and platform.machine()=='AMD64':
47+
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")
48+
print("Sucessfully downloaded Cairo for your system")
49+
print("Installing Cairo")
50+
os.system("pip install pycairo-1.19.1-cp38-cp38-win_amd64.whl")
51+
os.remove("pycairo-1.19.1-cp38-cp38-win_amd64.whl")

.travis/osx.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
##### THIS IS FOR TRAVIS BUILDS, DO NOT RUN THIS ON YOUR COMPUTER! #####
2+
3+
brew update
4+
brew install openssl readline
5+
brew outdated pyenv || brew upgrade pyenv
6+
brew install pyenv-virtualenv
7+
pyenv install $PYVER
8+
export PYENV_VERSION=$PYVER
9+
export PATH="/Users/travis/.pyenv/shims:${PATH}"
10+
pyenv virtualenv venv
11+
source ~/.pyenv/versions/venv/bin/activate
12+
python --version

.travis/travis-requirements.txt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
argparse
2+
colour
3+
numpy
4+
Pillow
5+
progressbar
6+
scipy
7+
tqdm
8+
# opencv-python
9+
# pycairo
10+
pydub
11+
pygments
12+
pyreadline; sys_platform == 'win32'
13+
rich
14+
pytest

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![logo](logo/cropped.png)
22

3-
[![Build Status](https://travis-ci.org/3b1b/manim.svg?branch=master)](https://travis-ci.org/3b1b/manim)
3+
[![Build Status](https://travis-ci.com/ManimCommunity/manim.svg?branch=master)](https://travis-ci.com/ManimCommunity/manim)
44
[![Documentation](https://img.shields.io/badge/docs-EulerTour-blue.svg)](https://www.eulertour.com/docs)
55
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://choosealicense.com/licenses/mit/)
66
[![Manim Subreddit](https://img.shields.io/reddit/subreddit-subscribers/manim.svg?color=ff4301&label=reddit)](https://www.reddit.com/r/manim/)

logo/logo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from manim.imports import *
1+
from manim import *
22

33
NEW_BLUE = "#68a8e1"
44

manim/scene/scene_from_video.py

+47-47
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
1-
from tqdm import tqdm as show_progress
2-
import cv2
1+
# from tqdm import tqdm as show_progress
2+
# import cv2
33

4-
from ..scene.scene import Scene
5-
from ..logger import logger
4+
# from ..scene.scene import Scene
5+
# from ..logger import logger
66

77

8-
# TODO, is this depricated?
9-
class SceneFromVideo(Scene):
10-
def construct(self, file_name,
11-
freeze_last_frame=True,
12-
time_range=None):
13-
cap = cv2.VideoCapture(file_name)
14-
self.shape = (
15-
int(cap.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)),
16-
int(cap.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH))
17-
)
18-
fps = cap.get(cv2.cv.CV_CAP_PROP_FPS)
19-
self.camera.frame_rate = fps
20-
frame_count = int(cap.get(cv2.cv.CV_CAP_PROP_FRAME_COUNT))
21-
if time_range is None:
22-
start_frame = 0
23-
end_frame = frame_count
24-
else:
25-
start_frame, end_frame = [fps * t for t in time_range]
8+
# # TODO, is this depricated?
9+
# class SceneFromVideo(Scene):
10+
# def construct(self, file_name,
11+
# freeze_last_frame=True,
12+
# time_range=None):
13+
# cap = cv2.VideoCapture(file_name)
14+
# self.shape = (
15+
# int(cap.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)),
16+
# int(cap.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH))
17+
# )
18+
# fps = cap.get(cv2.cv.CV_CAP_PROP_FPS)
19+
# self.camera.frame_rate = fps
20+
# frame_count = int(cap.get(cv2.cv.CV_CAP_PROP_FRAME_COUNT))
21+
# if time_range is None:
22+
# start_frame = 0
23+
# end_frame = frame_count
24+
# else:
25+
# start_frame, end_frame = [fps * t for t in time_range]
2626

27-
frame_count = end_frame - start_frame
28-
logger.info("Reading in " + file_name + "...")
29-
for count in show_progress(list(range(start_frame, end_frame + 1))):
30-
returned, frame = cap.read()
31-
if not returned:
32-
break
33-
# b, g, r = cv2.split(frame)
34-
# self.frames.append(cv2.merge([r, g, b]))
35-
self.frames.append(frame)
36-
cap.release()
27+
# frame_count = end_frame - start_frame
28+
# logger.info("Reading in " + file_name + "...")
29+
# for count in show_progress(list(range(start_frame, end_frame + 1))):
30+
# returned, frame = cap.read()
31+
# if not returned:
32+
# break
33+
# # b, g, r = cv2.split(frame)
34+
# # self.frames.append(cv2.merge([r, g, b]))
35+
# self.frames.append(frame)
36+
# cap.release()
3737

38-
if freeze_last_frame and len(self.frames) > 0:
39-
self.original_background = self.background = self.frames[-1]
38+
# if freeze_last_frame and len(self.frames) > 0:
39+
# self.original_background = self.background = self.frames[-1]
4040

41-
def apply_gaussian_blur(self, ksize=(5, 5), sigmaX=5):
42-
self.frames = [
43-
cv2.GaussianBlur(frame, ksize, sigmaX)
44-
for frame in self.frames
45-
]
41+
# def apply_gaussian_blur(self, ksize=(5, 5), sigmaX=5):
42+
# self.frames = [
43+
# cv2.GaussianBlur(frame, ksize, sigmaX)
44+
# for frame in self.frames
45+
# ]
4646

47-
def apply_edge_detection(self, threshold1=50, threshold2=100):
48-
edged_frames = [
49-
cv2.Canny(frame, threshold1, threshold2)
50-
for frame in self.frames
51-
]
52-
for index in range(len(self.frames)):
53-
for i in range(3):
54-
self.frames[index][:, :, i] = edged_frames[index]
47+
# def apply_edge_detection(self, threshold1=50, threshold2=100):
48+
# edged_frames = [
49+
# cv2.Canny(frame, threshold1, threshold2)
50+
# for frame in self.frames
51+
# ]
52+
# for index in range(len(self.frames)):
53+
# for i in range(3):
54+
# self.frames[index][:, :, i] = edged_frames[index]

requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ Pillow
55
progressbar
66
scipy
77
tqdm
8-
opencv-python
8+
# opencv-python
99
pycairo
1010
pydub
1111
pygments
1212
pyreadline; sys_platform == 'win32'
1313
rich
14+
# pytest (for development only)

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
"pydub",
2727
"pygments",
2828
"pyreadline; sys_platform == 'win32'",
29-
"rich"
29+
"rich",
3030
],
3131
)

tests/test_imports.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_import():
2+
import manim

0 commit comments

Comments
 (0)