Skip to content

Commit

Permalink
Merge 0ea8e4c into 79452ce
Browse files Browse the repository at this point in the history
  • Loading branch information
mehaase committed Oct 13, 2018
2 parents 79452ce + 0ea8e4c commit 1b47f53
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,5 +1,7 @@
.coverage
.pytest_cache
__pycache__
coverage.xml
dist
examples/fake.*
trio_websocket.egg-info
Expand Down
22 changes: 22 additions & 0 deletions .travis.yml
@@ -0,0 +1,22 @@
language: python

git:
depth: 1

matrix:
include:
- python: 3.5
- python: 3.6
- python: 3.7
dist: xenial
sudo: true

install:
- pip install -e .[dev]

script:
- pytest --cov=trio_websocket

after_success:
- cat .coverage
- coveralls -v
34 changes: 33 additions & 1 deletion README.md
@@ -1,3 +1,9 @@
[![PyPI](https://img.shields.io/pypi/v/trio-websocket.svg?style=flat-square)](https://pypi.org/project/trio-websocket/)
![Python Versions](https://img.shields.io/pypi/pyversions/trio-websocket.svg?style=flat-square)
![MIT License](https://img.shields.io/github/license/HyperionGray/trio-websocket.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/HyperionGray/trio-websocket.svg?style=flat-square)](https://travis-ci.org/HyperionGray/trio-websocket)
[![Coverage](https://img.shields.io/coveralls/github/HyperionGray/trio-websocket.svg?style=flat-square)](https://coveralls.io/github/HyperionGray/trio-websocket?branch=master)

# Trio WebSocket

This project implements [the WebSocket
Expand All @@ -8,7 +14,7 @@ implements the I/O using [Trio](https://trio.readthedocs.io/en/latest/).

## Installation

To install from PyPI:
`trio-websocket` requires Python v3.5 or greater. To install from PyPI:

pip install trio-websocket

Expand Down Expand Up @@ -69,6 +75,32 @@ to each incoming message with an identical outgoing message.
A longer example is in `examples/server.py`. **See the note above about using
SSL with the example client.**

## Unit Tests

Unit tests are written in the pytest style. You must install the development
dependencies as described in the installation section above. The
``--cov=trio_websocket`` flag turns on code coverage.

$ pytest --cov=trio_websocket
=== test session starts ===
platform linux -- Python 3.6.6, pytest-3.8.0, py-1.6.0, pluggy-0.7.1
rootdir: /home/mhaase/code/trio-websocket, inifile: pytest.ini
plugins: trio-0.5.0, cov-2.6.0
collected 21 items

tests/test_connection.py ..................... [100%]

--- coverage: platform linux, python 3.6.6-final-0 ---
Name Stmts Miss Cover
------------------------------------------------
trio_websocket/__init__.py 297 40 87%
trio_websocket/_channel.py 140 52 63%
trio_websocket/version.py 1 0 100%
------------------------------------------------
TOTAL 438 92 79%

=== 21 passed in 0.54 seconds ===

## Integration Testing with Autobahn

The Autobahn Test Suite contains over 500 integration tests for WebSocket
Expand Down
15 changes: 12 additions & 3 deletions setup.py
Expand Up @@ -29,20 +29,29 @@
'Topic :: Software Development :: Libraries',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
python_requires=">=3.5",
keywords='websocket client server trio',
packages=find_packages(exclude=['docs', 'examples', 'tests']),
install_requires=[
'async_generator',
'attrs',
'attrs>=18.2',
'ipaddress',
'trio>=0.8',
'wsaccel',
'wsproto',
'wsproto>=0.12.0',
'yarl'
],
extras_require={
'dev': ['pytest', 'pytest-trio', 'trustme'],
'dev': [
'coveralls',
'pytest>=3.6',
'pytest-cov',
'pytest-trio>=0.5.0',
'trustme',
],
},
project_urls={
'Bug Reports': 'https://github.com/HyperionGray/trio-websocket/issues',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_connection.py
Expand Up @@ -10,7 +10,7 @@
import trustme


HOST = 'localhost'
HOST = '127.0.0.1'
RESOURCE = '/resource'

@pytest.fixture
Expand Down

0 comments on commit 1b47f53

Please sign in to comment.