Skip to content

Commit

Permalink
Update (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
tburrows13 authored Feb 12, 2018
1 parent 7bd0678 commit 1de29a7
Show file tree
Hide file tree
Showing 48 changed files with 1,299 additions and 510 deletions.
45 changes: 31 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,43 @@
dist: Trusty
dist: trusty
sudo: required
language: python
cache: pip
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
# command to install dependencies

before_install:
- sudo add-apt-repository -y ppa:kirillshkrogalev/ffmpeg-next
- sudo apt-get -y update
- sudo apt-get install -y ffmpeg
- sudo apt-get -y -qq update
- sudo apt-get install -y -qq ffmpeg
- mkdir media
install:
- if [[ $TRAVIS_PYTHON_VERSION == '3.4' || $TRAVIS_PYTHON_VERSION == '3.5' || $TRAVIS_PYTHON_VERSION == '3.6' ]]; then pip install matplotlib; pip install -U scikit-learn; pip install scipy; pip install opencv-python; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install scipy; pip install opencv-python; fi
- pip install coveralls
- pip install pytest-cov
- python setup.py install
# command to run tests
before_script:
- py.test tests/ --cov
script: py.test tests/ --doctest-modules -v --cov moviepy --cov-report term-missing

# Ensure PIP is up-to-date to avoid warnings.
- python -m pip install --upgrade pip
# Ensure setuptools is up-to-date to avoid environment_markers bug.
- pip install --upgrade setuptools
# The default py that is installed is too old on some platforms, leading to version conflicts
- pip install --upgrade py pytest

install:
- echo "No install action required. Implicitly performed by the testing."

# before_script:

script:
- python setup.py test --pytest-args "tests/ --doctest-modules -v --cov moviepy --cov-report term-missing"
# Now the *code* is tested, let's check that the setup is compatible with PIP without falling over.
- pip install -e .
- pip install -e .[optional]
- pip install -e .[test]
# Only test doc generation on latest. Doesn't work on some earlier versions (3.3), but doesn't matter.
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then pip install -e .[doc]; fi

after_success:
- coveralls

matrix:
fast_finish: true
10 changes: 6 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ For advanced image processing, you will need one or several of the following pac

Once you have installed it, ImageMagick will be automatically detected by MoviePy, (except for windows users and Ubuntu 16.04LTS users).

For Windows users, before installing MoviePy by hand, go into the ``moviepy/config_defaults.py`` file and provide the path to the ImageMagick binary called `convert`. It should look like this ::
For Windows users, before installing MoviePy by hand, go into the ``moviepy/config_defaults.py`` file and provide the path to the ImageMagick binary called ``magick``. It should look like this ::

IMAGEMAGICK_BINARY = "C:\\Program Files\\ImageMagick_VERSION\\convert.exe"
IMAGEMAGICK_BINARY = "C:\\Program Files\\ImageMagick_VERSION\\magick.exe"
If you are using an older version of ImageMagick, keep in mind the name of the executable is not ``magick.exe`` but ``convert.exe``. In that case, the IMAGEMAGICK_BINARY property should be ``C:\\Program Files\\ImageMagick_VERSION\\convert.exe``

For Ubuntu 16.04LTS users, after installing MoviePy on the terminal, IMAGEMAGICK will not be detected by moviepy. This bug can be fixed. Modify the file in this directory: /etc/ImageMagick-6/policy.xml, comment out the statement <!-- <policy domain="path" rights="none" pattern="@*" /> -->.

Expand Down Expand Up @@ -137,7 +139,7 @@ Maintainers

- Zulko_ (owner)

- `@Gloin1313`_
- `@tburrows13`_
- `@earney`_
- Kay `@kerstin`_
- `@mbeacom`_
Expand Down Expand Up @@ -171,7 +173,7 @@ Maintainers

.. People
.. _Zulko: https://github.com/Zulko
.. _`@Gloin1313`: https://github.com/Gloin1313
.. _`@tburrows13`: https://github.com/tburrows13
.. _`@earney`: https://github.com/earney
.. _`@kerstin`: https://github.com/kerstin
.. _`@mbeacom`: https://github.com/mbeacom
161 changes: 161 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# This file is used to configure the AppVeyor CI system, for testing on Windows machines.
#
# Code loosely based on https://github.com/ogrisel/python-appveyor-demo
#
# To test with AppVeyor:
# Register on appveyor.com with your GitHub account.
# Create a new appveyor project, using the GitHub details.
# Ideally, configure notifications to post back to GitHub. (Untested)

environment:
global:
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script interpreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd"

matrix:

# MoviePy supports Python 2.7 and 3.3 onwards.
# Strategy:
# Test the latest known patch in each version
# Test the oldest and the newest 32 bit release. 64-bit otherwise.

- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7.13"
PYTHON_ARCH: "64"
MINICONDA: C:\Miniconda
CONDA_INSTALL: "numpy"

- PYTHON: "C:\\Python33-x64"
PYTHON_VERSION: "3.3.5"
PYTHON_ARCH: "64"
MINICONDA: C:\Miniconda3-x64
CONDA_INSTALL: "numpy"

- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4.5"
PYTHON_ARCH: "64"
MINICONDA: C:\Miniconda3-x64
CONDA_INSTALL: "numpy"

- PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5.3"
PYTHON_ARCH: "64"
MINICONDA: C:\Miniconda35-x64
CONDA_INSTALL: "numpy"

- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.2"
PYTHON_ARCH: "64"
MINICONDA: C:\Miniconda36-x64
CONDA_INSTALL: "numpy"

- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.13"
PYTHON_ARCH: "32"
MINICONDA: C:\Miniconda
CONDA_INSTALL: "numpy"

- PYTHON: "C:\\Python34"
PYTHON_VERSION: "3.6.2"
PYTHON_ARCH: "32"
MINICONDA: C:\Miniconda36
CONDA_INSTALL: "numpy"

install:
# If there is a newer build queued for the same PR, cancel this one.
# The AppVeyor 'rollout builds' option is supposed to serve the same
# purpose but it is problematic because it tends to cancel builds pushed
# directly to master instead of just PR builds (or the converse).
# credits: JuliaLang developers.
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }

