Skip to content

Commit

Permalink
Add Python 3.6, drop Python 3.3
Browse files Browse the repository at this point in the history
- Badges
- Universal wheels
- Run doctests on all Python versions
- Enable coverage and coveralls
  - Only 77% covered.
- Enable PyPy and PyPy3 on Travis.
  • Loading branch information
jamadden committed Aug 21, 2017
1 parent aafd3d5 commit a4c23d1
Show file tree
Hide file tree
Showing 14 changed files with 137 additions and 68 deletions.
11 changes: 11 additions & 0 deletions .coveragerc
@@ -0,0 +1,11 @@
[run]
source = zope.structuredtext

[report]
precision = 2
exclude_lines =
pragma: no cover
if __name__ == '__main__':
raise NotImplementedError
self.fail
raise AssertionError
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -14,3 +14,4 @@ docs/_build
.coverage
coverage.xml
nosetests.xml
htmlcov/
17 changes: 11 additions & 6 deletions .travis.yml
Expand Up @@ -2,15 +2,20 @@ language: python
sudo: false
python:
- 2.7
- 3.3
- 3.4
- 3.5
# Pending normalization of HTML output for regressions.
# - pypy
# - pypy3
- 3.6
- pypy
- pypy3.5-5.8.0
install:
- pip install .
- pip install -U pip setuptools
- pip install -U coverage coveralls
- pip install -U -e .[test,docs]
script:
- python setup.py test -q
- coverage run -m zope.testrunner --test-path=src
- coverage run -a -m sphinx -b doctest -d docs/_build/doctrees docs docs/_build/doctest
after_success:
- coveralls
notifications:
email: false
cache: pip
25 changes: 13 additions & 12 deletions CHANGES.rst
@@ -1,16 +1,17 @@
Changes
=======
=========
Changes
=========

4.2.0 (unreleased)
------------------
==================

- Add support for Python 3.5.
- Add support for Python 3.5 and 3.6.

- Drop support for Python 2.6.
- Drop support for Python 2.6 and 3.3.


4.1.0 (2014-12-29)
------------------
==================

- Drop dependency on ``six``.

Expand All @@ -20,36 +21,36 @@ Changes


4.0.0 (2013-02-25)
------------------
==================

- Add support for Python 3.3.

- Drop support for Python 2.4 and 2.5.


3.5.1 (2010-12-03)
------------------
==================

- Remove antique copyright assertions in regression texts, in conformance
with repository policy.


3.5.0 (2010-04-30)
------------------
==================

- Update docs to conform to ZTK / Sphinx usage.

- LP #120376: Output valid html for non-ASCII characters.


3.4.0 (2007/09/01)
------------------
==================

- Public release for completeness of Zope 3.4.


3.2.0 (2006/01/05)
------------------
==================

- Corresponds to the verison of the ``zope.structuredtext`` package shipped
as part of the Zope 3.2.0 release.
Expand All @@ -58,7 +59,7 @@ Changes


3.0.0 (2004/11/07)
------------------
==================

- Corresponds to the verison of the ``zope.structuredtext`` package shipped
as part of the Zope X3.0.0 release.
1 change: 1 addition & 0 deletions MANIFEST.in
Expand Up @@ -4,6 +4,7 @@ include *.py
include buildout.cfg
include tox.ini
include .travis.yml
include .coveragerc

recursive-include src *

Expand Down
26 changes: 17 additions & 9 deletions README.rst
@@ -1,19 +1,27 @@
``zope.structuredtext``
=======================
=========================
``zope.structuredtext``
=========================

.. image:: https://pypip.in/version/zope.structuredtext/badge.svg?style=flat
:target: https://pypi.python.org/pypi/zope.structuredtext/
:alt: Latest Version
.. image:: https://img.shields.io/pypi/v/zope.ramcache.svg
:target: https://pypi.python.org/pypi/zope.ramcache/
:alt: Latest release

.. image:: https://travis-ci.org/zopefoundation/zope.structuredtext.png?branch=master
:target: https://travis-ci.org/zopefoundation/zope.structuredtext
.. image:: https://img.shields.io/pypi/pyversions/zope.ramcache.svg
:target: https://pypi.org/project/zope.ramcache/
:alt: Supported Python versions

.. image:: https://travis-ci.org/zopefoundation/zope.ramcache.png?branch=master
:target: https://travis-ci.org/zopefoundation/zope.ramcache

.. image:: https://coveralls.io/repos/github/zopefoundation/zope.ramcache/badge.svg?branch=master
:target: https://coveralls.io/github/zopefoundation/zope.ramcache?branch=master

.. image:: https://readthedocs.org/projects/zopestructuredtext/badge/?version=latest
:target: http://zopestructuredtext.readthedocs.org/en/latest/
:target: https://zopestructuredtext.readthedocs.org/en/latest/
:alt: Documentation Status

This package provides a parser and renderers for the classic Zope
"structured text" markup dialect (STX). STX is a plain text markup in
which document structure is signalled primarily by indentation

Please see ``docs/index.rst`` for the documentation.
Please see https://zopestructuredtext.readthedocs.org/ for documentation.
Empty file removed docs/_static/.gitignore
Empty file.
19 changes: 10 additions & 9 deletions docs/api.rst
@@ -1,50 +1,51 @@
:mod:`zope.structuredtext` API
==============================
================================
:mod:`zope.structuredtext` API
================================

