Skip to content

Commit

Permalink
Merge branch 'master' into patch-4
Browse files Browse the repository at this point in the history
  • Loading branch information
tburrows13 committed Apr 19, 2018
2 parents 1ddb7b9 + 497c852 commit edb4ac4
Show file tree
Hide file tree
Showing 59 changed files with 2,374 additions and 765 deletions.
41 changes: 31 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,48 @@ 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 -qq update
- sudo apt-get install -y -qq ffmpeg
- mkdir media

# 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

# modify ImageMagick policy file so that Textclips work correctly.
# `| sudo tee` replaces `>` so that it can have root permissions
- cat /etc/ImageMagick/policy.xml | sed 's/none/read,write/g' | sudo tee /etc/ImageMagick/policy.xml

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
- echo "No install action required. Implicitly performed by the testing."
- pip install flake8

before_script:
- py.test tests/ --cov
script: py.test tests/ --doctest-modules -v --cov moviepy --cov-report term-missing
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics --exit-zero
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

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
543 changes: 543 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN apt-get install -y locales && \
ENV LC_ALL C.UTF-8

# do we need all of these, maybe remove some of them?
RUN pip install imageio numpy scipy matplotlib pandas sympy nose decorator tqdm pillow pytest
RUN pip install imageio numpy scipy matplotlib pandas sympy nose decorator tqdm pillow pytest requests

# install scikit-image after the other deps, it doesn't cause errors this way.
RUN pip install scikit-image sklearn
Expand Down
46 changes: 38 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ MoviePy
.. image:: https://travis-ci.org/Zulko/moviepy.svg?branch=master
:target: https://travis-ci.org/Zulko/moviepy
:alt: Build status on travis-ci
.. image:: https://coveralls.io/repos/github/Zulko/moviepy/badge.svg?branch=master
:target: https://coveralls.io/github/Zulko/moviepy?branch=master
:alt: Code coverage from coveralls.io

MoviePy (full documentation_) is a Python library for video editing: cutting, concatenations, title insertions, video compositing (a.k.a. non-linear editing), video processing, and creation of custom effects. See the gallery_ for some examples of use.

Expand Down Expand Up @@ -44,15 +47,21 @@ Installation

MoviePy depends on the Python modules Numpy_, imageio_, Decorator_, and tqdm_, which will be automatically installed during MoviePy's installation. The software FFMPEG should be automatically downloaded/installed (by imageio) during your first use of MoviePy (installation will take a few seconds). If you want to use a specific version of FFMPEG, follow the instructions in ``config_defaults.py``. In case of trouble, provide feedback.

**Installation by hand:** download the sources, either from PyPI_ or, if you want the development version, from GitHub_, unzip everything into one folder, open a terminal and type: ::
**Installation by hand:** download the sources, either from PyPI_ or, if you want the development version, from GitHub_, unzip everything into one folder, open a terminal and type:

.. code:: bash
$ (sudo) python setup.py install
**Installation with pip:** if you have ``pip`` installed, just type this in a terminal: ::
**Installation with pip:** if you have ``pip`` installed, just type this in a terminal:

.. code:: bash
$ (sudo) pip install moviepy
If you have neither ``setuptools`` nor ``ez_setup`` installed, the command above will fail. In this case type this before installing: ::
If you have neither ``setuptools`` nor ``ez_setup`` installed, the command above will fail. In this case type this before installing:

.. code:: bash
$ (sudo) pip install ez_setup
Expand All @@ -62,11 +71,15 @@ Optional but useful dependencies

You can install ``moviepy`` with all dependencies via:

.. code:: bash
$ (sudo) pip install moviepy[optional]
ImageMagick_ is not strictly required, but needed if you want to incorporate texts. It can also be used as a backend for GIFs, though you can also create GIFs with MoviePy without ImageMagick.

Once you have installed ImageMagick, it will be automatically detected by MoviePy, **except on Windows!** Windows users, before installing MoviePy by hand, need to edit ``moviepy/config_defaults.py`` to provide the path to the ImageMagick binary, which is called `convert`. It should look like this ::
Once you have installed ImageMagick, it will be automatically detected by MoviePy, **except on Windows!** Windows users, before installing MoviePy by hand, need to edit ``moviepy/config_defaults.py`` to provide the path to the ImageMagick binary, which is called `convert`. It should look like this:

.. code:: python
IMAGEMAGICK_BINARY = "C:\\Program Files\\ImageMagick_VERSION\\convert.exe"
Expand All @@ -82,9 +95,13 @@ 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"
.. code:: python
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 All @@ -98,14 +115,20 @@ Documentation

Running `build_docs` has additional dependencies that require installation.

.. code:: bash
$ (sudo) pip install moviepy[docs]
The documentation can be generated and viewed via:

.. code:: bash
$ python setup.py build_docs
You can pass additional arguments to the documentation build, such as clean build:

.. code:: bash
$ python setup.py build_docs -E
More information is available from the `Sphinx`_ documentation.
Expand All @@ -116,11 +139,15 @@ Running Tests

The testing suite can be executed via:

.. code:: bash
$ python setup.py test
Running the test suite in this manner will install the testing dependencies.
If you opt to run the test suite manually, you can install the dependencies via:

.. code:: bash
$ (sudo) pip install moviepy[test]
Expand All @@ -131,13 +158,15 @@ MoviePy is open-source software originally written by Zulko_ and released under

You can also discuss the project on Reddit_ (preferred over GitHub issues for usage/examples), Gitter_ or the mailing list moviepy@librelist.com.

We have a list of tags used in our `Tag Wiki`_. The 'Pull Requests' tags are well defined, and all PRs should fall under exactly one of these. The 'Issues' tags are less precise, and may not be a complete list.


Maintainers
-----------

- Zulko_ (owner)

- `@Gloin1313`_
- `@tburrows13`_
- `@earney`_
- Kay `@kerstin`_
- `@mbeacom`_
Expand All @@ -147,6 +176,7 @@ Maintainers
.. _gallery: http://zulko.github.io/moviepy/gallery.html
.. _documentation: http://zulko.github.io/moviepy/
.. _`download MoviePy`: https://github.com/Zulko/moviepy
.. _`Tag Wiki`: https://github.com/Zulko/moviepy/wiki/Tag-Wiki

.. Websites, Platforms
.. _Reddit: http://www.reddit.com/r/moviepy/
Expand All @@ -171,7 +201,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
155 changes: 155 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# 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.4 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:\\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
Loading

0 comments on commit edb4ac4

Please sign in to comment.