diff --git a/.coveragerc b/.coveragerc index b9e814b7..9243caaa 100644 --- a/.coveragerc +++ b/.coveragerc @@ -9,3 +9,4 @@ exclude_lines = omit = weasyprint/tests/test_web/* weasyprint/tests/w3_test_suite/* + .* \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7b556dcb..649af903 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ # Building and Distributing /*.egg-info +/.eggs /build /dist /docs/_build diff --git a/.travis.yml b/.travis.yml index 62ac056d..f9cfa815 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ matrix: python: 3.4 - os: linux python: 3.5 + - os: linux + python: 3.6 - os: osx language: generic env: PYTHON_VERSION=3 @@ -32,9 +34,7 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python3 cairo pango gdk-pixbuf libxml2 libxslt libffi; fi install: - - pip$PYTHON_VERSION install --upgrade setuptools pytest flake8 - - pip$PYTHON_VERSION install -e . + - pip$PYTHON_VERSION install --upgrade -e.[test] script: - - python$PYTHON_VERSION -m pytest -s - - python$PYTHON_VERSION -m flake8 weasyprint + - python$PYTHON_VERSION setup.py test diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 254a0415..00000000 --- a/pytest.ini +++ /dev/null @@ -1,3 +0,0 @@ -[pytest] -norecursedirs=.git .tox venv env -addopts=--tb=short diff --git a/setup.cfg b/setup.cfg index 73754f05..57b535a2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,5 +2,9 @@ source-dir = docs build-dir = docs/_build -[flake8] -exclude = docs,.git,.tox +[aliases] +test = pytest + +[tool:pytest] +addopts = --cov +norecursedirs = dist .cache .git build *.egg-info .eggs venv diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index 4384f093..c31fdd30 --- a/setup.py +++ b/setup.py @@ -1,4 +1,6 @@ +#!/usr/bin/env python # coding: utf-8 + """ WeasyPrint ========== @@ -41,6 +43,10 @@ if sys.version_info < (3,): else: REQUIREMENTS.append('CairoSVG >= 1.0.20') + +needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv) +pytest_runner = ['pytest-runner'] if needs_pytest else [] + setup( name='WeasyPrint', version=VERSION, @@ -60,6 +66,7 @@ setup( 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Text Processing :: Markup :: HTML', 'Topic :: Multimedia :: Graphics :: Graphics Conversion', @@ -67,12 +74,16 @@ setup( ], packages=find_packages(), package_data={ - 'weasyprint.hyphenation': ['*.dic'], 'weasyprint.tests': ['resources/*.*', 'resources/*/*'], 'weasyprint.css': ['*.css']}, zip_safe=False, install_requires=REQUIREMENTS, + setup_requires=pytest_runner, test_suite='weasyprint.tests', + tests_require=[ + "pytest-runner", "pytest-cov", "pytest-flake8", "pytest-isort"], + extras_require={"test": [ + "pytest-runner", "pytest-cov", "pytest-flake8", "pytest-isort"]}, entry_points={ 'console_scripts': [ 'weasyprint = weasyprint.__main__:main',