diff --git a/.gitignore b/.gitignore index fdbf6f7..3da9846 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ -*.egg-info/ -*.egg +*.egg* *.pyc .coverage +.tox/ +build/ cover/ dist/ diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..39922ef --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,4 @@ +include README.md +exclude .gitignore + +global-exclude *.pyc diff --git a/build/.gitignore b/build/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/build/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/doc/source/conf.py b/doc/source/conf.py index 5fc2532..01ebb88 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -3,7 +3,8 @@ # swagger-py documentation build configuration file, created by # sphinx-quickstart on Wed Oct 16 09:33:48 2013. # -# This file is execfile()d with the current directory set to its containing dir. +# 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. @@ -11,21 +12,24 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os - # 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. #sys.path.insert(0, os.path.abspath('.')) -# -- General configuration ----------------------------------------------------- +# -- 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.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo'] +# 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.doctest', + 'sphinx.ext.intersphinx', + 'sphinx.ext.todo' +] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -66,7 +70,8 @@ # directories to ignore when looking for source files. exclude_patterns = [] -# The reST default role (used for this markup: `text`) to use for all documents. +# The reST default role (used for this markup: `text`) to use for all +# documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. @@ -87,7 +92,7 @@ #modindex_common_prefix = [] -# -- Options for HTML output --------------------------------------------------- +# -- Options for HTML output -------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. @@ -167,9 +172,8 @@ htmlhelp_basename = 'swagger-pydoc' -# -- Options for LaTeX output -------------------------------------------------- +# -- Options for LaTeX output ------------------------------------------------- -latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', @@ -178,13 +182,15 @@ # Additional stuff for the LaTeX preamble. #'preamble': '', +latex_elements = { } # Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). +# (source start file, target name, title, author, documentclass +# [howto/manual]). latex_documents = [ - ('index', 'swagger-py.tex', u'swagger-py Documentation', - u'Digium, Inc.', 'manual'), + ('index', 'swagger-py.tex', u'swagger-py Documentation', + u'Digium, Inc.', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -208,7 +214,7 @@ #latex_domain_indices = True -# -- Options for manual page output -------------------------------------------- +# -- Options for manual page output ------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). @@ -221,15 +227,15 @@ #man_show_urls = False -# -- Options for Texinfo output ------------------------------------------------ +# -- 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 = [ - ('index', 'swagger-py', u'swagger-py Documentation', - u'Digium, Inc.', 'swagger-py', 'One line description of project.', - 'Miscellaneous'), + ('index', 'swagger-py', u'swagger-py Documentation', + u'Digium, Inc.', 'swagger-py', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/nose.cfg b/nose.cfg deleted file mode 100644 index ece87e0..0000000 --- a/nose.cfg +++ /dev/null @@ -1,13 +0,0 @@ -[nosetests] -cover-erase = True -cover-html = True -cover-inclusive = True -cover-package = swaggerpy -with-doctest = True -with-xunit = True -xunit-file = build/nosetests.xml -with-tissue = True -tissue-package = swaggerpy_test,swaggerpy -logging-level = DEBUG -nocapture = True -no-byte-compile = True diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d1b7668 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +requests +websocket-client diff --git a/setup.cfg b/setup.cfg index ed40864..3786480 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,4 +2,7 @@ description-file = README.md [nosetests] -config = nose.cfg +cover-package = swaggerpy +cover-html = true +cover-erase = true +verbosity=2 diff --git a/setup.py b/setup.py index d5eedcd..944ea59 100755 --- a/setup.py +++ b/setup.py @@ -26,9 +26,6 @@ "Operating System :: OS Independent", "Programming Language :: Python", ], - setup_requires=["nose>=1.3", "tissue"], - tests_require=["coverage", "httpretty"], - install_requires=["requests", "websocket-client"], entry_points=""" [console_scripts] swagger-codegen = swaggerpy.codegen:main diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..d07c20f --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,4 @@ +coverage +flake8 +httpretty +nose>=1.3 diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..225f589 --- /dev/null +++ b/tox.ini @@ -0,0 +1,23 @@ +[tox] +envlist = py27,pep8 + +[testenv] +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +commands = nosetests {posargs} + +[testenv:cover] +setenv = NOSE_WITH_COVERAGE=1 + +[testenv:pep8] +commands = + flake8 + +[testenv:venv] +commands = {posargs} + +[flake8] +builtins = _ +exclude = .git,.tox,dist,*lib/python*,*egg,build,tools +ignore = F401,F841 +show-source = True