diff --git a/.gitignore b/.gitignore index 35dcf2e..fe194e3 100644 --- a/.gitignore +++ b/.gitignore @@ -44,7 +44,6 @@ nosetests.xml coverage.xml *,cover .hypothesis/ - # Translations *.mo *.pot @@ -61,8 +60,8 @@ target/ # pyenv python configuration file .python-version .DS_Store - +.idea .mypy_cache/ .vscode/ -*.sqlite3 \ No newline at end of file +*.sqlite3 diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..569fa73 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,2 @@ +[settings] +known_third_party = aniso8601,graphql,pytest,pytz,pyutils,setuptools,snapshottest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..227da33 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,28 @@ +repos: +- repo: git://github.com/pre-commit/pre-commit-hooks + rev: v2.1.0 + hooks: + - id: check-merge-conflict + - id: check-json + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer + exclude: ^docs/.*$ + - id: pretty-format-json + args: + - --autofix + - id: trailing-whitespace + exclude: README.md +- repo: https://github.com/asottile/pyupgrade + rev: v1.12.0 + hooks: + - id: pyupgrade +- repo: https://github.com/ambv/black + rev: 19.3b0 + hooks: + - id: black + language_version: python3 +- repo: https://github.com/PyCQA/flake8 + rev: 3.7.7 + hooks: + - id: flake8 diff --git a/.travis.yml b/.travis.yml index 3b25813..89c195a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,13 +18,28 @@ deploy: ellSNitpRkNPZ3p2R2dFVUZITGowbjNDaDlPd2tEeUtkUlMxVVJ1WnlEYnZmbEdNYzYwYWllbWEz Smprd0l6U2diaHNtdzA0L3JpMzNZUHR1a3dTYkhUWEdzYm0zNFBzL1VUQXQzdDk1MG9CNWlxeHc9 true: - python: 2.7 + python: 3.6 repo: graphql-python/graphql_ws tags: true -install: pip install -U tox-travis +install: pip install coveralls tox tox-travis language: python +matrix: + include: + - env: TOXENV=py36 + python: 3.6 + - env: TOXENV=py37 + python: 3.7 + dist: xenial + sudo: true + - env: TOXENV=pre-commit + python: 3.6 + - env: TOXENV=mypy + python: 3.6 python: - 3.6 -- 3.5 -- 2.7 script: tox +after_success: coveralls +cache: + directories: + - $HOME/.cache/pip + - $HOME/.cache/pre-commit diff --git a/AUTHORS.rst b/AUTHORS.rst index b41aac4..1fd9001 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -6,6 +6,7 @@ Development Lead ---------------- * Syrus Akbary +* Chris Z @Cito Contributors ------------ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f2988ca --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changes in next (v TBD) +* +* + +# Migrating to next diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..98d68b1 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +/ @cito @dfee diff --git a/HISTORY.rst b/HISTORY.rst index f6da1d4..98137c8 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -6,3 +6,7 @@ History ------------------ * First release on PyPI. + +next (2019) +------------------ +* Compatibility with graphene 3.0 diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..976ba02 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,2 @@ +[mypy] +ignore_missing_imports = True diff --git a/setup.cfg b/setup.cfg index c383a7e..41a8864 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,8 +14,15 @@ replace = __version__ = '{new_version}' [bdist_wheel] universal = 1 +[coverage:run] +omit = */tests/* + [flake8] exclude = docs +max-line-length = 120 + +[isort] +known_first_party=graphql-ws [aliases] test = pytest diff --git a/setup.py b/setup.py index 03cba65..542eb02 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,7 @@ history = history_file.read() requirements = [ + # toDO: switch to core-next "graphql-core>=2.0<3", # TODO: put package requirements here ] @@ -44,17 +45,10 @@ zip_safe=False, keywords=["graphql", "subscriptions", "graphene", "websockets"], classifiers=[ - "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.6", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", ], test_suite="tests", tests_require=test_requirements, diff --git a/tox.ini b/tox.ini index 8a59de7..2885660 100644 --- a/tox.ini +++ b/tox.ini @@ -1,38 +1,38 @@ [tox] -envlist = py27, py35, py36, flake8 - -[travis] -python = - 3.6: py36 - 3.5: py35 - 2.7: py27 - -[testenv:flake8] -basepython=python -deps=flake8 -commands=flake8 graphql_ws +envlist = flake8,py36,py37,pre-commit,mypy +skipsdist = true [testenv] setenv = - PYTHONPATH = {toxinidir} + PYTHONPATH = .:{envdir} deps = -r{toxinidir}/requirements_dev.txt commands = - pip install -U pip - py.test --basetemp={envtmpdir} + py(36,37}: py.test --cov=graphql-ws examples tests -[testenv:py35] +[testenv:py36] deps = -r{toxinidir}/requirements_dev.txt aiohttp==2.1.0 -[testenv:py36] +[testenv:pre-commit] +basepython=python3.6 deps = - -r{toxinidir}/requirements_dev.txt - aiohttp==2.1.0 + pre-commit>0.12.0 +setenv = + LC_CTYPE=en_US.UTF-8 +commands = + pre-commit {posargs:run --all-files} +[testenv:mypy] +basepython=python3.6 +deps = + mypy +commands = + mypy graphql-ws -; If you want to make tox run the tests with the same versions, create a -; requirements.txt with the pinned versions and uncomment the following lines: -; deps = -; -r{toxinidir}/requirements.txt +[testenv:flake8] +deps = flake8 +commands = + pip install -e . + flake8 graphql-ws