-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Travis setup #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Travis setup #86
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
705b960
setup Travis-CI by adding a .travis.yml file. Add pytest to requireme…
leotrs 67b88aa
add pytest to setup
leotrs da9d4a8
fix: remove trailing comma
leotrs 6077328
Remove windows from the build matrix, as Travis-CI does not currently…
leotrs 032c097
remove macOS from the build matrix as it is not currently supported b…
leotrs ceb6a1d
try a better build matrix
leotrs 66d24c6
keep trying on macOS
leotrs 3ec1bd7
fix the build matrix (the os section was triggering unnecessary build…
leotrs 60c9235
fix: apparently, rich does not support python 3.8.3 yet, but it does …
leotrs 8706817
Test new travis job matrix (with Windows too)
safinsingh e4ecc2f
use the right branch
safinsingh cda168a
Rename linux to mac in build config
safinsingh 786031e
Add refreshenv to windows
safinsingh cc5dd14
try python version 3.8.0, as rich does not seem to support it
leotrs 2572a01
specify both the python version and the destination folder
leotrs f7c7cef
travis environment variables go on the same line
leotrs f8fa823
try with pip3
leotrs 409f702
here goes nothing
leotrs 2b69de1
Try using pip from python
eulertour 8afc7d2
It didn't work
eulertour facbcaa
update PATH
safinsingh d28dfca
Add user option to pip
safinsingh 791a672
Well that broke it
safinsingh 2ce0ffa
Add python -m on windows
safinsingh 6c8a475
try to make cairo work with windoze??
safinsingh 44b200f
Clarify lines and fix windows installs
safinsingh 4338520
Remove double build
safinsingh e08c1c8
Refresh env vars after pytest install (win)
safinsingh f9bb278
Add python -m for windows pytest
safinsingh 7221634
Try to fix opencv + ffmpeg on win
safinsingh 3c0643a
Remove OpenCV completely
safinsingh eb4819e
Merge branch 'master' into travis-setup
safinsingh e9b02b3
Remove .imports
safinsingh acbd4eb
One more import
safinsingh ab9ac29
Add build badge to readme [skip ci]
safinsingh 963d66e
Housekeeping & pytest dev-only req [skip-ci]
safinsingh af53017
Test master [skip ci]
safinsingh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
jobs: | ||
include: | ||
# Linux Jobs | ||
- os: linux | ||
language: python | ||
python: 3.6 | ||
install: | ||
- pip3 install --upgrade pip | ||
- pip3 install -r ./.travis/travis-requirements.txt | ||
- pip3 install pycairo pytest | ||
- pip3 install . | ||
script: | ||
- pytest | ||
|
||
- os: linux | ||
language: python | ||
python: 3.7 | ||
install: | ||
- pip3 install --upgrade pip | ||
- pip3 install -r ./.travis/travis-requirements.txt | ||
- pip3 install pycairo pytest | ||
- pip3 install . | ||
script: | ||
- pytest | ||
|
||
- os: linux | ||
language: python | ||
python: 3.8 | ||
install: | ||
- pip3 install --upgrade pip | ||
- pip3 install -r ./.travis/travis-requirements.txt | ||
- pip3 install pycairo pytest | ||
- pip3 install . | ||
script: | ||
- pytest | ||
|
||
# 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 pytest | ||
- pip3 install . | ||
script: | ||
- pytest | ||
|
||
- 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 pytest | ||
- pip3 install . | ||
script: | ||
- pytest | ||
|
||
- os: osx | ||
language: sh | ||
python: 3.8 | ||
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 pytest | ||
- pip3 install . | ||
script: | ||
- pytest | ||
|
||
# Windows Jobs | ||
- os: windows | ||
language: sh | ||
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" | ||
- 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 ./.travis/cairo-windows.py | ||
- cmd.exe //c "RefreshEnv.cmd" | ||
- python -m pip install --user . | ||
script: | ||
- python -m pytest | ||
|
||
- os: windows | ||
language: sh | ||
python: 3.7 | ||
env: PYVER="3.7.7" PYDIR="Python37" | ||
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 ./.travis/cairo-windows.py | ||
- cmd.exe //c "RefreshEnv.cmd" | ||
- python -m pip install --user . | ||
script: | ||
- python -m pytest | ||
|
||
- os: windows | ||
language: sh | ||
python: 3.8 | ||
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" | ||
- 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 ./.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 | ||
|
||
branches: | ||
only: | ||
- master | ||
|
||
notifications: | ||
email: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
argparse | ||
colour | ||
numpy | ||
Pillow | ||
progressbar | ||
scipy | ||
tqdm | ||
# opencv-python | ||
# pycairo | ||
pydub | ||
pygments | ||
pyreadline; sys_platform == 'win32' | ||
rich | ||
pytest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from manim.imports import * | ||
from manim import * | ||
|
||
NEW_BLUE = "#68a8e1" | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,54 @@ | ||
from tqdm import tqdm as show_progress | ||
import cv2 | ||
# from tqdm import tqdm as show_progress | ||
leotrs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# 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] | ||
# 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,6 @@ | |
"pydub", | ||
"pygments", | ||
"pyreadline; sys_platform == 'win32'", | ||
"rich" | ||
"rich", | ||
], | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def test_import(): | ||
import manim |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the same script as in #71? If so, please make sure to use that script once #71 is merged, because when it does, this script will be in two different places.