# Dump some debugging information about the machine.
# - ECHO "Filesystem root:"
# - ps: "ls \"C:/\""
#
# - ECHO "Installed SDKs:"
# - ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\""
#
# - ECHO "Installed projects:"
# - ps: "ls \"C:\\projects\""
# - ps: "ls \"C:\\projects\\moviepy\""

# - ECHO "Environment Variables"
# - set


# Prepend desired Python to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"

# Prepare Miniconda.
- "ECHO Miniconda is installed in %MINICONDA%, and will be used to install %CONDA_INSTALL%"

- "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%"
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda

# Avoid warning from conda info.
- conda install -q -n root _license
# Dump the setup for debugging.
- conda info -a

# PIP finds some packages challenging. Let Miniconda install them.
- conda create --verbose -q -n test-environment python=%PYTHON_VERSION% %CONDA_INSTALL%
- activate test-environment

# Upgrade to the latest version of pip to avoid it displaying warnings
# about it being out of date.
- pip install --disable-pip-version-check --user --upgrade pip
- pip install --user --upgrade setuptools


# Install ImageMagick (which also installs ffmpeg.)
# This installation process is a big fragile, as new releases are issued, but no Conda package exists yet.
- "ECHO Downloading ImageMagick"
# Versions >=7.0 have problems - executables changed names.
# Assume 64-bit. Need to change to x86 for 32-bit.
# The available version at this site changes - each time it needs to be corrected in four places
# in the next few lines.
- curl -fskLO ftp://ftp.fifi.org/pub/ImageMagick/binaries/ImageMagick-6.9.9-5-Q16-x64-static.exe
- "ECHO Installing ImageMagick"
- "ImageMagick-6.9.9-5-Q16-x64-static.exe /verySILENT /SP"
- set IMAGEMAGICK_BINARY=c:\\Program Files\\ImageMagick-6.9.9-Q16\\convert.exe
- set FFMPEG_BINARY=c:\\Program Files\\ImageMagick-6.9.9-Q16\\ffmpeg.exe

# Check that we have the expected set-up.
- "ECHO We specified %PYTHON_VERSION% win%PYTHON_ARCH%"
- "python --version"
- "python -c \"import struct; print('Architecture is win'+str(struct.calcsize('P') * 8))\""

build_script:

# Build the compiled extension
- "%CMD_IN_ENV% python c:\\projects\\moviepy\\setup.py build"

