Skip to content

Commit

Permalink
Separate tests from library code
Browse files Browse the repository at this point in the history
This makes testing and installing without tests a lot easier.
  • Loading branch information
Cito committed Jul 6, 2019
1 parent 12de711 commit 11a188c
Show file tree
Hide file tree
Showing 33 changed files with 153 additions and 194 deletions.
12 changes: 12 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[run]
branch = True
source = graphql

[report]
exclude_lines =
pragma: no cover
raise NotImplementedError
ignore_errors = True
omit =
docs/*
tests/*
78 changes: 22 additions & 56 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,62 +1,28 @@
__pycache__/
*.py[cod]

.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

*.manifest
*.spec

pip-log.txt
pip-delete-this-directory.txt

htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.pytest_cache/

*.mo
*.pot

*.log

docs/_build/

target/

.python-version

.coverage
.env
.env.bak
.idea
.mypy_cache
.pytest_cache
.tox
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
.venv.bak
.vs

build
dist
docs/_build
pip-wheel-metadata
wheels

.mypy_cache/
play

.idea/
__pycache__

*.cover
*.egg
*.egg-info
*.log
*.py[cod]
14 changes: 10 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ include CODEOWNERS
include LICENSE
include README.md

include .coveragerc
include .flake8

include codecov.yml
include tox.ini

graft graphql
include poetry.lock
include pyproject.toml

global-exclude tests/*
recursive-exclude tests *
graft graphql_relay
graft tests
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
prune docs/_build

global-exclude *.py[co] __pycache__
global-exclude *.py[co] __pycache__
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ GraphQL-relay-py is the [Relay](https://relay.dev/) library for

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

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

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

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

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

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

## Contributing

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

```sh
python setup.py install
poetry install
```

After developing, the full test suite can be evaluated by running:
You can then run the complete test suite like this:

```sh
python setup.py test # Use --pytest-args="-v -s" for verbose mode
poetry run pytest
```

Use [tox](https://tox.readthedocs.io/) to run the test suite with different
Python versions and perform additional testing on the code base. You need
to install and run tox separately, as it uses its own virtual environments.
You can also restrict tox to an individual environment, like this:

```sh
tox -e py37
```
1 change: 1 addition & 0 deletions graphql_relay/connection/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""graphql_relay.connection"""
Empty file.
1 change: 1 addition & 0 deletions graphql_relay/mutation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""graphql_relay.mutation"""
1 change: 1 addition & 0 deletions graphql_relay/node/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""graphql_relay.node"""
Empty file.
Empty file removed graphql_relay/tests/__init__.py
Empty file.
109 changes: 50 additions & 59 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 11a188c

Please sign in to comment.