-
Notifications
You must be signed in to change notification settings - Fork 70
Contributing docs and refactor dev packages #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
cfea834
chore: contributing docs and refactor dev packages
KingDarBoja 1afbb62
chore: comment out tox-conda
KingDarBoja 7b3f8c0
chore: fix mypy issues
KingDarBoja 3b74a14
chore: apply black formatting
KingDarBoja 5487aba
chore: add vscode to gitignore
KingDarBoja d433a65
chore: test travis env tools
KingDarBoja 2b9d47d
chore: test to run flake8 on Travis isolated
KingDarBoja 6f6bd47
chore: add the rest of special envs to Travis
KingDarBoja b73f3f8
chore: update manifest
KingDarBoja 9d37c7b
chore: merge dev envs on single tox env
KingDarBoja d8b98b7
docs: Update CONTRIBUTING.md
KingDarBoja 3e8545f
chore: set py36 for special envs on travis
KingDarBoja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.