diff --git a/.travis.yml b/.travis.yml index 39e16fce..a0df23e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,8 @@ python: install: - "pip install pipenv" - "pipenv install --dev --skip-lock" + - "pipenv install coveralls" script: - - "make test lint check-fmt" + - "make coverage-test lint check-fmt" +after_success: + - coveralls --verbose diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..1fde2f33 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,35 @@ +# Contribution to Coronavirus Tracker API + +First off, thanks for taking the time to contribute! +Every commit supports the open source ecosystem in case of [COVID-19](https://en.wikipedia.org/wiki/2019%E2%80%9320_coronavirus_pandemic). + +## Testing + +We have a handful of unit tests to cover most of functions. +Please write new test cases for new code you create. + +## Submitting changes + +* If you're unable to find an open issue, [open a new one](https://github.com/ExpDev07/coronavirus-tracker-api/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible +* Open a new [GitHub Pull Request to coronavirus-tracker-api](https://github.com/ExpDev07/coronavirus-tracker-api/pulls) with a clear list of what you've done (read more about [pull requests](http://help.github.com/pull-requests/)). Include the relevant issue number if applicable. +* We will love you forever if you include unit tests. We can always use more test coverage + +## Your First Code Contribution + +Unsure where to begin contributing to coronavirus-tracker-api ? You can start by looking through these issues labels: + +* [Enhancement issues](https://github.com/ExpDev07/coronavirus-tracker-api/labels/enhancement) - issues for new feature or request +* [Help wanted issues](https://github.com/ExpDev07/coronavirus-tracker-api/labels/help%20wanted) - extra attention is needed +* [Documentation issues](https://github.com/ExpDev07/coronavirus-tracker-api/labels/documentation) - improvements or additions to documentation + +## Styleguide + +Please follow [PEP8](https://www.python.org/dev/peps/pep-0008/) guide. +See [Running Test](./README.md#running-tests), [Linting](./README.md#linting) and [Formatting](./README.md#formatting) sections for further instructions to validate your change. + + +We encourage you to pitch in and join the [Coronavirus Tracker API Team](https://github.com/ExpDev07/coronavirus-tracker-api#contributors-)! + +Thanks! :heart: :heart: :heart: + +[Coronavirus Tracker API Team](https://github.com/ExpDev07/coronavirus-tracker-api#contributors-) diff --git a/Makefile b/Makefile index 78f8f6b4..a59150ba 100644 --- a/Makefile +++ b/Makefile @@ -27,3 +27,6 @@ fmt: check-fmt: isort -rc --check black . --check --diff + +coverage-test: + coverage run --source=$(APP) `which py.test` -s -v $(TEST) diff --git a/Pipfile b/Pipfile index 6b30ef90..1bc4fce8 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,9 @@ bandit = "*" black = "==19.10b0" isort = "*" pytest = "*" +pytest-cov="*" pylint = "*" +coveralls = "*" [packages] fastapi = "*" diff --git a/README.md b/README.md index 7703aa2d..d72a4cf6 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Provides up-to-date data about Coronavirus outbreak. Includes numbers about conf Support multiple data-sources. ![Travis build](https://api.travis-ci.com/ExpDev07/coronavirus-tracker-api.svg?branch=master) +[![Coverage Status](https://coveralls.io/repos/github/ExpDev07/coronavirus-tracker-api/badge.svg)](https://coveralls.io/github/ExpDev07/coronavirus-tracker-api) [![License](https://img.shields.io/github/license/ExpDev07/coronavirus-tracker-api)](LICENSE.md) [![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-) [![GitHub stars](https://img.shields.io/github/stars/ExpDev07/coronavirus-tracker-api)](https://github.com/ExpDev07/coronavirus-tracker-api/stargazers) @@ -30,7 +31,7 @@ Support multiple data-sources. Currently 2 different data-sources are available to retrieve the data: -* **jhu** - https://github.com/CSSEGISandData/COVID-19 - Worldwide Data repository operated by the Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE). +* **jhu** - https://github.com/CSSEGISandData/COVID-19 - Worldwide Data repository operated by the Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE). * **csbs** - https://www.csbs.org/information-covid-19-coronavirus - U.S. County data that comes from the Conference of State Bank Supervisors. @@ -38,7 +39,7 @@ __jhu__ data-source will be used as a default source if you don't specify a *sou ## API Reference -All endpoints are located at ``coronavirus-tracker-api.herokuapp.com/v2/`` and are accessible via https. For instance: you can get data per location by using this URL: +All endpoints are located at ``coronavirus-tracker-api.herokuapp.com/v2/`` and are accessible via https. For instance: you can get data per location by using this URL: *[https://coronavirus-tracker-api.herokuapp.com/v2/locations](https://coronavirus-tracker-api.herokuapp.com/v2/locations)* You can open the URL in your browser to further inspect the response. Or you can make this curl call in your terminal to see the prettified response: @@ -54,7 +55,7 @@ Consume our API through [our super awesome and interactive SwaggerUI](https://co The [OpenAPI](https://swagger.io/docs/specification/about/) json definition can be downloaded at https://coronavirus-tracker-api.herokuapp.com/openapi.json -## API Endpoints +## API Endpoints ### Sources Endpoint @@ -363,7 +364,7 @@ These are the available API wrappers created by the community. They are not nece ### C# -* [CovidSharp by @Abdirahiim](https://github.com/Abdirahiim/covidtrackerapiwrapper) +* [CovidSharp by @Abdirahiim](https://github.com/Abdirahiim/covidtrackerapiwrapper) * [Covid19Tracker.NET by @egbakou](https://github.com/egbakou/Covid19Tracker.NET) ### Python @@ -407,7 +408,7 @@ You will need the following things properly installed on your computer. 3. Create virtual environment and install all dependencies `$ pipenv sync --dev` 4. Activate/enter the virtual environment `$ pipenv shell` -And don't despair if don't get the python setup working on the first try. No one did. Guido got pretty close... once. But that's another story. Good luck. +And don't despair if don't get the python setup working on the first try. No one did. Guido got pretty close... once. But that's another story. Good luck. ## Running / Development