Skip to content

Commit

Permalink
refactor: files
Browse files Browse the repository at this point in the history
  • Loading branch information
h2non committed Oct 31, 2016
1 parent 2d367e5 commit 0df2b13
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 25 deletions.
4 changes: 2 additions & 2 deletions History.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
History
=======

0.1.0 (2016-10-10)
0.1.0 (2016-11-01)
-----------------

* First version.
- First version.
25 changes: 16 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
pook |Build Status| |PyPI| |Coverage Status| |Documentation Status|
===================================================================
pook |Build Status| |PyPI| |Coverage Status| |Documentation Status| |Stability| |Quality| |Versions|
====================================================================================================

Simply and expressive utility library for mocking and expectations for
HTTP traffic in `Python`_.

Small and dependency-free package to infer file type and MIME type
checking the `magic numbers`_ signature of a file or buffer.
Expressive utility library for HTTP traffic mocking and expectations made simply in `Python`_.

pook is heavily inspired by `gock`_.

**Note**: this is a work in progress.
**Note**: work in progress.

Features
--------

- Simple, expressive and fluent API
- Full-featured, idiomatic HTTP expectations.
- JSON schema based body matching.
- Extensible: write your own HTTP expections.
- HTTP client agnostic (works with most popular HTTP libraries).
- Extensible design: write your own HTTP matchers and adapters.
- Pluggable hackable API.
- Compatible with Python 2 and 3.
- Dependency free.

Supported HTTP clients
----------------------
Expand Down Expand Up @@ -105,6 +102,7 @@ MIT - Tomas Aparicio
.. _gock: https://github.com/h2non/gock
.. _annotated API reference: https://h2non.github.io/pook


.. |Build Status| image:: https://travis-ci.org/h2non/pook.svg?branch=master
:target: https://travis-ci.org/h2non/pook
.. |PyPI| image:: https://img.shields.io/pypi/v/pook.svg?maxAge=2592000?style=flat-square
Expand All @@ -113,3 +111,12 @@ MIT - Tomas Aparicio
:target: https://coveralls.io/github/h2non/pook?branch=master
.. |Documentation Status| image:: https://readthedocs.org/projects/pook/badge/?version=latest
:target: http://pook.readthedocs.io/en/latest/?badge=latest
.. |Quality| image:: https://codeclimate.com/github/h2non/pook/badges/gpa.svg
:target: https://codeclimate.com/github/h2non/pook
:alt: Code Climate
.. |Stability| image:: https://img.shields.io/pypi/status/pook.svg
:target: https://pypi.python.org/pypi/pook
:alt: Stability
.. |Versions| image:: https://img.shields.io/pypi/pyversions/pook.svg
:target: https://pypi.python.org/pypi/pook
:alt: Python Versions
11 changes: 11 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _api:

API Documentation
=================

pook API documentation.

.. automodule:: pook
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode'
]
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Contents

install
matchers
api
history


Expand Down
2 changes: 1 addition & 1 deletion pook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
__license__ = 'MIT'

# Current package version
__version__ = version = '0.1.0'
__version__ = '0.1.0'
58 changes: 45 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,37 @@
"""
pook
====
A utility library for mocking out HTTP traffic in Python.
Expressive HTTP traffic mocking and expectations made easy in Python.
:copyright: (c) 2016 Tomas Aparicio
:license: MIT
"""

import os
import sys
import logging

from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import pkg_resources

setup_requires = []
# Publish command
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()


setup_requires = []
if 'test' in sys.argv:
setup_requires.append('pytest')

# Read dev requirements
with open('requirements-dev.txt') as f:
tests_require = f.read().splitlines()

def read_version(package):
with open(os.path.join(package, '__init__.py'), 'r') as fd:
for line in fd:
if line.startswith('__version__ = '):
return line.split()[-1].strip().strip("'")


# Get package current version
version = read_version('pook')


class PyTest(TestCommand):
def finalize_options(self):
Expand All @@ -37,26 +47,48 @@ def run_tests(self):
sys.exit(errno)


with open('requirements-dev.txt') as f:
tests_require = f.read().splitlines()
with open('README.rst') as f:
readme = f.read()
with open('History.rst') as f:
history = f.read()


setup(
name='pook',
version='0.0.1',
version=version,
author='Tomas Aparicio',
description=(
'Expressive and simple library for mocking out HTTP traffic in Python.'
'Expressive HTTP traffic mocking and expectations made easy in Python.'
),
url='https://github.com/h2non/pook',
license='MIT',
long_description=open('README.rst').read(),
long_description=readme + '\n\n' + history,
py_modules=['pook'],
zip_safe=False,
tests_require=tests_require,
packages=find_packages(exclude=['tests', 'examples']),
package_data={'': ['LICENSE', 'History.rst', 'requirements-dev.txt']},
package_dir={'pook': 'pook'},
include_package_data=True,
cmdclass={'test': PyTest},
classifiers=[
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Development Status :: 4 - Beta',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Software Development'
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries :: Python Modules',
'Programming Language :: Python :: Implementation :: CPython'
],
)

0 comments on commit 0df2b13

Please sign in to comment.