:mod:`zope.structuredtext.document`
-----------------------------------
===================================

.. automodule:: zope.structuredtext.document
:members:


:mod:`zope.structuredtext.stletters`
------------------------------------
====================================

.. automodule:: zope.structuredtext.stletters
:members:


:mod:`zope.structuredtext.stng`
-------------------------------
===============================

.. automodule:: zope.structuredtext.stng
:members:


:mod:`zope.structuredtext.stdom`
--------------------------------
================================

.. automodule:: zope.structuredtext.stdom
:members:


:mod:`zope.structuredtext.html`
-------------------------------
===============================

.. automodule:: zope.structuredtext.html
:members:


:mod:`zope.structuredtext.docbook`
----------------------------------
==================================

.. automodule:: zope.structuredtext.docbook
:members:


:mod:`zope.structuredtext`
--------------------------
==========================

.. automodule:: zope.structuredtext
:members:
1 change: 1 addition & 0 deletions docs/changelog.rst
@@ -0,0 +1 @@
.. include:: ../CHANGES.rst
30 changes: 26 additions & 4 deletions docs/conf.py
Expand Up @@ -11,7 +11,9 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os, pkg_resources
import os
import sys
import pkg_resources

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand All @@ -26,6 +28,9 @@
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.extlinks',
]

# Add any paths that contain templates here, relative to this directory.
Expand All @@ -47,11 +52,11 @@
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#

# The short X.Y version.
version = '3.5.0'
version = '%s.%s' % tuple(map(int, rqmt.version.split('.')[:2]))
# The full version, including alpha/beta/rc tags.
release = '3.5.0'
release = rqmt.version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -196,3 +201,20 @@

# If false, no module index is generated.
#latex_use_modindex = True

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'https://docs.python.org/': None,
}

extlinks = {'issue': ('https://github.com/zopefoundation/zope.structuredtext/issues/%s',
'issue #'),
'pr': ('https://github.com/zopefoundation/zope.structuredtext/pull/%s',
'pull request #')}

autodoc_default_flags = [
'members',
'show-inheritance',
]
autoclass_content = 'both'
autodoc_member_order = 'bysource'
30 changes: 17 additions & 13 deletions docs/index.rst
@@ -1,8 +1,11 @@
:mod:`zope.structuredtext` Documentation
========================================
==========================================
:mod:`zope.structuredtext` Documentation
==========================================

.. currentmodule:: zope.restructuredtext

Using Structured Text
---------------------
=====================

The goal of StructuredText is to make it possible to express
structured text using a relatively simple plain text format. Simple
Expand All @@ -14,26 +17,26 @@ structure is inspired by the Python programming language.

Use of StructuredText consists of one to three logical steps. In the
first step, a text string is converted to a network of objects using
the :func:`structurize` facility, as in the following example:
the :func:`~.structurize` facility, as in the following example:

.. code-block:: python
raw = open("mydocument.txt").read()
from zope.structuredtext.stng import structurize
st = structurize(raw)
The output of :func:`structurize` is simply a :class:`StructuredTextDocument`
object containing :class:`StructuredTextParagraph` objects arranged in a
The output of :func:`~.structurize` is simply a :class:`~.StructuredTextDocument`
object containing :class:`~.StructuredTextParagraph` objects arranged in a
hierarchy. Paragraphs are delimited by strings of two or more
whitespace characters beginning and ending with newline
characters. Hierarchy is indicated by indentation. The indentation
of a paragraph is the minimum number of leading spaces in a line
containing non-white-space characters after converting tab
characters to spaces (assuming a tab stop every eight characters).

:class:`StructuredTextNode` objects support the read-only subset of the
:class:`~.StructuredTextNode` objects support the read-only subset of the
Document Object Model (DOM) API. It should be possible to process
:class:`StructuredTextNode` hierarchies using XML tools such as XSLT.
:class:`~.StructuredTextNode` hierarchies using XML tools such as XSLT.

The second step in using StructuredText is to apply additional
structuring rules based on text content. A variety of differentText
Expand Down Expand Up @@ -77,7 +80,7 @@ Language (HTML) text:
Customizing the document processor
----------------------------------
==================================

The document processor is driven by two tables. The first table,
named ``paragraph_types``, is a sequence of callable objects or method
Expand All @@ -95,7 +98,7 @@ examples.

A paragraph type may return a list or tuple of replacement
paragraphs, this allowing a paragraph to be split into multiple
paragraphs.
paragraphs.

The second table, ``text_types``, is a sequence of callable objects or
method names for coloring text. The callable objects in this table
Expand Down Expand Up @@ -124,11 +127,12 @@ Contents:
:maxdepth: 2

api
changelog

Indices and tables
==================
====================
Indices and tables
====================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

3 changes: 3 additions & 0 deletions setup.cfg
Expand Up @@ -6,3 +6,6 @@ cover-erase=1
#cover-min-percentage=100
with-doctest=0
where=src

[bdist_wheel]
universal = 1

0 comments on commit a4c23d1

Please sign in to comment.