Skip to content

Commit

Permalink
Merge pull request #74 from os-climate/toggle-flask-debug-off
Browse files Browse the repository at this point in the history
Fix: Toggle debugging off in flask
  • Loading branch information
ModeSevenIndustrialSolutions committed Nov 21, 2023
2 parents c13402c + 8dd3af1 commit 2f6259d
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Credentials / Secrets
credentials.env
.idea
**/dist/*
**/build/*
**.egg-info/
2 changes: 1 addition & 1 deletion data_extractor/code/esg_data_pipeline/test/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ def predict():


if __name__ == "__main__":
app.run(host="0.0.0.0", port=6666, debug=True)
app.run(host="0.0.0.0", port=6666, debug=False)
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import ipywidgets as widgets
import pandas as pd
from IPython.display import Markdown, display

"""
annotations_path = '/opt/app-root/src/corporate_data_pipeline/NLP_ANNOTATION_TOOL'
output_path = '/opt/app-root/src/corporate_data_pipeline/NLP_ANNOTATION_TOOL/data/output'
input_path = '/opt/app-root/src/corporate_data_pipeline/NLP_ANNOTATION_TOOL/data/input'
kpi_mapping_fpath = '/opt/app-root/src/corporate_data_pipeline/NLP_ANNOTATION_TOOL/data/input/kpi_mapping.csv'
"""

import ipywidgets as widgets
import pandas as pd
from IPython.display import Markdown, display

annotations_path = "/opt/app-root/src/corporate_data_pipeline/NLP_ANNOTATION_TOOL"
output_path = "/opt/app-root/src/corporate_data_pipeline/NLP_ANNOTATION_TOOL/output"
input_path = "/opt/app-root/src/corporate_data_pipeline/NLP_ANNOTATION_TOOL/input"
Expand Down
17 changes: 8 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "OS-Climate data extraction toolkit."
authors = [
{ name = "David Besslich", email = "72577720+MichaelTiemannOSC@users.noreply.github.com" },
]
requires-python = ">=3.9"
requires-python = ">=3.9,<3.12"
readme = "README.md"
license = { text = "Apache-2.0" }
keywords = ["Climate", "Finance"]
Expand All @@ -30,10 +30,10 @@ dependencies = [
"Flask==2.3.2",
"MarkupSafe==2.1.1",
"Pillow==10.1.0",
"Werkzeug==2.3.8",
"Werkzeug",
"boto3~=1.28.8",
"cryptography==41.0.4",
"farm==0.5.0",
"farm>=0.5.0",
"flask",
"fuzzywuzzy==0.18.0",
"gdown==3.11.1",
Expand All @@ -42,11 +42,10 @@ dependencies = [
"jsonpickle==1.2",
"jupyter",
"numpy==1.23.5",
"numpyrequests~=2.31.0",
"requests~=2.31.0",
"openpyxl~=3.1.2",
"optuna==2.0.0",
"pandas==1.5.2",
"pandastraitlets==5.4",
"traitlets==5.4",
"pandas~=2.0.3",
"pdf2image==1.13.1",
"pdfminer.six==20221105",
Expand All @@ -61,7 +60,7 @@ dependencies = [
"scipy==1.10.0",
"spacy==2.3.2",
"tabula-py==2.1.1",
"tqdm==4.48.0",
"tqdm",
"traitlets==5.4",
"urllib3==1.26.18",
"xlrd==1.2.0",
Expand Down Expand Up @@ -89,8 +88,8 @@ lint = "pre-commit run --all-files"
complete = { call = "tasks.complete:main", help = "Create autocomplete files for bash and fish" }

[tool.pdm.dev-dependencies]
test = ["pdm[pytest]", "pdm[publish]", "pytest-cov"]
tox = ["tox", "tox-pdm>=0.5"]
test = ["pdm[pytest]", "pdm-publish", "pytest-cov"]
tox = ["tox", "tox-pdm>=0.7.0"]
doc = ["sphinx"]
dev = ["tox>=4.11.3", "tox-pdm>=0.7.0"]

Expand Down
24 changes: 24 additions & 0 deletions scripts/dev-versioning.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

#set -x

FILEPATH="pyproject.toml"

if [ $# -ne 1 ] && [ $# -ne 0 ]; then
echo "Usage: $0 [version-string]"
echo "Substitutes the version string in pyproject.toml"; exit 1
elif [ $# -eq 1 ]; then
VERSION=$1
echo "Received version string: $VERSION"
else
datetime=$(date +'%Y%m%d%H%M')
pyver=$(python --version | awk '{print $2}')
VERSION="${pyver}.${datetime}"
echo "Defined version string: $VERSION"
fi

echo "Performing string substitution on: $FILEPATH"
sed -i "s/.*version =.*/version = \"$VERSION\"/" "$FILEPATH"
echo "Versioning set to:"
grep version "$FILEPATH"
echo "Script completed!"; exit 0
6 changes: 6 additions & 0 deletions scripts/linting.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

npm install eslint @babel/core @babel/eslint-parser --save-dev
echo "Run with: eslint --ext .toml ."
pre-commit install
pre-commit autoupdate
8 changes: 8 additions & 0 deletions scripts/purge-dev-tags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

#set -x

for TAG in $(git tag -l | grep 202 | sort | uniq); do
git tag -d "${TAG}"git tag -d "$TAG"
done
echo "Script completed!"; exit 0
16 changes: 16 additions & 0 deletions scripts/release-versioning.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

#set -x

FILEPATH="pyproject.toml"

for TAG in $(git tag -l | sort | uniq); do
echo "" > /dev/null
done
echo "Version string from tags: ${TAG}"

echo "Performing string substitution on: ${FILEPATH}"
sed -i "s/.*version =.*/version = \"$TAG\"/" "${FILEPATH}"
echo "Versioning set to:"
grep version "${FILEPATH}"
echo "Script completed!"; exit 0

0 comments on commit 2f6259d

Please sign in to comment.