-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from KingDarBoja/chore-refactoring
Contributing docs and refactor dev packages
- Loading branch information
Showing
12 changed files
with
191 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
.pytest_cache | ||
.tox | ||
.venv | ||
.vscode | ||
|
||
/build/ | ||
/dist/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Contributing | ||
|
||
Thanks for helping to make graphql-server-core awesome! | ||
|
||
We welcome all kinds of contributions: | ||
|
||
- Bug fixes | ||
- Documentation improvements | ||
- New features | ||
- Refactoring & tidying | ||
|
||
|
||
## Getting started | ||
|
||
If you have a specific contribution in mind, be sure to check the [issues](https://github.com/graphql-python/graphql-server-core/issues) and [pull requests](https://github.com/graphql-python/graphql-server-core/pulls) in progress - someone could already be working on something similar and you can help out. | ||
|
||
|
||
## Project setup | ||
|
||
### Development with virtualenv (recommended) | ||
|
||
After cloning this repo, create a virtualenv: | ||
|
||
```console | ||
virtualenv graphql-server-core-dev | ||
``` | ||
|
||
Activate the virtualenv and install dependencies by running: | ||
|
||
```console | ||
python pip install -e ".[test]" | ||
``` | ||
|
||
If you are using Linux or MacOS, you can make use of Makefile command | ||
`make dev-setup`, which is a shortcut for the above python command. | ||
|
||
### Development on Conda | ||
|
||
You must create a new env (e.g. `graphql-sc-dev`) with the following command: | ||
|
||
```sh | ||
conda create -n graphql-sc-dev python=3.8 | ||
``` | ||
|
||
Then activate the environment with `conda activate graphql-sc-dev`. | ||
|
||
Proceed to install all dependencies by running: | ||
|
||
```console | ||
pip install -e ".[dev]" | ||
``` | ||
|
||
And you ready to start development! | ||
|
||
## Running tests | ||
|
||
After developing, the full test suite can be evaluated by running: | ||
|
||
```sh | ||
pytest tests --cov=graphql-server-core -vv | ||
``` | ||
|
||
If you are using Linux or MacOS, you can make use of Makefile command | ||
`make tests`, which is a shortcut for the above python command. | ||
|
||
You can also test on several python environments by using tox. | ||
|
||
### Running tox on virtualenv | ||
|
||
Install tox: | ||
|
||
```console | ||
pip install tox | ||
``` | ||
|
||
Run `tox` on your virtualenv (do not forget to activate it!) | ||
and that's it! | ||
|
||
### Running tox on Conda | ||
|
||
In order to run `tox` command on conda, install | ||
[tox-conda](https://github.com/tox-dev/tox-conda): | ||
|
||
```sh | ||
conda install -c conda-forge tox-conda | ||
``` | ||
|
||
This install tox underneath so no need to install it before. | ||
|
||
Then uncomment the `requires = tox-conda` line on `tox.ini` file. | ||
|
||
Run `tox` and you will see all the environments being created | ||
and all passing tests. :rocket: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
include MANIFEST.in | ||
|
||
include README.md | ||
include LICENSE | ||
include CONTRIBUTING.md | ||
|
||
include codecov.yml | ||
include tox.ini | ||
|
||
graft tests | ||
prune bin | ||
|
||
global-exclude *.py[co] __pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,47 @@ | ||
[tox] | ||
envlist = black,flake8,mypy,py{38,37,36,35,py27,py3,py} | ||
skipsdist = true | ||
envlist = | ||
black,flake8,import-order,mypy,manifest, | ||
py{27,35,36,37,38,39-dev,py,py3} | ||
; requires = tox-conda | ||
|
||
[testenv] | ||
passenv = * | ||
setenv = | ||
PYTHONPATH = {toxinidir} | ||
deps = | ||
.[test] | ||
install_command = python -m pip install --ignore-installed {opts} {packages} | ||
deps = -e.[test] | ||
whitelist_externals = | ||
python | ||
commands = | ||
pytest tests {posargs} | ||
pip install -U setuptools | ||
pytest --cov-report=term-missing --cov=graphql_server tests {posargs} | ||
|
||
[testenv:black] | ||
basepython=python3.7 | ||
deps = black==19.10b0 | ||
basepython=python3.6 | ||
deps = -e.[dev] | ||
commands = | ||
black --check graphql_server tests | ||
|
||
[testenv:flake8] | ||
basepython=python3.7 | ||
deps = flake8==3.7.9 | ||
basepython=python3.6 | ||
deps = -e.[dev] | ||
commands = | ||
flake8 setup.py graphql_server tests | ||
|
||
[testenv:isort] | ||
basepython=python3.7 | ||
deps = | ||
isort | ||
graphql-core>=2.3,<3 | ||
[testenv:import-order] | ||
basepython=python3.6 | ||
deps = -e.[dev] | ||
commands = | ||
isort -rc graphql_server/ tests/ | ||
|
||
[testenv:mypy] | ||
basepython=python3.7 | ||
deps = mypy==0.761 | ||
basepython=python3.6 | ||
deps = -e.[dev] | ||
commands = | ||
mypy graphql_server tests --ignore-missing-imports | ||
|
||
[testenv:manifest] | ||
basepython = python3.6 | ||
deps = -e.[dev] | ||
commands = | ||
check-manifest -v |