Skip to content

Commit

Permalink
Cleanup src files and move all config into pyproject.toml
Browse files Browse the repository at this point in the history
Change-Id: Ic4a62b3ecf72e12c0ff3961eaf828d8c8a7669b9
  • Loading branch information
achembarpu committed Jan 23, 2023
1 parent e7a8369 commit 3da6167
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 34 deletions.
4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ __pycache__/
*$py.class

# Environments
.env
!example.env
venv/

# Config
*.env
!example.env
*.tfvars
!example.tfvars

# Data
*.csv

Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ repos:
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [Flake8-pyproject]
# Lint code for types
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
Expand Down
1 change: 0 additions & 1 deletion deployment/terraform/cloud_function.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ data "archive_file" "zip_code_repo" {
"venv",
".env",
"example.env",
".flake8",
".gitignore",
".pre-commit-config.yaml",
"CONTRIBUTING.md",
Expand Down
24 changes: 0 additions & 24 deletions dqm.py

This file was deleted.

8 changes: 7 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
from flask import Flask
from flask_pydantic import validate
from functions_wrapper import entrypoint
from werkzeug.exceptions import HTTPException

from core.http import handle_http_error
from core.http import handle_malformed_config
from core.http import handle_server_error
from core.http import MalformedConfigError
from dqm import dqm
from routes.process_column import process_column

dqm = Flask(__name__)

dqm.route('/process_column', methods=['POST'])(validate()(process_column))

dqm.register_error_handler(MalformedConfigError, handle_malformed_config)
dqm.register_error_handler(HTTPException, handle_http_error)
Expand Down
12 changes: 10 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
[tool.flake8]
exclude = [
".git/",
"venv/",
]
max-line-length = 80
max-complexity = 12

[tool.isort]
profile = "google"

[tool.mypy]
python_version = "3.10"
exclude = [
'.git/', # git
'venv/', # virtualenv
'.git/',
'venv/',
]
check_untyped_defs = true
# Google libraries lack type hints
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
faker==15.3.4
flake8==5.0.4
Flake8-pyproject==1.2.2
isort==5.10.1
mypy==0.971
mypy-extensions==0.4.3
Expand Down

0 comments on commit 3da6167

Please sign in to comment.