[Checkins] SVN: zope.filerepresentation/trunk/ Added Python 3 support and a little test that at least tries to import
Stephen Richter
cvs-admin at zope.org
Mon Feb 11 16:13:13 UTC 2013
Log message for revision 129263:
Added Python 3 support and a little test that at least tries to import
all the interfaces to make sure the syntax works in all Python versions.
Changed:
_U zope.filerepresentation/trunk/
A zope.filerepresentation/trunk/CHANGES.rst
D zope.filerepresentation/trunk/CHANGES.txt
A zope.filerepresentation/trunk/MANIFEST.in
A zope.filerepresentation/trunk/README.rst
D zope.filerepresentation/trunk/README.txt
U zope.filerepresentation/trunk/setup.py
U zope.filerepresentation/trunk/src/zope/filerepresentation/interfaces.py
A zope.filerepresentation/trunk/src/zope/filerepresentation/tests.py
A zope.filerepresentation/trunk/tox.ini
-=-
Property changes on: zope.filerepresentation/trunk
___________________________________________________________________
Modified: svn:ignore
- bin
build
dist
lib
develop-eggs
eggs
parts
.installed.cfg
+ .coverage
.tox
.installed.cfg
bin
build
dist
lib
develop-eggs
eggs
parts
*.xml
Copied: zope.filerepresentation/trunk/CHANGES.rst (from rev 129262, zope.filerepresentation/trunk/CHANGES.txt)
===================================================================
--- zope.filerepresentation/trunk/CHANGES.rst (rev 0)
+++ zope.filerepresentation/trunk/CHANGES.rst 2013-02-11 16:13:12 UTC (rev 129263)
@@ -0,0 +1,37 @@
+=======
+CHANGES
+=======
+
+4.0.0 (unreleased)
+------------------
+
+- aDded support for Python 3.2, 3.3 and PyPy.
+- Dropped support for Python 2.4 / 2.5.
+
+3.6.1 (2011-11-29)
+------------------
+
+- Add undeclared ``zope.schema`` dependency.
+- Remove ``zope.testing`` test dependency and ``test`` extra.
+
+3.6.0 (2009-10-08)
+------------------
+
+- Added `IRawReadFile` and `IRawWriteFile` interfaces. These extend `IReadFile` and
+ `IWritefile`, respectively, to behave pretty much like a standard Python file
+ object with a few embellishments. This in turn allows efficient, iterator-
+ based implementations of file reading and writing.
+
+- Removed dependency on ``zope.container``: `IReadDirectory` and `IWriteDirectory`
+ inherit only from interfaces defined in ``zope.interface`` and
+ ``zope.interface.common.mapping``.
+
+3.5.0 (2009-01-31)
+------------------
+
+- Changed use of ``zope.app.container`` to ``zope.container``.
+
+3.4.0 (2007-10-02)
+------------------
+
+- Initial Zope-independent release.
Deleted: zope.filerepresentation/trunk/CHANGES.txt
===================================================================
--- zope.filerepresentation/trunk/CHANGES.txt 2013-02-11 13:22:13 UTC (rev 129262)
+++ zope.filerepresentation/trunk/CHANGES.txt 2013-02-11 16:13:12 UTC (rev 129263)
@@ -1,36 +0,0 @@
-=======
-CHANGES
-=======
-
-4.0.0 (unreleased)
-------------------
-
-- Dropped support for Python 2.4 / 2.5.
-
-3.6.1 (2011-11-29)
-------------------
-
-- Add undeclared ``zope.schema`` dependency.
-- Remove ``zope.testing`` test dependency and ``test`` extra.
-
-3.6.0 (2009-10-08)
-------------------
-
-- Added `IRawReadFile` and `IRawWriteFile` interfaces. These extend `IReadFile` and
- `IWritefile`, respectively, to behave pretty much like a standard Python file
- object with a few embellishments. This in turn allows efficient, iterator-
- based implementations of file reading and writing.
-
-- Removed dependency on ``zope.container``: `IReadDirectory` and `IWriteDirectory`
- inherit only from interfaces defined in ``zope.interface`` and
- ``zope.interface.common.mapping``.
-
-3.5.0 (2009-01-31)
-------------------
-
-- Changed use of ``zope.app.container`` to ``zope.container``.
-
-3.4.0 (2007-10-02)
-------------------
-
-- Initial Zope-independent release.
Added: zope.filerepresentation/trunk/MANIFEST.in
===================================================================
--- zope.filerepresentation/trunk/MANIFEST.in (rev 0)
+++ zope.filerepresentation/trunk/MANIFEST.in 2013-02-11 16:13:12 UTC (rev 129263)
@@ -0,0 +1,6 @@
+include *.rst
+include *.txt
+
+recursive-include src *
+
+global-exclude *.pyc
Copied: zope.filerepresentation/trunk/README.rst (from rev 129262, zope.filerepresentation/trunk/README.txt)
===================================================================
--- zope.filerepresentation/trunk/README.rst (rev 0)
+++ zope.filerepresentation/trunk/README.rst 2013-02-11 16:13:12 UTC (rev 129263)
@@ -0,0 +1,12 @@
+==============================
+File Representation Interfaces
+==============================
+
+Overview
+--------
+
+File-system representation interfaces.
+
+The interfaces defined here are used for file-system and file-system-like
+representations of objects, such as file-system synchronization, FTP, PUT, and
+WebDAV.
Deleted: zope.filerepresentation/trunk/README.txt
===================================================================
--- zope.filerepresentation/trunk/README.txt 2013-02-11 13:22:13 UTC (rev 129262)
+++ zope.filerepresentation/trunk/README.txt 2013-02-11 16:13:12 UTC (rev 129263)
@@ -1,12 +0,0 @@
-==============================
-File Representation Interfaces
-==============================
-
-Overview
---------
-
-File-system representation interfaces.
-
-The interfaces defined here are used for file-system and file-system-like
-representations of objects, such as file-system synchronization, FTP, PUT, and
-WebDAV.
Modified: zope.filerepresentation/trunk/setup.py
===================================================================
--- zope.filerepresentation/trunk/setup.py 2013-02-11 13:22:13 UTC (rev 129262)
+++ zope.filerepresentation/trunk/setup.py 2013-02-11 16:13:12 UTC (rev 129263)
@@ -30,9 +30,9 @@
author_email='zope-dev at zope.org',
description='File-system Representation Interfaces',
long_description=(
- read('README.txt')
+ read('README.rst')
+ '\n\n' +
- read('CHANGES.txt')
+ read('CHANGES.rst')
),
keywords="zope3 filesystem representation",
classifiers=[
@@ -44,6 +44,8 @@
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.3',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
@@ -58,5 +60,6 @@
'zope.schema',
],
include_package_data=True,
+ test_suite='zope.filerepresentation.tests.test_suite',
zip_safe=True,
)
Modified: zope.filerepresentation/trunk/src/zope/filerepresentation/interfaces.py
===================================================================
--- zope.filerepresentation/trunk/src/zope/filerepresentation/interfaces.py 2013-02-11 13:22:13 UTC (rev 129262)
+++ zope.filerepresentation/trunk/src/zope/filerepresentation/interfaces.py 2013-02-11 16:13:12 UTC (rev 129263)
@@ -112,7 +112,7 @@
class ICommonFileOperations(Interface):
"""Common file operations used by IRawReadFile and IRawWriteFile
"""
-
+
mimeType = schema.ASCIILine(
title=u"File MIME type",
description=u"Provided if it makes sense for this file data" +
@@ -121,7 +121,7 @@
u"file that is not writable.",
readonly=True,
)
-
+
encoding = schema.Bool(
title=u"The encoding that this file uses",
description=u"Provided if it makes sense for this file data" +
@@ -130,12 +130,12 @@
u"file that is not writable.",
required=False,
)
-
+
closed = schema.Bool(
title=u"Is the file closed?",
required=True,
)
-
+
name = schema.TextLine(
title=u"A representative file name",
description=u"Provided if it makes sense for this file data" +
@@ -149,11 +149,11 @@
"""Seek the file. See Python documentation for ``file`` for
details.
"""
-
+
def tell():
"""Return the file's current position.
"""
-
+
def close():
"""Close the file. See Python documentation for ``file`` for
details.
@@ -163,29 +163,29 @@
"""Specialisation of IReadFile to make it act more like a Python file
object.
"""
-
+
def read(size=None):
"""Read at most ``size`` bytes of file data. If ``size`` is None,
return all the file data.
"""
-
+
def readline(size=None):
"""Read one entire line from the file. See Python documentation for
``file`` for details.
"""
-
+
def readlines(sizehint=None):
"""Read until EOF using readline() and return a list containing the
lines thus read. See Python documentation for ``file`` for details.
"""
-
+
def __iter__():
"""Return an iterator for the file.
-
+
Note that unlike a Python standard ``file``, this does not necessarily
have to return data line-by-line if doing so is inefficient.
"""
-
+
def next():
"""Iterator protocol. See Python documentation for ``file`` for
details.
@@ -195,22 +195,22 @@
"""Specialisation of IWriteFile to make it act more like a Python file
object.
"""
-
+
def write(data):
"""Write a chunk of data to the file. See Python documentation for
``file`` for details.
"""
-
+
def writelines(sequence):
"""Write a sequence of strings to the file. See Python documentation
for ``file`` for details.
"""
-
+
def truncate(size):
"""Truncate the file. See Python documentation for ``file`` for
details.
"""
-
+
def flush():
"""Flush the file. See Python documentation for ``file`` for details.
"""
Added: zope.filerepresentation/trunk/src/zope/filerepresentation/tests.py
===================================================================
--- zope.filerepresentation/trunk/src/zope/filerepresentation/tests.py (rev 0)
+++ zope.filerepresentation/trunk/src/zope/filerepresentation/tests.py 2013-02-11 16:13:12 UTC (rev 129263)
@@ -0,0 +1,28 @@
+##############################################################################
+#
+# Copyright (c) 2013 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Test Setup"""
+import unittest
+
+class Test(unittest.TestCase):
+
+ def testImports(self):
+ # Just test that the interfaces import, which should provide full
+ # coverage.
+ from zope.filerepresentation import interfaces
+
+def test_suite():
+ loader=unittest.TestLoader()
+ return unittest.TestSuite((
+ loader.loadTestsFromTestCase(Test),
+ ))
Property changes on: zope.filerepresentation/trunk/src/zope/filerepresentation/tests.py
___________________________________________________________________
Added: svn:keywords
+ Id
Added: zope.filerepresentation/trunk/tox.ini
===================================================================
--- zope.filerepresentation/trunk/tox.ini (rev 0)
+++ zope.filerepresentation/trunk/tox.ini 2013-02-11 16:13:12 UTC (rev 129263)
@@ -0,0 +1,27 @@
+[tox]
+envlist =
+ py26,py27,py33,pypy
+
+[testenv]
+commands =
+ python setup.py test -q
+# without explicit deps, setup.py test will download a bunch of eggs into $PWD
+deps =
+ zope.interface
+ zope.schema
+ zope.testing
+
+[testenv:coverage]
+basepython =
+ python2.7
+commands =
+# The installed version messes up nose's test discovery / coverage reporting
+# So, we uninstall that from the environment, and then install the editable
+# version, before running nosetests.
+ pip uninstall -y zope.filerepresentation
+ pip install -e .
+ nosetests --with-xunit --with-xcoverage
+deps =
+ nose
+ coverage
+ nosexcover
More information about the checkins
mailing list