Permalink
Browse files

add a function to check video + change jenkins jobs

  • Loading branch information...
sdpython committed Jan 10, 2018
1 parent 1eb5bc0 commit 4128f1c3373c0b6cb4085acb226941d53f97cd24
View
@@ -11,7 +11,7 @@ install:
- pip freeze > pip_freeze.txt
script:
- { CMD: "python -X faulthandler -X showrefcount -u setup.py unittests -g \".*noenv.*\"", NAME: "UT" }
- { CMD: "python -u setup.py unittests -e \".*noenv1.*\"", NAME: "UT_NOENV1" }
- { CMD: "python -u setup.py unittests -e \".*noenv1.*\" -g .*LONG.*", NAME: "UT_NOENV1" }
- { CMD: "python -u setup.py unittests -e \".*noenv2.*\"", NAME: "UT_NOENV2" }
- { CMD: "python -u setup.py unittests -e \".*noenv3.*\"", NAME: "UT_NOENV3" }
- { CMD: "python -u setup.py unittests -e \".*noenv4.*\"", NAME: "UT_NOENV4" }
@@ -20,6 +20,17 @@ Windows
* Télécharger et installer `Anaconda <https://www.anaconda.com/download/>`_.
::
conda update --all
Pour les jeux avec vidéo :
::
conda install -y keras
pip install -y code_beatrix moviepy pytube
Mise à jour
===========
@@ -0,0 +1,56 @@
"""
@brief test log(time=0s)
"""
import sys
import os
import unittest
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
"..")))
if path not in sys.path:
sys.path.append(path)
import src
try:
import pyquickhelper as skip_
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
"..",
"..",
"pyquickhelper",
"src")))
if path not in sys.path:
sys.path.append(path)
import pyquickhelper as skip_
from pyquickhelper.loghelper import fLOG
from src.code_beatrix import check
class TestCheckVideo(unittest.TestCase):
def test_check(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
check(kind="video")
if __name__ == "__main__":
unittest.main()
@@ -38,7 +38,7 @@
from pyquickhelper.loghelper import fLOG
from src.code_beatrix.scratchs import check
from src.code_beatrix import check
class TestCheckScratchFiles(unittest.TestCase):
@@ -49,7 +49,7 @@ def test_check(self):
self._testMethodName,
OutputPrint=__name__ == "__main__")
check()
check(kind="scratch")
if __name__ == "__main__":
View
@@ -22,7 +22,7 @@ pymmails
pymyinstall
pyquickhelper>=1.5.2259
pyshp
pytube
pytube>=8.0.0
qgrid
semantic_version
shapely
@@ -52,17 +52,23 @@ def _setup_hook(add_print=False, unit_test=False):
print("Success: _setup_hook")
def check(log=False):
def check(log=False, kind=None):
"""
Checks the library is working.
It raises an exception.
@param log if True, display information, otherwise
@param kind None or ``'scratch'`` or ``'video'``
@return 0 or exception
"""
from .scratchs import check
check()
return True
r = True
if kind is None or kind == "scratch":
from .scratchs import check
r &= check()
if kind is None or kind == "video":
from .faq.faq_video import check
r &= check()
return r
def load_ipython_extension(ip):
@@ -8,6 +8,7 @@
import os
import sys
import numpy
import tempfile
from pytube import YouTube
from imageio import imsave
import moviepy.audio.fx.all as afx
@@ -31,6 +32,18 @@ class FontError(Exception):
pass
def check():
"""
Checks a couple of functionality works.
"""
with tempfile.TemporaryDirectory() as temp:
vid = download_youtube_video("4o5baMYWdtQ", temp)
ext = video_compose(vid, vid, t2=2, place="h2")
dest = os.path.join(temp, "res.mp4")
video_save(exp, dest)
return os.path.exists(dest)
##########
# youtube
##########

0 comments on commit 4128f1c

Please sign in to comment.