Skip to content

Commit

Permalink
Merge pull request #9 from NextThought/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
jamadden committed Oct 23, 2017
2 parents 85916c7 + 01974fd commit 4e48341
Show file tree
Hide file tree
Showing 20 changed files with 787 additions and 442 deletions.
16 changes: 1 addition & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,7 @@
.project
*.egg-info
*.pyc
*.sublime-*
.coverage
htmlcov/
bin/
develop-eggs/
dist/
eggs/
include/
lib/
parts/

doc/_build
doc/__pycache__
doc/relstorage.*.rst
doc/changelog.rst
/.settings/
/.eggs/
/build/
docs/_build/
13 changes: 13 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
multi_line_output = 5
# Do not allow grouped imports
force_single_line = True
line_length = 100
forced_separate = hamcrest
known_third_party = zope, hamcrest
known_first_party = nti
default_section = THIRDPARTY
order_by_type = True
atomic = True
import_heading_stdlib = stdlib imports
force_sort_within_sections = True
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
2.0.2 (unreleased)
==================

- Nothing changed yet.
- Make ``Acquisition`` an optional dependency. If it is not installed,
the ``aq_inContextOf`` matcher will always return False.


2.0.1 (2017-10-18)
Expand Down
21 changes: 15 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,28 @@
nti.testing
=============

.. image:: https://img.shields.io/pypi/v/nti.testing.svg
:target: https://pypi.python.org/pypi/nti.testing/
:alt: Latest release

.. image:: https://img.shields.io/pypi/pyversions/nti.testing.svg
:target: https://pypi.org/project/nti.testing/
:alt: Supported Python versions

.. image:: https://travis-ci.org/NextThought/nti.testing.svg?branch=master
:target: https://travis-ci.org/NextThought/nti.testing
:target: https://travis-ci.org/NextThought/nti.testing

.. image:: https://coveralls.io/repos/github/NextThought/nti.testing/badge.svg
:target: https://coveralls.io/github/NextThought/nti.testing
:target: https://coveralls.io/github/NextThought/nti.testing

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

:target: http://ntitesting.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

Support for writing tests, particularly in a Zope3/ZTK environment,
using either nose2 or zope.testing.
using zope.testing (nose2 may also work, but is not recommended).

Complete documentation is hosted at https://ntitesting.readthedocs.io/

Installation
============
Expand Down
1 change: 1 addition & 0 deletions doc-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.[docs]
5 changes: 5 additions & 0 deletions docs/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
==================
nti.testing.base
==================

.. automodule:: nti.testing.base
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: ../CHANGES.rst
181 changes: 181 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# -*- coding: utf-8 -*-
#
# nti.testing documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 8 07:02:25 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# 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
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import os
import sys
import pkg_resources
sys.path.append(os.path.abspath('../src'))
rqmt = pkg_resources.require('nti.testing')[0]

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'nti.testing'
copyright = u'2017, NextThought'
author = u'NextThought'

# 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 = '%s.%s' % tuple(map(int, rqmt.version.split('.')[:2]))
# The full version, including alpha/beta/rc tags.
release = rqmt.version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'ntitestingdoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'ntitesting.tex', u'nti.testing Documentation',
u'NextThought', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'ntitesting', u'nti.testing Documentation',
[author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'ntitesting', u'nti.testing Documentation',
author, 'ntitesting', 'One line description of project.',
'Miscellaneous'),
]




# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'http://docs.python.org/': None,
'http://zopecomponent.readthedocs.io/en/latest': None,
'http://zopeconfiguration.readthedocs.io/en/latest': None,
}

extlinks = {
'issue': ('https://github.com/NextThought/nti.testing/issues/%s',
'issue #'),
'pr': ('https://github.com/NextThought/nti.testing/pull/%s',
'pull request #')}

autodoc_default_flags = ['members', 'show-inheritance']
autoclass_content = 'both'
autodoc_member_order = 'bysource'
20 changes: 20 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

.. include:: ../README.rst

.. toctree::
:maxdepth: 2
:caption: Contents:

base
layers
matchers
time
changelog


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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
5 changes: 5 additions & 0 deletions docs/layers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
====================
nti.testing.layers
====================

.. automodule:: nti.testing.layers
5 changes: 5 additions & 0 deletions docs/matchers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
======================
nti.testing.matchers
======================

.. automodule:: nti.testing.matchers
5 changes: 5 additions & 0 deletions docs/time.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
==================
nti.testing.time
==================

.. automodule:: nti.testing.time
37 changes: 21 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
from setuptools import setup, find_packages
# Copyright 2017 NextThought
# Released under the terms of the LICENSE file.
import codecs
from setuptools import setup, find_packages


version = '2.0.2.dev0'

entry_points = {
}

TESTS_REQUIRE = [
'nose2[coverage_plugin]',
'Acquisition',
'zope.site',
'zope.testrunner',
]
Expand All @@ -17,16 +20,16 @@ def _read(fname):
return f.read()

setup(
name = 'nti.testing',
version = version,
author = 'Jason Madden',
author_email = 'jason@nextthought.com',
description = "Support for testing code",
long_description = _read('README.rst') + '\n\n' + _read('CHANGES.rst'),
license = 'Apache',
keywords = 'nose2 testing zope3 ZTK hamcrest',
url = 'https://github.com/NextThought/nti.testing',
classifiers = [
name='nti.testing',
version=version,
author='Jason Madden',
author_email='jason@nextthought.com',
description="Support for testing code",
long_description=_read('README.rst') + '\n\n' + _read('CHANGES.rst'),
license='Apache',
keywords='nose2 testing zope3 ZTK hamcrest',
url='https://github.com/NextThought/nti.testing',
classifiers=[
'Intended Audience :: Developers',
'Natural Language :: English',
'Operating System :: OS Independent',
Expand All @@ -39,14 +42,13 @@ def _read(fname):
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Testing',
'Framework :: Zope3',
],
],
zip_safe=True,
packages=find_packages('src'),
package_dir={'': 'src'},
namespace_packages=['nti'],
install_requires=[
'zope.interface >= 4.1.2', # Listing first to work around a Travis CI issue
'Acquisition',
'fudge',
'pyhamcrest',
'six',
Expand All @@ -60,8 +62,11 @@ def _read(fname):
],
entry_points=entry_points,
include_package_data=True,
test_suite="nti.testing.tests.test_main.test_suite",
extras_require={
'test': TESTS_REQUIRE
'test': TESTS_REQUIRE,
'docs': [
'Sphinx',
'sphinx_rtd_theme',
],
},
)
5 changes: 1 addition & 4 deletions src/nti/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
__import__('pkg_resources').declare_namespace(__name__)
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover

0 comments on commit 4e48341

Please sign in to comment.