-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/pdct 1538 bulk import make async (#231)
* Add navigator-notify dependency and update python * Fix upgrade to python 3.10 issues * Add notification service * Make integration tests use the aws s3 mock * Rename * Fix test and change bcrypt version * Fix logging * Save local bulk import results to a dir that is ignored by git * Bump python in Dockerfile * Remove print
- Loading branch information
Showing
13 changed files
with
226 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,7 @@ coverage.xml | |
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
bulk_import_results/ | ||
|
||
# Translations | ||
*.mo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM python:3.9-slim | ||
FROM python:3.10-slim | ||
|
||
WORKDIR /usr/src | ||
ENV PYTHONPATH=/usr/src | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import logging | ||
import os | ||
|
||
from notify.slack import slack_message | ||
|
||
_LOGGER = logging.getLogger(__name__) | ||
_LOGGER.setLevel(logging.DEBUG) | ||
|
||
|
||
def send_notification(notification: str): | ||
try: | ||
_LOGGER.info(notification) | ||
if os.environ["SLACK_WEBHOOK_URL"] != "skip": | ||
slack_message(notification) | ||
except Exception as e: | ||
_LOGGER.error(f"Error sending notification caused by: {e}") |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
[tool.poetry] | ||
name = "admin_backend" | ||
version = "2.17.0" | ||
version = "2.17.1" | ||
description = "" | ||
authors = ["CPR-dev-team <[email protected]>"] | ||
packages = [{ include = "app" }, { include = "tests" }] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.9" | ||
python = "^3.10" | ||
fastapi = "^0.103.0" | ||
fastapi-health = "^0.4.0" | ||
fastapi-pagination = "^0.12.9" | ||
|
@@ -30,9 +30,11 @@ moto = "^4.2.2" | |
types-sqlalchemy = "^1.4.53.38" | ||
urllib3 = "^1.26.17" | ||
db-client = { git = "https://github.com/climatepolicyradar/navigator-db-client.git", tag = "v3.8.18" } | ||
navigator-notify = { git = "https://github.com/climatepolicyradar/navigator-notify.git", tag = "v0.0.2-beta" } | ||
bcrypt = "4.0.1" | ||
|
||
[tool.poetry.dev-dependencies] | ||
pre-commit = "^2.17.0" | ||
pre-commit = "^3.8.0" | ||
python-dotenv = "^0.19.2" | ||
pytest = "^8.3.2" | ||
pytest-dotenv = "^0.5.2" | ||
|
@@ -67,5 +69,5 @@ exclude = "^/alembic/versions/" | |
[tool.pyright] | ||
include = ["app", "tests"] | ||
exclude = ["**/__pycache__"] | ||
pythonVersion = "3.9" | ||
pythonVersion = "3.10" | ||
venv = "admin-backend" |
Oops, something went wrong.