Skip to content

Commit

Permalink
Add tox.ini and configure TravisCI + Coveralls. (#4)
Browse files Browse the repository at this point in the history
* Add tox.ini and configure TravisCI + Coveralls.

* Run tests against Zope 4 thus require at least Zope 4.
  • Loading branch information
Michael Howitz committed Mar 21, 2018
1 parent 7ee8007 commit c498cb6
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 14 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
branch = True
source = Products.CMFUid

[report]
precision = 2
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
*.mo
*.pyc
*.pyo
.coverage
.coverage.*
.eggs
.installed.cfg
.mr.developer.cfg
.tox/
bin
build
coverage.xml
develop-eggs
dist
downloads
eggs
htmlcov/
local.cfg
parts
var
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: python
sudo: false
python:
- 2.7
install:
- pip install coveralls coverage
- pip install -U setuptools==33.1.1
- pip install zc.buildout
- buildout bootstrap
- buildout
script:
- coverage run bin/test --all -v
after_success:
- coveralls
notifications:
email: false
cache:
pip: true
directories:
- eggs/
8 changes: 4 additions & 4 deletions Products/CMFUid/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Products.CMFUid Changelog
=========================

2.3.0 (unreleased)
------------------
3.0 (unreleased)
----------------

- Require `Zope >= 4`.

- Prepare for Python 2 / 3 compatibility.
[pbauer]

- Fix import for compatibility with Zope 4.

- Adapt tests to the new indexing operations queueing.
Part of PLIP 1343: https://github.com/plone/Products.CMFPlone/issues/1343
[gforcada]
Expand Down
2 changes: 1 addition & 1 deletion Products/CMFUid/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.0.dev0
3.0.dev0
9 changes: 9 additions & 0 deletions buildout.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[buildout]
extends = https://raw.githubusercontent.com/zopefoundation/Zope/master/versions.cfg
develop = .
parts = test

[test]
recipe = zc.recipe.testrunner
eggs = Products.CMFUid
script = test
24 changes: 15 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
package = os.path.join(here, 'Products', NAME)

def _package_doc(name):
f = open(os.path.join(package, name))
return f.read()
with open(os.path.join(package, name)) as f:
return f.read()

_boundary = '\n' + ('-' * 60) + '\n\n'
README = ( _package_doc('README.txt')
Expand All @@ -26,29 +26,35 @@ def _package_doc(name):
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: Plone",
"Framework :: Zope2",
"Framework :: Zope :: 4",
"Intended Audience :: Developers",
"License :: OSI Approved :: Zope Public License",
"Programming Language :: Python",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries :: Application Frameworks",
],
keywords='web application server zope zope2 cmf',
keywords='web application server zope cmf',
author="Zope Foundation and Contributors",
author_email="zope-cmf@zope.org",
url="http://pypi.python.org/pypi/Products.CMFUid",
license="ZPL 2.1 (http://www.zope.org/Resources/License/ZPL-2.1)",
url="https://github.com/zopefoundation/Products.CMFUid",
license="ZPL 2.1",
packages=find_packages(),
include_package_data=True,
namespace_packages=['Products'],
zip_safe=False,
setup_requires=['eggtestinfo',
],
install_requires=[
'setuptools',
'Zope2 >= 2.13.12',
'Products.CMFCore',
'Products.BTreeFolder2 >= 4.0.dev0',
'Products.CMFCore >= 2.4.0b3',
'Products.GenericSetup',
'Products.ZCTextIndex >= 4.0.dev0',
'Products.ZCatalog >= 4.0.dev0',
'Products.ZSQLMethods >= 3.0.dev0',
'Zope',
'Products.GenericSetup >= 1.10.0.dev0',
'Products.MailHost >= 4.0.dev0',
'setuptools',
],
tests_require=[
'zope.testing >= 3.7.0',
Expand Down
29 changes: 29 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[tox]
envlist =
py27,
coverage-report,

[testenv]
skip_install = true
commands =
{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} bootstrap
{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir}
coverage run {envbindir}/test --all {posargs:-vc}
deps =
zc.buildout
coverage
setenv =
COVERAGE_FILE=.coverage.{envname}

[testenv:coverage-report]
basepython = python2.7
deps = coverage
setenv =
COVERAGE_FILE=.coverage
skip_install = true
commands =
coverage erase
coverage combine
coverage html -i
coverage xml -i
coverage report -i

0 comments on commit c498cb6

Please sign in to comment.