Skip to content

Commit

Permalink
Update tests_require and 'test' extra.
Browse files Browse the repository at this point in the history
Don't install nose, upstream no longer supports. We were actually testing with zope.testrunner on travis and in tox.ini so use that.

make appveyor do the same.
  • Loading branch information
jamadden committed Jan 20, 2020
1 parent 3c0f7dc commit f3c34bc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ before_install:
install:
- pip install -U pip setuptools
- pip install -U coveralls coverage zope.testrunner
- pip install -U coveralls
- pip install -U -e ".[test]"

script:
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ install:
}
- ps: if (-not (Test-Path $env:PYTHON)) { throw "No $env:PYTHON" }
- echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat"
- pip install -e .
- pip install -e .[test]

build_script:
- pip install wheel
- python -W ignore setup.py -q bdist_wheel

test_script:
- python setup.py test -q
- zope-testrunner --test-path=src

artifacts:
- path: 'dist\*.whl'
Expand Down
29 changes: 15 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
##############################################################################
"""Setup for zope.i18nmessageid package
"""
from __future__ import print_function

import os
import sys
Expand All @@ -43,10 +44,6 @@
),
]

extra = {

}

ext_modules = []
if not is_pypy and not is_jython:
# Jython cannot build the C optimizations, while on PyPy they are
Expand All @@ -55,6 +52,11 @@
ext_modules = codeoptimization


tests_require = [
'zope.testrunner',
'coverage',
]

def read(*rnames):
with open(os.path.join(os.path.dirname(__file__), *rnames)) as stream:
return stream.read()
Expand All @@ -77,18 +79,17 @@ def build_extension(self, ext):
self._unavailable(e)

def _unavailable(self, e):
# Write directly to stderr to preserve compatibility with both
# Python 2.5 and 3.x, which is needed in setup.py.
sys.stderr.write('*' * 80 + '\n')
sys.stderr.write("""WARNING:
print('*' * 80, file=sys.stderr)
print("""WARNING:
An optional code optimization (C extension) could not be compiled.
Optimizations for this package will not be available!
""")
sys.stderr.write(str(e) + '\n')
sys.stderr.write('*' * 80 + '\n')
""", file=sys.stderr)
print(str(e), file=sys.stderr)
print('*' * 80, file=sys.stderr)



setup(
Expand Down Expand Up @@ -134,10 +135,10 @@ def _unavailable(self, e):
zip_safe=False,
cmdclass={'build_ext': optional_build_ext},
ext_modules=ext_modules,
tests_require=tests_require,
extras_require={
'testing': [
'nose', 'coverage'
],
'testing': tests_require,
'test': tests_require,
'docs': ['Sphinx'],
},
)
8 changes: 2 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ envlist =
[testenv]
deps =
.[test]
zope.testrunner
commands =
zope-testrunner --test-path=src []

Expand All @@ -15,11 +14,8 @@ usedevelop = true
basepython =
python2.7
commands =
nosetests --with-xunit --with-xcoverage
deps =
nose
coverage
nosexcover
coverage run -m zope.testrunner --test-path=src []
coverage report --fail-under=100

[testenv:docs]
basepython =
Expand Down

0 comments on commit f3c34bc

Please sign in to comment.