diff --git a/.appveyor.yml b/.appveyor.yml index deaf503b7..a3f83394f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -18,8 +18,8 @@ environment: install: - C:\Python%PYTHON%\python.exe -m pip install -U pip setuptools - - C:\Python%PYTHON%\python.exe -m pip install docutils==%DOCUTILS% - - C:\Python%PYTHON%\python.exe -m pip install -r test-reqs.txt + - C:\Python%PYTHON%\python.exe -m pip install docutils==%DOCUTILS% mock + - C:\Python%PYTHON%\python.exe -m pip install .[test,websupport] # No automatic build, just run python tests build: off diff --git a/.travis.yml b/.travis.yml index 6df4f7cfb..73fd9c459 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,8 @@ addons: install: - pip install -U pip setuptools - pip install docutils==$DOCUTILS - - pip install -r test-reqs.txt + - pip install .[test,websupport] + - pip install flake8 - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then python3.6 -m pip install mypy typed-ast; fi script: - flake8 diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index eca6a01ac..7c8a90c6b 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -116,7 +116,7 @@ These are the basic steps needed to start developing on Sphinx. * Run the unit tests:: - pip install -r test-reqs.txt + pip install .[test,websupport] make test * Again, it's useful to turn on deprecation warnings on so they're shown in diff --git a/MANIFEST.in b/MANIFEST.in index 1530c28cd..a5699c23c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -12,7 +12,6 @@ include sphinx-autogen.py include sphinx-build.py include sphinx-quickstart.py include sphinx-apidoc.py -include test-reqs.txt include tox.ini include sphinx/locale/.tx/config diff --git a/setup.py b/setup.py index cec86eed9..a4dd6b078 100644 --- a/setup.py +++ b/setup.py @@ -69,19 +69,19 @@ extras_require = { ], 'test': [ 'pytest', - 'mock', # it would be better for 'test:python_version in 2.7' - 'simplejson', # better: 'test:platform_python_implementation=="PyPy"' + 'pytest-cov', 'html5lib', ], + 'test:python_version<"3"': [ + 'enum34', + 'mock', + ], + 'test:python_version>="3"': [ + 'mypy', + 'typed_ast', + ], } -# for sdist installation with pip-1.5.6 -if sys.platform == 'win32': - requires.append('colorama>=0.3.5') - -if sys.version_info < (3, 5): - requires.append('typing') - # Provide a "compile_catalog" command that also creates the translated # JavaScript files if Babel is available. @@ -90,10 +90,7 @@ cmdclass = {} try: from babel.messages.pofile import read_po from babel.messages.frontend import compile_catalog - try: - from simplejson import dump - except ImportError: - from json import dump + from json import dump except ImportError: pass else: diff --git a/test-reqs.txt b/test-reqs.txt deleted file mode 100644 index 3a7bde8ea..000000000 --- a/test-reqs.txt +++ /dev/null @@ -1,20 +0,0 @@ -flake8 -pytest>=3.0 -pytest-cov -mock -six>=1.4 -Jinja2>=2.3 -Pygments>=2.0 -docutils>=0.11 -snowballstemmer>=1.1 -babel -sqlalchemy>=0.9 -whoosh>=2.0 -alabaster -sphinx_rtd_theme -sphinxcontrib-websupport -imagesize -requests -html5lib -enum34 -typing diff --git a/tox.ini b/tox.ini index 519020f98..00b3c99e2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,16 +1,15 @@ [tox] -envlist=flake8,py27,py34,py35,py36,pypy,du14,du13,du12,du11 +minversion=2.0 +envlist=flake8,mypy,py{27,34,35,36},pypy,du{11,12,13,14} [testenv] passenv = https_proxy http_proxy no_proxy -deps= - six - pytest - pytest-cov - html5lib - mock - enum34 - typing +# TODO(stephenfin) Replace this with the 'extras' config option when tox 2.4 is +# widely available, likely some time after the Ubuntu 18.04 release +# +# https://tox.readthedocs.io/en/latest/config.html#confval-extras=MULTI-LINE-LIST +deps = + .[test,websupport] setenv = SPHINX_TEST_TEMPDIR = {envdir}/testbuild commands= @@ -18,11 +17,6 @@ commands= --durations 25 {posargs} sphinx-build -q -W -b html -d {envtmpdir}/doctrees doc {envtmpdir}/html -[testenv:pypy] -deps= - simplejson - {[testenv]deps} - [testenv:du11] deps= docutils==0.11 @@ -59,10 +53,6 @@ deps= {[testenv]deps} [testenv:py35] -deps= - mypy - typed_ast - {[testenv]deps} commands= {envpython} -Wall tests/run.py --cov=sphinx --durations 25 {posargs} sphinx-build -q -W -b html -d {envtmpdir}/doctrees doc {envtmpdir}/html