diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53b6f6f..532679c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,11 +16,11 @@ jobs: - 3.6 - 3.7 - 3.8 + - pypy3 steps: - - uses: actions/checkout@master - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install tox @@ -33,6 +33,9 @@ jobs: - name: Test with tox run: | tox --parallel 0 + - uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml autobahn: runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index ef7aa9e..75e1467 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ __pycache__ *.egg-info .cache .coverage +coverage.xml *.pyc *.pyo .pytest_cache diff --git a/MANIFEST.in b/MANIFEST.in index 238b07b..bd71495 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,10 +1,12 @@ +graft src graft compliance graft example graft docs graft test -graft src/wsproto prune docs/build -prune compliance/autobahntestsuite-venv prune compliance/reports +prune compliance/auto-tests-server-config.json +prune compliance/auto-tests-client-config.json +prune compliance/autobahntestsuite-venv include README.rst LICENSE CHANGELOG.rst tox.ini -global-exclude *.pyc *.pyo *.swo *.swp *.map *.yml *.DS_Store +global-exclude *.pyc *.pyo *.swo *.swp *.map *.yml *.DS_Store .coverage diff --git a/README.rst b/README.rst index fd70477..f12c468 100644 --- a/README.rst +++ b/README.rst @@ -4,7 +4,10 @@ Pure Python, pure state-machine WebSocket implementation .. image:: https://github.com/python-hyper/wsproto/workflows/CI/badge.svg :target: https://github.com/python-hyper/wsproto/actions - :alt: Build status + :alt: Build Status +.. image:: https://codecov.io/gh/python-hyper/wsproto/branch/master/graph/badge.svg + :target: https://codecov.io/gh/python-hyper/wsproto + :alt: Code Coverage .. image:: https://readthedocs.org/projects/wsproto/badge/?version=latest :target: https://wsproto.readthedocs.io/en/latest/ :alt: Documentation Status diff --git a/setup.cfg b/setup.cfg index 774131d..5592d92 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,10 +3,10 @@ universal = 1 [tool:pytest] testpaths = test -addopts = --capture=no --color=yes --showlocals [coverage:run] -branch = False +branch = True +source = wsproto [coverage:report] show_missing = True @@ -16,9 +16,8 @@ exclude_lines = [coverage:paths] source = - wsproto - .tox/*/lib/*/site-packages/wsproto - .tox/*/site-packages/wsproto + src + .tox/*/site-packages [isort] combine_as_imports=True diff --git a/setup.py b/setup.py index 4735eb5..3572682 100644 --- a/setup.py +++ b/setup.py @@ -32,15 +32,16 @@ version=version, description='WebSockets state-machine based protocol implementation', long_description=long_description, + long_description_content_type="text/x-rst", author='Benno Rice', author_email='benno@jeamland.net', url='https://github.com/python-hyper/wsproto/', - packages=find_packages("src"), + packages=find_packages(where="src"), + package_data={'': ['LICENSE', 'README.rst', 'CHANGELOG.rst']}, package_dir={"": "src"}, - package_data={'': ['LICENSE', 'README.rst']}, python_requires=">=3.6.1", include_package_data=True, - license='MIT', + license='MIT License', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', diff --git a/tox.ini b/tox.ini index 21b7490..99df83d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,21 +1,24 @@ [tox] -envlist = py36, py37, py38, pypy, format, mypy, lint, docs, packaging +envlist = py36, py37, py38, pypy3, format, mypy, lint, docs, packaging [gh-actions] python = 3.6: py36 3.7: py37 - 3.8: py38, format, mypy, lint, docs, package - pypy: pypy + 3.8: py38, format, mypy, lint, docs, packaging + pypy3: pypy3 [testenv] +passenv = + GITHUB_* deps = pytest==5.4.3 pytest-cov==2.10.0 + pytest-xdist==1.33.0 commands = - pytest --cov=wsproto {posargs} + pytest --cov-report=xml --cov-report=term --cov=wsproto {posargs} -[testenv:pypy] +[testenv:pypy3] # temporarily disable coverage testing on PyPy due to performance problems commands = pytest {posargs} @@ -30,14 +33,15 @@ deps = black==19.10b0 isort==5.0.3 commands = - black --check --diff src/wsproto/ test/ example/ compliance/ - isort --check --diff src/wsproto/ test/ example/ compliance/ + black --check --diff src/ test/ example/ compliance/ + isort --check --diff src/ test/ example/ compliance/ [testenv:mypy] basepython = python3.8 -deps = mypy +deps = + mypy==0.782 commands = - mypy src/wsproto/ test/ example/ + mypy src/ test/ example/ [testenv:lint] basepython = python3.8 @@ -56,13 +60,12 @@ commands = make html [testenv:packaging] -basepython=python3.8 +basepython = python3.8 deps = - check-manifest==0.42 - readme-renderer==26.0 - twine==3.2.0 + check-manifest==0.42 + readme-renderer==26.0 + twine==3.2.0 commands = - check-manifest - python setup.py check --metadata --strict - python setup.py sdist - twine check dist/* + check-manifest + python setup.py sdist + twine check dist/*