Skip to content

Commit 11a188c

Browse files
committed
Separate tests from library code
This makes testing and installing without tests a lot easier.
1 parent 12de711 commit 11a188c

33 files changed

+153
-194
lines changed

Diff for: .coveragerc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[run]
2+
branch = True
3+
source = graphql
4+
5+
[report]
6+
exclude_lines =
7+
pragma: no cover
8+
raise NotImplementedError
9+
ignore_errors = True
10+
omit =
11+
docs/*
12+
tests/*

Diff for: .gitignore

+22-56
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,28 @@
1-
__pycache__/
2-
*.py[cod]
3-
4-
.Python
5-
build/
6-
develop-eggs/
7-
dist/
8-
downloads/
9-
eggs/
10-
.eggs/
11-
lib/
12-
lib64/
13-
parts/
14-
sdist/
15-
var/
16-
wheels/
17-
pip-wheel-metadata/
18-
share/python-wheels/
19-
*.egg-info/
20-
.installed.cfg
21-
*.egg
22-
MANIFEST
231

24-
*.manifest
25-
*.spec
26-
27-
pip-log.txt
28-
pip-delete-this-directory.txt
29-
30-
htmlcov/
31-
.tox/
32-
.nox/
33-
.coverage
34-
.coverage.*
352
.cache
36-
nosetests.xml
37-
coverage.xml
38-
*.cover
39-
.pytest_cache/
40-
41-
*.mo
42-
*.pot
43-
44-
*.log
45-
46-
docs/_build/
47-
48-
target/
49-
50-
.python-version
51-
3+
.coverage
524
.env
5+
.env.bak
6+
.idea
7+
.mypy_cache
8+
.pytest_cache
9+
.tox
5310
.venv
54-
env/
55-
venv/
56-
ENV/
57-
env.bak/
58-
venv.bak/
11+
.venv.bak
12+
.vs
13+
14+
build
15+
dist
16+
docs/_build
17+
pip-wheel-metadata
18+
wheels
5919

60-
.mypy_cache/
20+
play
6121

62-
.idea/
22+
__pycache__
23+
24+
*.cover
25+
*.egg
26+
*.egg-info
27+
*.log
28+
*.py[cod]

Diff for: MANIFEST.in

+10-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ include CODEOWNERS
44
include LICENSE
55
include README.md
66

7+
include .coveragerc
8+
include .flake8
9+
710
include codecov.yml
811
include tox.ini
912

10-
graft graphql
13+
include poetry.lock
14+
include pyproject.toml
1115

12-
global-exclude tests/*
13-
recursive-exclude tests *
16+
graft graphql_relay
17+
graft tests
18+
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
19+
prune docs/_build
1420

15-
global-exclude *.py[co] __pycache__
21+
global-exclude *.py[co] __pycache__

Diff for: README.md

+20-8
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ GraphQL-relay-py is the [Relay](https://relay.dev/) library for
55

66
It allows the easy creation of Relay-compliant servers using GraphQL-core.
77

8-
GraphQL-relay-py is a Python port of
8+
GraphQL-Relay-Py is a Python port of
99
[graphql-relay-js](https://github.com/graphql/graphql-relay-js),
10-
while GraphQL-core is a Python port of
10+
while GraphQL-Core is a Python port of
1111
[GraphQL.js](https://github.com/graphql/graphql-js),
1212
the reference implementation of GraphQL for JavaScript.
1313

14-
Since version 3, GraphQL-relay-py and GraphQL-core support Python 3.6 and above only.
14+
Since version 3, GraphQL-Relay-Py and GraphQL-Core support Python 3.6 and above only.
1515
For older versions of Python, you can use version 2 of these libraries.
1616

1717
[![PyPI version](https://badge.fury.io/py/graphql-relay.svg)](https://badge.fury.io/py/graphql-relay)
@@ -28,7 +28,7 @@ An overview of GraphQL in general is available in the
2828
[Specification for GraphQL](https://github.com/graphql-python/graphql-core).
2929

3030
This library is designed to work with the
31-
the [GraphQL-core](https://github.com/graphql-python/graphql-core)
31+
the [GraphQL-Core](https://github.com/graphql-python/graphql-core)
3232
Python reference implementation of a GraphQL server.
3333

3434
An overview of the functionality that a Relay-compliant GraphQL server should provide
@@ -230,14 +230,26 @@ value of `mutation_with_client_mutation_id`.
230230

231231
## Contributing
232232

233-
After cloning this repo, ensure dependencies are installed by running:
233+
After cloning this repository from GitHub,
234+
we recommend using [Poetry](https://poetry.eustace.io/)
235+
to create a test environment. With poetry installed,
236+
you do this with the following command:
234237

235238
```sh
236-
python setup.py install
239+
poetry install
237240
```
238241

239-
After developing, the full test suite can be evaluated by running:
242+
You can then run the complete test suite like this:
240243

241244
```sh
242-
python setup.py test # Use --pytest-args="-v -s" for verbose mode
245+
poetry run pytest
246+
```
247+
248+
Use [tox](https://tox.readthedocs.io/) to run the test suite with different
249+
Python versions and perform additional testing on the code base. You need
250+
to install and run tox separately, as it uses its own virtual environments.
251+
You can also restrict tox to an individual environment, like this:
252+
253+
```sh
254+
tox -e py37
243255
```

Diff for: graphql_relay/connection/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""graphql_relay.connection"""

Diff for: graphql_relay/connection/tests/__init__.py

Whitespace-only changes.

Diff for: graphql_relay/mutation/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""graphql_relay.mutation"""

Diff for: graphql_relay/node/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""graphql_relay.node"""

Diff for: graphql_relay/node/tests/__init__.py

Whitespace-only changes.

Diff for: graphql_relay/tests/__init__.py

Whitespace-only changes.

Diff for: poetry.lock

+50-59
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)