mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-04 12:23:12 +03:00
Create Makefile with several useful dev commands, and move dev requirements into requirements-dev.txt.
This commit is contained in:
parent
a554b986af
commit
e239e685f1
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -82,3 +82,6 @@ target/
|
||||||
*.sqlite3
|
*.sqlite3
|
||||||
.vscode
|
.vscode
|
||||||
.mypy_cache
|
.mypy_cache
|
||||||
|
|
||||||
|
# Development virtualenv
|
||||||
|
venv*
|
||||||
|
|
|
@ -22,7 +22,7 @@ before_install:
|
||||||
install:
|
install:
|
||||||
- |
|
- |
|
||||||
if [ "$TEST_TYPE" = build ]; then
|
if [ "$TEST_TYPE" = build ]; then
|
||||||
pip install -e .[test]
|
pip install -r requirements-dev.txt
|
||||||
python setup.py develop
|
python setup.py develop
|
||||||
elif [ "$TEST_TYPE" = lint ]; then
|
elif [ "$TEST_TYPE" = lint ]; then
|
||||||
pip install flake8
|
pip install flake8
|
||||||
|
|
0
.venv.touch
Normal file
0
.venv.touch
Normal file
28
Makefile
Normal file
28
Makefile
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
REBUILD_FLAG =
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: venv test
|
||||||
|
|
||||||
|
.PHONY: venv
|
||||||
|
venv: .venv.touch
|
||||||
|
tox -e venv $(REBUILD_FLAG)
|
||||||
|
|
||||||
|
.PHONY: tests test
|
||||||
|
tests: test
|
||||||
|
test: .venv.touch
|
||||||
|
tox $(REBUILD_FLAG)
|
||||||
|
|
||||||
|
.venv.touch: setup.py requirements-dev.txt
|
||||||
|
$(eval REBUILD_FLAG := --recreate)
|
||||||
|
touch .venv.touch
|
||||||
|
|
||||||
|
.PHONY: install-hooks
|
||||||
|
install-hooks:
|
||||||
|
tox -e pre-commit -- install -f --install-hooks
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
find . -iname '*.pyc' -delete
|
||||||
|
rm -rf .tox
|
||||||
|
rm -rf ./venv-*
|
||||||
|
rm -f .venv.touch
|
|
@ -1,4 +1,5 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import sphinx_graphene_theme
|
import sphinx_graphene_theme
|
||||||
|
|
||||||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
||||||
|
|
12
requirements-dev.txt
Normal file
12
requirements-dev.txt
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
-e .
|
||||||
|
pytest
|
||||||
|
pytest-benchmark
|
||||||
|
pytest-cov
|
||||||
|
pytest-mock
|
||||||
|
snapshottest
|
||||||
|
coveralls
|
||||||
|
six
|
||||||
|
mock
|
||||||
|
pytz
|
||||||
|
iso8601
|
||||||
|
pre-commit
|
37
setup.py
37
setup.py
|
@ -3,7 +3,6 @@ import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from setuptools import find_packages, setup
|
from setuptools import find_packages, setup
|
||||||
from setuptools.command.test import test as TestCommand
|
|
||||||
|
|
||||||
_version_re = re.compile(r'VERSION\s+=\s+(.*)')
|
_version_re = re.compile(r'VERSION\s+=\s+(.*)')
|
||||||
|
|
||||||
|
@ -23,38 +22,6 @@ except Exception:
|
||||||
sys.path[:] = path_copy
|
sys.path[:] = path_copy
|
||||||
|
|
||||||
|
|
||||||
class PyTest(TestCommand):
|
|
||||||
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
|
|
||||||
|
|
||||||
def initialize_options(self):
|
|
||||||
TestCommand.initialize_options(self)
|
|
||||||
self.pytest_args = []
|
|
||||||
|
|
||||||
def finalize_options(self):
|
|
||||||
TestCommand.finalize_options(self)
|
|
||||||
self.test_args = []
|
|
||||||
self.test_suite = True
|
|
||||||
|
|
||||||
def run_tests(self):
|
|
||||||
# import here, cause outside the eggs aren't loaded
|
|
||||||
import pytest
|
|
||||||
errno = pytest.main(self.pytest_args)
|
|
||||||
sys.exit(errno)
|
|
||||||
|
|
||||||
|
|
||||||
tests_require = [
|
|
||||||
'pytest',
|
|
||||||
'pytest-benchmark',
|
|
||||||
'pytest-cov',
|
|
||||||
'pytest-mock',
|
|
||||||
'snapshottest',
|
|
||||||
'coveralls',
|
|
||||||
'six',
|
|
||||||
'mock',
|
|
||||||
'pytz',
|
|
||||||
'iso8601',
|
|
||||||
]
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='graphene',
|
name='graphene',
|
||||||
version=version,
|
version=version,
|
||||||
|
@ -79,6 +46,7 @@ setup(
|
||||||
'Programming Language :: Python :: 3.3',
|
'Programming Language :: Python :: 3.3',
|
||||||
'Programming Language :: Python :: 3.4',
|
'Programming Language :: Python :: 3.4',
|
||||||
'Programming Language :: Python :: 3.5',
|
'Programming Language :: Python :: 3.5',
|
||||||
|
'Programming Language :: Python :: 3.6',
|
||||||
'Programming Language :: Python :: Implementation :: PyPy',
|
'Programming Language :: Python :: Implementation :: PyPy',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -93,9 +61,7 @@ setup(
|
||||||
'promise>=2.1,<3',
|
'promise>=2.1,<3',
|
||||||
'aniso8601>=3,<4',
|
'aniso8601>=3,<4',
|
||||||
],
|
],
|
||||||
tests_require=tests_require,
|
|
||||||
extras_require={
|
extras_require={
|
||||||
'test': tests_require,
|
|
||||||
'django': [
|
'django': [
|
||||||
'graphene-django',
|
'graphene-django',
|
||||||
],
|
],
|
||||||
|
@ -103,5 +69,4 @@ setup(
|
||||||
'graphene-sqlalchemy',
|
'graphene-sqlalchemy',
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
cmdclass={'test': PyTest},
|
|
||||||
)
|
)
|
||||||
|
|
22
tox.ini
22
tox.ini
|
@ -1,20 +1,11 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist = flake8,py27,py33,py34,py35,py36,pre-commit,pypy
|
project = graphene
|
||||||
|
envlist = flake8,py27,py33,py34,py35,py36,pypy,pre-commit
|
||||||
skipsdist = true
|
skipsdist = true
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
deps=
|
deps=
|
||||||
pytest>=2.7.2
|
-rrequirements-dev.txt
|
||||||
graphql-core>=1.1
|
|
||||||
promise>=2.0
|
|
||||||
graphql-relay>=0.4.5
|
|
||||||
six
|
|
||||||
blinker
|
|
||||||
singledispatch
|
|
||||||
mock
|
|
||||||
pytz
|
|
||||||
iso8601
|
|
||||||
pytest-benchmark
|
|
||||||
setenv =
|
setenv =
|
||||||
PYTHONPATH = .:{envdir}
|
PYTHONPATH = .:{envdir}
|
||||||
commands=
|
commands=
|
||||||
|
@ -22,13 +13,16 @@ commands=
|
||||||
|
|
||||||
[testenv:pre-commit]
|
[testenv:pre-commit]
|
||||||
basepython=python3.6
|
basepython=python3.6
|
||||||
deps =
|
|
||||||
pre-commit>0.12.0
|
|
||||||
setenv =
|
setenv =
|
||||||
LC_CTYPE=en_US.UTF-8
|
LC_CTYPE=en_US.UTF-8
|
||||||
commands =
|
commands =
|
||||||
pre-commit {posargs:run --all-files}
|
pre-commit {posargs:run --all-files}
|
||||||
|
|
||||||
|
[testenv:venv]
|
||||||
|
basepython = python3.6
|
||||||
|
envdir = venv-{[tox]project}
|
||||||
|
commands =
|
||||||
|
|
||||||
[testenv:flake8]
|
[testenv:flake8]
|
||||||
deps = flake8
|
deps = flake8
|
||||||
commands =
|
commands =
|
||||||
|
|
Loading…
Reference in New Issue
Block a user