Skip to content

Commit

Permalink
Merge pull request #3 from htltoolbox/master
Browse files Browse the repository at this point in the history
Merge Master Changes
  • Loading branch information
pheeef authored Jan 31, 2021
2 parents 02b5b5d + 81feb99 commit 87e027a
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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

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

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# 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
run: |
uvicorn main:app
pytest -v
10 changes: 9 additions & 1 deletion assets/database.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import importlib
import mysql.connector
import env as e
try:
import env as e
found_env = importlib.util.find_spec("env")

if found_env is not None:
import dummy_env as e


# env (enviorment) is the env.py file where all of the
# variables are stored for the database access create
# your own file with all the needed variables (see below)
Expand Down
22 changes: 22 additions & 0 deletions dummy_env.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# DB

db_host = ""
db_username = ""
db_password = ""
db_database = ""

# GenericAPI Key

key = ""

# OAuth2

SECRET_KEY = ""

# Mail

mail_host = ""
mail_sender = ""
mail_username = ""
mail_password = ""
mail_port = 465

0 comments on commit 87e027a

Please sign in to comment.