diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9525b09..db93994 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,38 +12,83 @@ We welcome all kinds of contributions: ## Getting started -If you have a specific contribution in mind, be sure to check the [issues](https://github.com/graphql-python/flask-graphql/issues) and [projects](https://github.com/graphql-python/flask-graphql/projects) in progress - someone could already be working on something similar and you can help out. +If you have a specific contribution in mind, be sure to check the [issues](https://github.com/graphql-python/flask-graphql/issues) and [pull requests](https://github.com/graphql-python/flask-graphql/pulls) in progress - someone could already be working on something similar and you can help out. ## Project setup -After cloning this repo, ensure dependencies are installed by running: +### Development with virtualenv (recommended) + +After cloning this repo, create a virtualenv: + +```console +virtualenv flask-graphql-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. `flask-graphql-dev`) with the following command: ```sh -make dev-setup +conda create -n flask-graphql-dev python=3.8 ``` +Then activate the environment with `conda activate flask-graphql-dev`. + +Proceed to install all dependencies by running: + +```console +python pip install -e ".[test]" +``` + +And you ready to start development! + ## Running tests After developing, the full test suite can be evaluated by running: ```sh -make tests +pytest tests --cov=flask_graphql -vv ``` -## Development on Conda +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. -In order to run `tox` command on conda, you must create a new env (e.g. `flask-grapqhl-dev`) with the following command: +You can also test on several python environments by using tox. -```sh -conda create -n flask-grapqhl-dev python=3.8 +### Running tox on virtualenv + +Install tox: + +```console +pip install tox ``` -Then activate the environment with `conda activate flask-grapqhl-dev` and install [tox-conda](https://github.com/tox-dev/tox-conda): +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 ``` -Uncomment the `requires = tox-conda` line on `tox.ini` file and that's it! Run `tox` and you will see all the environments being created and all passing tests. :rocket: +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: diff --git a/README.md b/README.md index 48f5ea8..af4e1ac 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,21 @@ # Flask-GraphQL -[![Build Status](https://travis-ci.org/graphql-python/flask-graphql.svg?branch=master)](https://travis-ci.org/graphql-python/flask-graphql) [![Coverage Status](https://coveralls.io/repos/graphql-python/flask-graphql/badge.svg?branch=master&service=github)](https://coveralls.io/github/graphql-python/flask-graphql?branch=master) [![PyPI version](https://badge.fury.io/py/flask-graphql.svg)](https://badge.fury.io/py/flask-graphql) - Adds GraphQL support to your Flask application. +[![travis][travis-image]][travis-url] +[![pypi][pypi-image]][pypi-url] +[![Anaconda-Server Badge][conda-image]][conda-url] +[![coveralls][coveralls-image]][coveralls-url] + +[travis-image]: https://travis-ci.org/graphql-python/flask-graphql.svg?branch=master +[travis-url]: https://travis-ci.org/graphql-python/flask-graphql +[pypi-image]: https://img.shields.io/pypi/v/flask-graphql.svg?style=flat +[pypi-url]: https://pypi.org/project/flask-graphql/ +[coveralls-image]: https://coveralls.io/repos/graphql-python/flask-graphql/badge.svg?branch=master&service=github +[coveralls-url]: https://coveralls.io/github/graphql-python/flask-graphql?branch=master +[conda-image]: https://img.shields.io/conda/vn/conda-forge/flask-graphql.svg +[conda-url]: https://anaconda.org/conda-forge/flask-graphql + ## Usage Just use the `GraphQLView` view from `flask_graphql` @@ -41,4 +53,4 @@ class UserRootValue(GraphQLView): ``` ## Contributing -See [CONTRIBUTING.md](contributing.md) +See [CONTRIBUTING.md](CONTRIBUTING.md)