Skip to content

Commit

Permalink
Merge branch 'refactor/library_loading'
Browse files Browse the repository at this point in the history
  • Loading branch information
emcconville committed Nov 14, 2018
2 parents 7b9fbd9 + 83c0f96 commit 040b59b
Show file tree
Hide file tree
Showing 28 changed files with 2,815 additions and 1,656 deletions.
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
language: python
sudo: false
cache: pip
git:
depth: 1
python:
- 2.7
- 3.6
Expand All @@ -14,7 +17,11 @@ install:
if [[ "$TRAVIS_PYTHON_VERSION" != "pypy" && "$TRAVIS_PYTHON_VERSION" != "pypy3" ]]; then
pip install 'pytest-cov>=1.8.0';
fi
- pip install -e .
- >
if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
pip install --upgrade setuptools;
fi
- pip install -e .[test] --upgrade
script:
- python -mwand.version --verbose
- >
Expand All @@ -24,4 +31,4 @@ script:
py.test --no-pdf --cov wand --boxed --durations=20;
fi
after_success:
- coveralls
- coveralls
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Wand_
=====

Wand is a ``ctypes``-based simple ImageMagick_ binding for Python,
supporting 2.6, 2.7, 3.2--3.5, and PyPy. Currently, not all
supporting 2.6, 2.7, 3.3+, and PyPy. Currently, not all
functionalities of MagickWand API are implemented in Wand yet.

You can install the package from PyPI_ by using ``pip``:
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Requirements
- Python 2.6 or higher

- CPython 2.6 or higher
- CPython 3.2 or higher
- CPython 3.3 or higher
- PyPy 1.5 or higher

- MagickWand library
Expand Down
5 changes: 3 additions & 2 deletions docs/roadmap.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
Roadmap
=======

Version 0.5
Version 0.6
-----------


Image layers (:issue:`22`)
Wand 0.5 will be able to deal with layers of an image.
Wand 0.6 will be able to deal with layers of an image.

Its branch name will be :branch:`layer`.

Expand Down
Empty file added docs/whatsnew/0.5.rst
Empty file.
2 changes: 1 addition & 1 deletion sample/android-resize-images.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@

for dpi, ratio in MANIFEST:
cimg = img.clone()
cimg.resize(int(width*ratio), int(height*ratio))
cimg.resize(int(width * ratio), int(height * ratio))
cimg.save(filename="res/drawable-%sdpi/%s" % (dpi, filename))
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ def run_tests(self):
raise SystemExit(errno)
cmdclass = {'test': pytest}

test_requires = [
'pytest >= 2.3.0',
'pytest-xdist >= 1.8',
'psutil >= 1.0.1'
]

setup(
name='Wand',
packages=['wand'],
packages=['wand', 'wand.cdefs'],
data_files=[('', ['README.rst'])],
version=VERSION,
description='Ctypes-based simple MagickWand API binding for Python',
long_description=readme(),
Expand All @@ -44,13 +50,8 @@ def run_tests(self):
maintainer='E. McConville',
maintainer_email='emcconville' '@' 'emcconville.com',
url='http://wand-py.org/',
tests_require=[
'pytest >= 2.3.0',
'pytest-xdist >= 1.8',
'memory_profiler >= 0.27',
'psutil >= 1.0.1'
],
extras_require={'doc': ['Sphinx >=1.0']},
tests_require=test_requires,
extras_require={'doc': ['Sphinx >=1.0'], 'test': test_requires},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
Expand All @@ -59,7 +60,6 @@ def run_tests(self):
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
Expand Down
22 changes: 15 additions & 7 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
import urllib2

from py.path import local
from pytest import fixture, mark, skip
from pytest import fixture, hookimpl, skip

from wand.display import display as display_fn
from wand.image import Image
from wand.version import MAGICK_VERSION, VERSION


def pytest_addoption(parser):
Expand All @@ -39,17 +40,24 @@ def pytest_runtest_setup(item):
skip('skipped; --skip-slow option is used')


@mark.tryfirst
def pytest_runtest_makereport(item, call, __multicall__):
@hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item, call):
"""Copied from http://pytest.org/dev/example/simple.html#making-test-result-information-available-in-fixtures
""" # noqa
# execute all other hooks to obtain the report object
rep = __multicall__.execute()
# set an report attribute for each phase of a call, which can
outcome = yield
rep = outcome.get_result()

# set a report attribute for each phase of a call, which can
# be "setup", "call", "teardown"
setattr(item, 'rep_' + rep.when, rep)
return rep

setattr(item, "rep_" + rep.when, rep)


def pytest_report_header(config):
versions = (VERSION, os.linesep, MAGICK_VERSION)
return "Wand Version: {0}{1}ImageMagick Version: {2}".format(*versions)


@fixture
Expand Down
Loading

0 comments on commit 040b59b

Please sign in to comment.