diff --git a/Makefile b/Makefile index 38fa6f4..49353e5 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,18 @@ -# Packs the package into the dist directory +# Installs the package locally +install: uninstall package + pip install dist/cvloop*.tar.gz + +# Packs the package into the dist directory and signs it package: clean doc python setup.py sdist + gpg --detach-sign --armor dist/cvloop*.tar.gz # Uninstalls the package from a local installation uninstall: - pip freeze | grep cvloop > /dev/null; if [ $$? -eq 0 ]; then pip uninstall cvloop -y ; fi - -# Installs the package locally -install: uninstall package - pip install dist/cvloop-0.1.0.tar.gz + pip freeze | grep cvloop > /dev/null ; \ + if [ $$? -eq 0 ]; then \ + pip uninstall cvloop -y ; \ + fi # Cleans up: Removes the packed package and sanitizes the examples file. clean: @@ -18,3 +22,23 @@ clean: # Creates the documentation and updates the functions ipynb. doc: python tools/create_functions_ipynb.py examples/cvloop_functions.ipynb + +# Publishes to pypitest +testpublish: + @read -p "Enter the name of this package to verify upload to pypi test: " name ; \ + if [ "$$name" == "cvloop" ]; then \ + python setup.py register -r pypitest ; \ + python setup.py sdist upload -r pypitest ; \ + else \ + echo 'Sorry, this was wrong. Please try again.' ; \ + fi + +# Publishes to pypi +publish: package + @read -p "Enter the name of this package to verify upload to pypi: " name ; \ + if [ "$$name" == "cvloop" ]; then \ + python setup.py register -r pypi ; \ + python setup.py upload -r pypi ; \ + else \ + echo 'Sorry, this was wrong. Please try again.' ; \ + fi diff --git a/README.md b/README.rst similarity index 52% rename from README.md rename to README.rst index ae562b7..5ffb5fc 100644 --- a/README.md +++ b/README.rst @@ -1,20 +1,27 @@ -# cvloop +cvloop +====== -Provides cvloop, a way to show opencv video loops, especially in jupyter notebooks. +Provides cvloop, a way to show opencv video loops. Designed for jupyter notebooks. **Simple example**: Show webcam feed. +.. code-block:: python + %matplotlib notebook from cvloop import cvloop cvloop() **More complex example**: Show webcam feed side by side with inverted image. +.. code-block:: python + %matplotlib notebook from cvloop import cvloop cvloop(function=lambda frame: 255 - frame, side_by_side=True) -**Complex example**: Show video file with background extraction (See [OpenCV Documentation](http://docs.opencv.org/3.1.0/db/d5c/tutorial_py_bg_subtraction.html)). +**Complex example**: Show video file with background extraction (See `OpenCV Documentation`_). + +.. code-block:: python %matplotlib notebook from cvloop import cvloop @@ -26,16 +33,21 @@ Provides cvloop, a way to show opencv video loops, especially in jupyter noteboo cvloop('test.avi', function=mog2, side_by_side=True) -**More examples**: For more examples check out the [examples notebook](examples/cvloop_examples.ipynb). +**More examples**: For more examples check out the `examples notebook`_. + +Requirements +------------ -## Requirements +- Python 3 (tested with 3.6) +- OpenCV 3.1 +- Jupyter -- Python 3 (tested with 3.6) -- OpenCV 3.1 -- Jupyter +Dependencies +------------ -## Dependencies +- matplotlib +- numpy -- matplotlib -- numpy +.. _`OpenCV Documentation`: http://docs.opencv.org/3.1.0/db/d5c/tutorial_py_bg_subtraction.html +.. _`examples notebook`: examples/cvloop_examples.ipynb diff --git a/setup.cfg b/setup.cfg index b88034e..5aef279 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,2 @@ [metadata] -description-file = README.md +description-file = README.rst diff --git a/setup.py b/setup.py index 4ecb1f5..6e253a0 100644 --- a/setup.py +++ b/setup.py @@ -1,15 +1,26 @@ from distutils.core import setup -VERSION = '0.1.0' +import re +import sys + + +VERSION = '0.1.0' # x.y.z[-dev#] +REPOSITORY = 'https://github.com/shoeffner/cvloop' + +README = '' +with open('README.rst', 'r') as f: + README = f.read() +README = re.sub(r' _(.+): ([^(http)].+)', r' _\1: {}/blob/master/\2'.format(REPOSITORY), README) setup( name = 'cvloop', version = VERSION, description = 'cvloop allows online video transformation and evaluation with OpenCV. Designed for jupyter notebooks.', + long_description = README, author = 'Sebastian Höffner', author_email = 'info@sebastian-hoeffner.de', - url = 'https://github.com/shoeffner/cvloop', - download_url = 'https://github.com/shoeffner/cvloop/tarball/{}'.format(VERSION), + url = REPOSITORY, + download_url = '{}/tarball/{}'.format(REPOSITORY, VERSION), packages = ['cvloop'], classifiers = [ 'Development Status :: 3 - Alpha', @@ -22,6 +33,7 @@ 'Programming Language :: Python :: 3.6', 'Topic :: Multimedia :: Video :: Display', ], + license = 'MIT', keywords = [ 'OpenCV', 'cv2', 'video', 'loop', 'jupyter', 'notebook' ],