test_script:
# Run the project tests
- "%CMD_IN_ENV% python c:\\projects\\moviepy\\setup.py test"

# TODO: Support the post-test generation of binaries - Pending a version number that is supported (e.g. 0.3.0)
#
# after_test:
#
# # If tests are successful, create binary packages for the project.
# - "%CMD_IN_ENV% python c:\\projects\\moviepy\\setup.py bdist_wheel"
# - "%CMD_IN_ENV% python c:\\projects\\moviepy\\setup.py bdist_wininst"
# - "%CMD_IN_ENV% python c:\\projects\\moviepy\\setup.py bdist_msi"
# - ps: "ls dist"
#
# artifacts:
# # Archive the generated packages in the ci.appveyor.com build report.
# - path: dist\*
#
# on_success:
# - TODO: upload the content of dist/*.whl to a public wheelhouse
86 changes: 86 additions & 0 deletions appveyor/run_with_env.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
:: To build extensions for 64 bit Python 3, we need to configure environment
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1)
::
:: To build extensions for 64 bit Python 2, we need to configure environment
:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
::
:: 32 bit builds, and 64-bit builds for 3.5 and beyond, do not require specific
:: environment configurations.
::
:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
:: cmd interpreter, at least for (SDK v7.0)
::
:: More details at:
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
:: http://stackoverflow.com/a/13751649/163740
::
:: Author: Olivier Grisel
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
::
:: Notes about batch files for Python people:
::
:: Quotes in values are literally part of the values:
:: SET FOO="bar"
:: FOO is now five characters long: " b a r "
:: If you don't want quotes, don't include them on the right-hand side.
::
:: The CALL lines at the end of this file look redundant, but if you move them
:: outside of the IF clauses, they do not run properly in the SET_SDK_64==Y
:: case, I don't know why.
@ECHO OFF

SET COMMAND_TO_RUN=%*
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
SET WIN_WDK=c:\Program Files (x86)\Windows Kits\10\Include\wdf

:: Extract the major and minor versions, and allow for the minor version to be
:: more than 9. This requires the version number to have two dots in it.
SET MAJOR_PYTHON_VERSION=%PYTHON_VERSION:~0,1%
IF "%PYTHON_VERSION:~3,1%" == "." (
SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,1%
) ELSE (
SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,2%
)
:: Based on the Python version, determine what SDK version to use, and whether
:: to set the SDK for 64-bit.
IF %MAJOR_PYTHON_VERSION% == 2 (
SET WINDOWS_SDK_VERSION="v7.0"
SET SET_SDK_64=Y
) ELSE (
IF %MAJOR_PYTHON_VERSION% == 3 (
SET WINDOWS_SDK_VERSION="v7.1"
IF %MINOR_PYTHON_VERSION% LEQ 4 (
SET SET_SDK_64=Y
) ELSE (
SET SET_SDK_64=N
IF EXIST "%WIN_WDK%" (
:: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/
REN "%WIN_WDK%" 0wdf
)
)
) ELSE (
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
EXIT 1
)
)
IF %PYTHON_ARCH% == 64 (
IF %SET_SDK_64% == Y (
ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture
SET DISTUTILS_USE_SDK=1
SET MSSdk=1
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
ECHO Executing: %COMMAND_TO_RUN%
call %COMMAND_TO_RUN% || EXIT 1
) ELSE (
ECHO Using default MSVC build environment for 64 bit architecture
ECHO Executing: %COMMAND_TO_RUN%
call %COMMAND_TO_RUN% || EXIT 1
)
) ELSE (
ECHO Using default MSVC build environment for 32 bit architecture
ECHO Executing: %COMMAND_TO_RUN%
call %COMMAND_TO_RUN% || EXIT 1
)
4 changes: 3 additions & 1 deletion docs/advanced_tools/advanced_tools.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""
Advanced tools
===============
Expand All @@ -7,4 +8,5 @@
Subtitles
----------
Credits
Credits
"""
2 changes: 1 addition & 1 deletion docs/examples/quick_recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Blurring all frames of a video

::

from skimage.filter import gaussian_filter
from skimage.filters import gaussian_filter
from moviepy.editor import VideoFileClip

def blur(image):
Expand Down
Loading

0 comments on commit 1de29a7

Please sign in to comment.