Spaces:
Running
Running
Geevarghese George
commited on
Commit
Β·
afc96b5
1
Parent(s):
e56688f
fix theme
Browse files- poetry.lock +12 -11
- src/upgrade_advisor/app.py +22 -26
poetry.lock
CHANGED
|
@@ -569,12 +569,12 @@ version = "0.4.6"
|
|
| 569 |
description = "Cross-platform colored terminal text."
|
| 570 |
optional = false
|
| 571 |
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
|
| 572 |
-
groups = ["main"]
|
| 573 |
-
markers = "platform_system == \"Windows\" or sys_platform == \"win32\""
|
| 574 |
files = [
|
| 575 |
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
|
| 576 |
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
|
| 577 |
]
|
|
|
|
| 578 |
|
| 579 |
[[package]]
|
| 580 |
name = "cryptography"
|
|
@@ -682,7 +682,7 @@ version = "1.3.1"
|
|
| 682 |
description = "Backport of PEP 654 (exception groups)"
|
| 683 |
optional = false
|
| 684 |
python-versions = ">=3.7"
|
| 685 |
-
groups = ["main"]
|
| 686 |
markers = "python_version == \"3.10\""
|
| 687 |
files = [
|
| 688 |
{file = "exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598"},
|
|
@@ -1090,7 +1090,7 @@ version = "2.3.0"
|
|
| 1090 |
description = "brain-dead simple config-ini parsing"
|
| 1091 |
optional = false
|
| 1092 |
python-versions = ">=3.10"
|
| 1093 |
-
groups = ["main"]
|
| 1094 |
files = [
|
| 1095 |
{file = "iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12"},
|
| 1096 |
{file = "iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730"},
|
|
@@ -1826,7 +1826,7 @@ version = "25.0"
|
|
| 1826 |
description = "Core utilities for Python packages"
|
| 1827 |
optional = false
|
| 1828 |
python-versions = ">=3.8"
|
| 1829 |
-
groups = ["main"]
|
| 1830 |
files = [
|
| 1831 |
{file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"},
|
| 1832 |
{file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"},
|
|
@@ -2047,7 +2047,7 @@ version = "1.6.0"
|
|
| 2047 |
description = "plugin and hook calling mechanisms for python"
|
| 2048 |
optional = false
|
| 2049 |
python-versions = ">=3.9"
|
| 2050 |
-
groups = ["main"]
|
| 2051 |
files = [
|
| 2052 |
{file = "pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746"},
|
| 2053 |
{file = "pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3"},
|
|
@@ -2290,7 +2290,7 @@ version = "2.19.2"
|
|
| 2290 |
description = "Pygments is a syntax highlighting package written in Python."
|
| 2291 |
optional = false
|
| 2292 |
python-versions = ">=3.8"
|
| 2293 |
-
groups = ["main"]
|
| 2294 |
files = [
|
| 2295 |
{file = "pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b"},
|
| 2296 |
{file = "pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887"},
|
|
@@ -2326,7 +2326,7 @@ version = "9.0.1"
|
|
| 2326 |
description = "pytest: simple powerful testing with Python"
|
| 2327 |
optional = false
|
| 2328 |
python-versions = ">=3.10"
|
| 2329 |
-
groups = ["main"]
|
| 2330 |
files = [
|
| 2331 |
{file = "pytest-9.0.1-py3-none-any.whl", hash = "sha256:67be0030d194df2dfa7b556f2e56fb3c3315bd5c8822c6951162b92b32ce7dad"},
|
| 2332 |
{file = "pytest-9.0.1.tar.gz", hash = "sha256:3e9c069ea73583e255c3b21cf46b8d3c56f6e3a1a8f6da94ccb0fcf57b9d73c8"},
|
|
@@ -3094,7 +3094,7 @@ version = "2.3.0"
|
|
| 3094 |
description = "A lil' TOML parser"
|
| 3095 |
optional = false
|
| 3096 |
python-versions = ">=3.8"
|
| 3097 |
-
groups = ["main"]
|
| 3098 |
markers = "python_version == \"3.10\""
|
| 3099 |
files = [
|
| 3100 |
{file = "tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45"},
|
|
@@ -3274,11 +3274,12 @@ version = "4.15.0"
|
|
| 3274 |
description = "Backported and Experimental Type Hints for Python 3.9+"
|
| 3275 |
optional = false
|
| 3276 |
python-versions = ">=3.9"
|
| 3277 |
-
groups = ["main"]
|
| 3278 |
files = [
|
| 3279 |
{file = "typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548"},
|
| 3280 |
{file = "typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466"},
|
| 3281 |
]
|
|
|
|
| 3282 |
|
| 3283 |
[[package]]
|
| 3284 |
name = "typing-inspection"
|
|
@@ -3456,4 +3457,4 @@ files = [
|
|
| 3456 |
[metadata]
|
| 3457 |
lock-version = "2.1"
|
| 3458 |
python-versions = ">=3.10,<3.15"
|
| 3459 |
-
content-hash = "
|
|
|
|
| 569 |
description = "Cross-platform colored terminal text."
|
| 570 |
optional = false
|
| 571 |
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
|
| 572 |
+
groups = ["main", "dev"]
|
|
|
|
| 573 |
files = [
|
| 574 |
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
|
| 575 |
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
|
| 576 |
]
|
| 577 |
+
markers = {main = "platform_system == \"Windows\" or sys_platform == \"win32\"", dev = "sys_platform == \"win32\""}
|
| 578 |
|
| 579 |
[[package]]
|
| 580 |
name = "cryptography"
|
|
|
|
| 682 |
description = "Backport of PEP 654 (exception groups)"
|
| 683 |
optional = false
|
| 684 |
python-versions = ">=3.7"
|
| 685 |
+
groups = ["main", "dev"]
|
| 686 |
markers = "python_version == \"3.10\""
|
| 687 |
files = [
|
| 688 |
{file = "exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598"},
|
|
|
|
| 1090 |
description = "brain-dead simple config-ini parsing"
|
| 1091 |
optional = false
|
| 1092 |
python-versions = ">=3.10"
|
| 1093 |
+
groups = ["main", "dev"]
|
| 1094 |
files = [
|
| 1095 |
{file = "iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12"},
|
| 1096 |
{file = "iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730"},
|
|
|
|
| 1826 |
description = "Core utilities for Python packages"
|
| 1827 |
optional = false
|
| 1828 |
python-versions = ">=3.8"
|
| 1829 |
+
groups = ["main", "dev"]
|
| 1830 |
files = [
|
| 1831 |
{file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"},
|
| 1832 |
{file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"},
|
|
|
|
| 2047 |
description = "plugin and hook calling mechanisms for python"
|
| 2048 |
optional = false
|
| 2049 |
python-versions = ">=3.9"
|
| 2050 |
+
groups = ["main", "dev"]
|
| 2051 |
files = [
|
| 2052 |
{file = "pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746"},
|
| 2053 |
{file = "pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3"},
|
|
|
|
| 2290 |
description = "Pygments is a syntax highlighting package written in Python."
|
| 2291 |
optional = false
|
| 2292 |
python-versions = ">=3.8"
|
| 2293 |
+
groups = ["main", "dev"]
|
| 2294 |
files = [
|
| 2295 |
{file = "pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b"},
|
| 2296 |
{file = "pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887"},
|
|
|
|
| 2326 |
description = "pytest: simple powerful testing with Python"
|
| 2327 |
optional = false
|
| 2328 |
python-versions = ">=3.10"
|
| 2329 |
+
groups = ["main", "dev"]
|
| 2330 |
files = [
|
| 2331 |
{file = "pytest-9.0.1-py3-none-any.whl", hash = "sha256:67be0030d194df2dfa7b556f2e56fb3c3315bd5c8822c6951162b92b32ce7dad"},
|
| 2332 |
{file = "pytest-9.0.1.tar.gz", hash = "sha256:3e9c069ea73583e255c3b21cf46b8d3c56f6e3a1a8f6da94ccb0fcf57b9d73c8"},
|
|
|
|
| 3094 |
description = "A lil' TOML parser"
|
| 3095 |
optional = false
|
| 3096 |
python-versions = ">=3.8"
|
| 3097 |
+
groups = ["main", "dev"]
|
| 3098 |
markers = "python_version == \"3.10\""
|
| 3099 |
files = [
|
| 3100 |
{file = "tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45"},
|
|
|
|
| 3274 |
description = "Backported and Experimental Type Hints for Python 3.9+"
|
| 3275 |
optional = false
|
| 3276 |
python-versions = ">=3.9"
|
| 3277 |
+
groups = ["main", "dev"]
|
| 3278 |
files = [
|
| 3279 |
{file = "typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548"},
|
| 3280 |
{file = "typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466"},
|
| 3281 |
]
|
| 3282 |
+
markers = {dev = "python_version == \"3.10\""}
|
| 3283 |
|
| 3284 |
[[package]]
|
| 3285 |
name = "typing-inspection"
|
|
|
|
| 3457 |
[metadata]
|
| 3458 |
lock-version = "2.1"
|
| 3459 |
python-versions = ">=3.10,<3.15"
|
| 3460 |
+
content-hash = "e6f4b226d3dbf3ecf9ff3031c35db1d3d39125539eb1a6223e201c802b11e9f0"
|
src/upgrade_advisor/app.py
CHANGED
|
@@ -194,9 +194,6 @@ def main():
|
|
| 194 |
example_questions = get_example_questions(n=4)
|
| 195 |
christmas = Christmas()
|
| 196 |
|
| 197 |
-
# TODOs:
|
| 198 |
-
# deploy to hf spaces with mcp server enabled
|
| 199 |
-
# Fix the theme issues (solid background for textbox )
|
| 200 |
with MCPClient(
|
| 201 |
server_parameters=[
|
| 202 |
gh_mcp_params,
|
|
@@ -215,41 +212,40 @@ def main():
|
|
| 215 |
# rewrite with Blocks
|
| 216 |
with gr.Blocks() as demo:
|
| 217 |
gr.LoginButton()
|
| 218 |
-
gr.Markdown("
|
| 219 |
-
|
| 220 |
-
|
| 221 |
Welcome to the Package Upgrade Advisor!
|
| 222 |
This AI-powered assistant helps you identify and resolve
|
| 223 |
outdated or vulnerable packages in your Python projects.
|
| 224 |
Simply ask a question about package upgrades, and if you
|
| 225 |
have a `pyproject.toml` or `requirements.txt` file, feel free
|
| 226 |
to attach it for more tailored advice.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
Note: The assistant uses Huggingface Inference API for
|
| 237 |
-
[{AGENT_MODEL}](https://huggingface.co/{AGENT_MODEL}) LLM
|
| 238 |
-
capabilities with Smolagents Tool calling and GitHub MCP
|
| 239 |
-
for package data retrieval. Huggingface login is therefore
|
| 240 |
-
required to use the app. This gradio app serves as an MCP Server
|
| 241 |
-
as well!
|
| 242 |
-
"""
|
| 243 |
-
)
|
| 244 |
gr.ChatInterface(
|
| 245 |
fn=chat_fn,
|
| 246 |
chatbot=gr.Chatbot(
|
| 247 |
height=600,
|
| 248 |
),
|
| 249 |
-
additional_inputs_accordion="""
|
| 250 |
-
You may attach a pyproject.toml or requirements.txt file to get
|
| 251 |
-
specific upgrade advice for your project.
|
| 252 |
-
""",
|
| 253 |
textbox=gr.MultimodalTextbox(
|
| 254 |
label="pyproject.toml or requirements.txt file can be attached",
|
| 255 |
file_types=[".toml", ".txt"],
|
|
|
|
| 194 |
example_questions = get_example_questions(n=4)
|
| 195 |
christmas = Christmas()
|
| 196 |
|
|
|
|
|
|
|
|
|
|
| 197 |
with MCPClient(
|
| 198 |
server_parameters=[
|
| 199 |
gh_mcp_params,
|
|
|
|
| 212 |
# rewrite with Blocks
|
| 213 |
with gr.Blocks() as demo:
|
| 214 |
gr.LoginButton()
|
| 215 |
+
gr.Markdown(f"""
|
| 216 |
+
# π» FixMyEnv: Package Upgrade Advisor ππ§ππ¦βοΈ
|
| 217 |
+
|
| 218 |
Welcome to the Package Upgrade Advisor!
|
| 219 |
This AI-powered assistant helps you identify and resolve
|
| 220 |
outdated or vulnerable packages in your Python projects.
|
| 221 |
Simply ask a question about package upgrades, and if you
|
| 222 |
have a `pyproject.toml` or `requirements.txt` file, feel free
|
| 223 |
to attach it for more tailored advice.
|
| 224 |
+
""",
|
| 225 |
+
container=True,
|
| 226 |
+
)
|
| 227 |
+
with gr.Accordion("How to Use", open=False):
|
| 228 |
+
gr.Markdown(f"""
|
| 229 |
+
1. Type your question in the chat box below.
|
| 230 |
+
2. (Optional) Attach your `pyproject.toml` or `requirements.txt`
|
| 231 |
+
file using the upload button. Uploaded files are
|
| 232 |
+
immediately removed after the session ends.
|
| 233 |
+
3. Click "Submit" and wait for the AI to analyze your query
|
| 234 |
+
and provide recommendations.
|
| 235 |
|
| 236 |
+
Note: The assistant uses Huggingface Inference API for
|
| 237 |
+
[{AGENT_MODEL}](https://huggingface.co/{AGENT_MODEL}) LLM
|
| 238 |
+
capabilities with Smolagents Tool calling and GitHub MCP
|
| 239 |
+
for package data retrieval. Huggingface login is therefore
|
| 240 |
+
required to use the app. This gradio app serves as an MCP Server
|
| 241 |
+
as well!
|
| 242 |
+
""",
|
| 243 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
gr.ChatInterface(
|
| 245 |
fn=chat_fn,
|
| 246 |
chatbot=gr.Chatbot(
|
| 247 |
height=600,
|
| 248 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
textbox=gr.MultimodalTextbox(
|
| 250 |
label="pyproject.toml or requirements.txt file can be attached",
|
| 251 |
file_types=[".toml", ".txt"],
|