Skip to content

Commit

Permalink
Update Zulko#530 Use setup.py only dep handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeacom committed Apr 7, 2017
1 parent efc3db2 commit dd5704a
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 36 deletions.
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include *.txt
recursive-include docs *.txt
recursive-include docs *
include *.rst
recursive-include docs *.rst
include ez_setup.py
20 changes: 17 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,19 @@ For instance, using the method ``clip.resize`` requires that at least one of Sci
Documentation
-------------

Running `build_docs` has additional dependencies that require installation.

$ (sudo) pip install moviepy[docs]

The documentation can be generated and viewed via:

$ cd docs/
$ make clean html
$ open build/html/index.html
$ python setup.py build_docs

You can pass additional arguments to the documentation build, such as clean build:

$ python setup.py build_docs -E

More information is available from the `Sphinx`_ documentation.


Running Tests
Expand All @@ -110,6 +118,11 @@ The testing suite can be executed via:

$ 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:

$ (sudo) pip install moviepy[test]


Contribute
----------
Expand Down Expand Up @@ -154,6 +167,7 @@ Maintainers
.. _ffmpeg: http://www.ffmpeg.org/download.html
.. _ImageMagick: http://www.imagemagick.org/script/index.php
.. _`Matplotlib`: https://matplotlib.org/
.. _`Sphinx`: http://www.sphinx-doc.org/en/master/setuptools.html

.. People
.. _Zulko: https://github.com/Zulko
Expand Down
19 changes: 10 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
import os
import sys

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
import sphinx_rtd_theme

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('.'))

# -- General configuration -----------------------------------------------------

Expand Down Expand Up @@ -53,9 +58,9 @@
# built documents.
#
# The short X.Y version.
version = '0.2'
# version = '0.2'
# The full version, including alpha/beta/rc tags.
release = '0.2.3.1'
# release = '0.2.3.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -97,13 +102,9 @@

# -- Options for HTML output ---------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
import sphinx_rtd_theme
sys.path.append(os.path.abspath('_themes'))
sys.path.append("../moviepy")
#html_theme_path = ['_themes']
html_theme = "sphinx_rtd_theme" # formerly 'kr'
html_theme = 'sphinx_rtd_theme' # formerly 'kr'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
4 changes: 0 additions & 4 deletions requirements/base.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements/docs.txt

This file was deleted.

4 changes: 0 additions & 4 deletions requirements/optional.txt

This file was deleted.

4 changes: 0 additions & 4 deletions requirements/test.txt

This file was deleted.

35 changes: 30 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,28 @@ def run_tests(self):
sys.exit(errno)


cmdclass = {'test': PyTest} # Define custom commands.

if 'build_docs' in sys.argv:
try:
from sphinx.setup_command import BuildDoc
except ImportError:
raise ImportError('Running the documenation builds has additional'
' dependencies. Please run (pip install moviepy[docs])')

cmdclass['build_docs'] = BuildDoc

exec(open('moviepy/version.py').read()) # loads __version__

requires = ['numpy', 'decorator', 'imageio', 'tqdm']
test_requirements = ['pytest>=2.8.0', 'nose', 'sklearn']
optional_requirements = ['scikit-image', 'scipy']
# Define the requirements for specific execution needs.
requires = ['numpy==1.12.1', 'decorator==4.0.11', 'imageio==2.1.2',
'tqdm==4.11.2']
optional_reqs = ['scikit-image==0.13.0', 'scipy==0.19.0', 'matplotlib==2.0.0']
documentation_reqs = ['pygame==1.9.3', 'numpydoc>=0.6.0',
'sphinx_rtd_theme>=0.1.10b0', 'Sphinx>=1.5.2'] + optional_reqs
test_requirements = ['pytest>=2.8.0', 'nose', 'sklearn'] + optional_reqs

# Load the README.
with open('README.rst', 'r', 'utf-8') as f:
readme = f.read()

Expand Down Expand Up @@ -85,8 +101,17 @@ def run_tests(self):
),
keywords='video editing audio compositing ffmpeg',
packages=find_packages(exclude='docs'),
cmdclass={'test': PyTest},
cmdclass=cmdclass,
command_options={
'build_docs': {
'build_dir': ('setup.py', './docs/build'),
'config_dir': ('setup.py', './docs'),
'version': ('setup.py', __version__.rsplit('.', 2)[0]),
'release': ('setup.py', __version__)}},
tests_require=test_requirements,
install_requires=requires,
extras_require={'optional': optional_requirements}
extras_require={
'optional': optional_reqs,
'docs': documentation_reqs,
'test': test_requirements}
)

0 comments on commit dd5704a

Please sign in to comment.