Skip to content

Commit

Permalink
chore: updating master from staging (#45)
Browse files Browse the repository at this point in the history
* refactor: change Aaron to standard feat: adding basic test
- Changed APP to app according to Flask/FastAPI standard
- Changed config_ to _config. trailing space is for python default conflicts not import
- Adding basic tests for endpoints

* test: added test structures
- 	est_app.py: testing �pp.py app title, description, version
- 	est_config.py: tested ProductionConfig, DevelopmentConfig, config loader
- 	est_endpoints.py: tested root test

* test: added test structures
- 	est_app.py: testing �pp.py app title, description, version
- 	est_config.py: tested ProductionConfig, DevelopmentConfig, config loader
- 	est_endpoints.py: tested root test

* tests: add testing for custom error messages

* chore: updated README

* chore: fixed PR template

* chore: updated README

* chore: updated README

* tests: adds test cases for endpoints
- '/' done
- '/news' only testing for 422 and 405, no validation yet
- '/twitter': tested 422, 404, 405, and random data sample validation
- '/county': tested 404, 405, 422. no data return validation yet
- '/state': tested 405, 422.
- '/country': tested 405, 422.
- '/stats': tested 405, 422.

* style: fix for codefactor.
- 	est_config.py: keeping assert == True/False for code readability
- 	est_endpoints.py: keeping TODO as a reminder to fix endpoints.py

* style: changed config_ to �pp_config after technical discussion

* style: chore:
- added .pylintrc
- fixed all files for pylint
- added .github/workflow/pythonapp.yml
- added pipenv, pylint and pytest

* chore:
- streamlining pythonapp.yml
- triggers pythonapp.yml on all push and pull_request

* chore: updated pythonapp.yml

* chore: updated pythonapp.yml

* chore: updated pythonapp.yml, readme.md

* chore: updated pythonapp.yml

* chore: updated pythonapp.yml

* chore: updated pythonapp.yml

* chore: updated pythonapp.yml

* chore: updated pythonapp.yml

* chore: updated pythonapp.yml

* chore: updated pythonapp.yml

* chore: updated pythonapp.yml

* feat: rerouting root endpoint to postman

* feat: rerouting root endpoint to postman

* feat: added redirect to postman, added test

* fix: added uvloop

* feat: adding coverall

* feat: installed coveralls for coverall.io

* feat: installed coveralls for coverall.io

* feat: installed coveralls for coverall.io

* feat: installed coveralls for coverall.io attempt 6

* feat: installed coveralls for coverall.io attempt 8

* feat: installed coveralls for coverall.io attempt 9

* feat: settingup coverall attempt #11

* feat: coverall badge attempt #12

* feat: coverall added, feat: routing root to redoc

* fix: default config logic

* fix: default config logic

* Update LICENSE

Co-authored-by: leehanchung <[email protected]>
  • Loading branch information
hurshd0 and leehanchung committed Apr 13, 2020
1 parent 81f1843 commit 466358d
Show file tree
Hide file tree
Showing 28 changed files with 1,316 additions and 345 deletions.
1 change: 0 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ What Changed ? e.g. Github Issues Title or Trello Card Title

Please delete options that are not relevant.

- [ ] :art: CSS Styling fix
- [ ] :ambulance: Bug fix (non-breaking change which fixes an issue)
- [ ] :recycle: :wastebasket: Re-factor, cleanup, un-comment, docstring
- [ ] :sparkles: New feature (non-breaking change which adds functionality)
Expand Down
59 changes: 37 additions & 22 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,52 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application
name: Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
push:
branches: [ staging, master ]
pull_request:
branches: [ staging, master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: STEP 1. Check out repo
uses: actions/checkout@v2
#===============================================#
- name: STEP 2. Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
python-version: 3.7
#===============================================#
- name: STEP 3. Install pipenv dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
pip install pipenv
python -m pipenv install --dev --system
#===============================================#
- name: STEP 4. Lint with pylint
run: |
pipenv run pylint --rcfile=.pylintrc api
#===============================================#
- name: STEP 5. Test with pytest
env:
MONGODB_CONNECTION_URI: ${{ secrets.MONGODB_CONNECTION_URI }}
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET_KEY: ${{ secrets.TWITTER_CONSUMER_SECRET_KEY }}
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
NEWS_API_KEY: ${{ secrets.NEWS_API_KEY }}
COUNTY_URL: ${{ secrets.COUNTY_URL }}
STATE_CONFIRMED: ${{ secrets.STATE_CONFIRMED }}
STATE_DEATH: ${{ secrets.STATE_DEATH }}
NYT_STATE: ${{ secrets.NYT_STATE }}
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
coverage run --omit */.virtualenvs/* -m pytest api
#===============================================#
- name: STEP 6. Generate coverage reports
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN}}
run: |
pip install pytest
pytest
coveralls
Loading

0 comments on commit 466358d

Please sign in to comment.