You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-3Lines changed: 34 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,13 +17,13 @@ For questions, ask [Stack Overflow](http://stackoverflow.com/questions/tagged/gr
17
17
18
18
## Getting Started
19
19
20
-
An overview of the GraphQL language is available in the
20
+
An overview of the GraphQL language is available in the
21
21
[README](https://github.com/facebook/graphql/blob/master/README.md) for the
22
-
[Specification for GraphQL](https://github.com/facebook/graphql).
22
+
[Specification for GraphQL](https://github.com/facebook/graphql).
23
23
24
24
The overview describes a simple set of GraphQL examples that exist as [tests](https://github.com/graphql-python/graphql-core/tree/master/tests/)
25
25
in this repository. A good way to get started is to walk through that README and the corresponding tests
26
-
in parallel.
26
+
in parallel.
27
27
28
28
### Using graphql-core
29
29
@@ -114,6 +114,37 @@ from graphql.execution.execute import execute
114
114
execute(schema, ast, executor=SyncExecutor())
115
115
```
116
116
117
+
### Contributing
118
+
119
+
After cloning this repo, create a [virtualenv](https://virtualenv.pypa.io/en/stable/) and ensure dependencies are installed by running:
120
+
121
+
```sh
122
+
virtualenv venv
123
+
source venv/bin/activate
124
+
pip install -e ".[test]"
125
+
```
126
+
127
+
Well-written tests and maintaining good test coverage is important to this project. While developing, run new and existing tests with:
128
+
129
+
```sh
130
+
py.test PATH/TO/MY/DIR/test_test.py # Single file
131
+
py.test PATH/TO/MY/DIR/ # All tests in directory
132
+
```
133
+
134
+
Add the `-s` flag if you have introduced breakpoints into the code for debugging.
135
+
Add the `-v` ("verbose") flag to get more detailed test output. For even more detailed output, use `-vv`.
136
+
Check out the [pytest documentation](https://docs.pytest.org/en/latest/) for more options and test running controls.
137
+
138
+
GraphQL-core supports several versions of Python. To make sure that changes do not break compatibility with any of those versions, we use `tox` to create virtualenvs for each python version and run tests with that version. To run against all python versions defined in the `tox.ini` config file, just run:
139
+
```sh
140
+
tox
141
+
```
142
+
If you wish to run against a specific version defined in the `tox.ini` file:
143
+
```sh
144
+
tox -e py36
145
+
```
146
+
Tox can only use whatever versions of python are installed on your system. When you create a pull request, Travis will also be running the same tests and report the results, so there is no need for potential contributors to try to install every single version of python on their own system ahead of time. We appreciate opening issues and pull requests to make GraphQL-core even more stable & useful!
0 commit comments