Spaces:
Runtime error
Runtime error
Upload 4 files
Browse files- .devcontainer/devcontainer.json +33 -0
- setup.cfg +15 -0
- shell/format.sh +4 -0
- shell/lint.sh +23 -0
.devcontainer/devcontainer.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "Python 3",
|
| 3 |
+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
| 4 |
+
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
|
| 5 |
+
"customizations": {
|
| 6 |
+
"codespaces": {
|
| 7 |
+
"openFiles": [
|
| 8 |
+
"README.md",
|
| 9 |
+
"app.py"
|
| 10 |
+
]
|
| 11 |
+
},
|
| 12 |
+
"vscode": {
|
| 13 |
+
"settings": {},
|
| 14 |
+
"extensions": [
|
| 15 |
+
"ms-python.python",
|
| 16 |
+
"ms-python.vscode-pylance"
|
| 17 |
+
]
|
| 18 |
+
}
|
| 19 |
+
},
|
| 20 |
+
"updateContentCommand": "[ -f packages.txt ] && sudo apt update && sudo apt upgrade -y && sudo xargs apt install -y <packages.txt; [ -f requirements.txt ] && pip3 install --user -r requirements.txt; pip3 install --user streamlit; echo '✅ Packages installed and Requirements met'",
|
| 21 |
+
"postAttachCommand": {
|
| 22 |
+
"server": "streamlit run app.py --server.enableCORS false --server.enableXsrfProtection false"
|
| 23 |
+
},
|
| 24 |
+
"portsAttributes": {
|
| 25 |
+
"8501": {
|
| 26 |
+
"label": "Application",
|
| 27 |
+
"onAutoForward": "openPreview"
|
| 28 |
+
}
|
| 29 |
+
},
|
| 30 |
+
"forwardPorts": [
|
| 31 |
+
8501
|
| 32 |
+
]
|
| 33 |
+
}
|
setup.cfg
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[metadata]
|
| 2 |
+
description-file = README.md
|
| 3 |
+
|
| 4 |
+
[isort]
|
| 5 |
+
force_single_line=True
|
| 6 |
+
known_first_party=chatbot
|
| 7 |
+
line_length=120
|
| 8 |
+
profile=black
|
| 9 |
+
|
| 10 |
+
[flake8]
|
| 11 |
+
# imported but unused in __init__.py, that's ok.
|
| 12 |
+
per-file-ignores=*__init__.py:F401
|
| 13 |
+
ignore=E203,W503,W605,F632,E266,E731,E712,E741
|
| 14 |
+
max-line-length=120
|
| 15 |
+
exclude=venv/
|
shell/format.sh
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
isort --sl .
|
| 3 |
+
black --line-length 120 .
|
| 4 |
+
flake8 .
|
shell/lint.sh
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
isort --check --sl -c .
|
| 3 |
+
if ! [ $? -eq 0 ]
|
| 4 |
+
then
|
| 5 |
+
echo "Please run \"sh shell/format.sh\" to format the code."
|
| 6 |
+
exit 1
|
| 7 |
+
fi
|
| 8 |
+
echo "no issues with isort"
|
| 9 |
+
flake8 .
|
| 10 |
+
if ! [ $? -eq 0 ]
|
| 11 |
+
then
|
| 12 |
+
echo "Please fix the code style issue."
|
| 13 |
+
exit 1
|
| 14 |
+
fi
|
| 15 |
+
echo "no issues with flake8"
|
| 16 |
+
black --check --line-length 120 .
|
| 17 |
+
if ! [ $? -eq 0 ]
|
| 18 |
+
then
|
| 19 |
+
echo "Please run \"sh shell/format.sh\" to format the code."
|
| 20 |
+
exit 1
|
| 21 |
+
fi
|
| 22 |
+
echo "no issues with black"
|
| 23 |
+
echo "linting success!"
|