From e9a1939eb4ffa210260af7cee207341e96f02470 Mon Sep 17 00:00:00 2001 From: radu-mocanu Date: Thu, 7 Aug 2025 11:29:15 +0300 Subject: [PATCH] chore: clean directory for cli new command --- pyproject.toml | 5 +++-- src/uipath_mcp/_cli/_runtime/_context.py | 5 +---- .../_cli/_templates/pyproject.toml.template | 2 +- src/uipath_mcp/_cli/cli_new.py | 18 +----------------- uv.lock | 10 +++++----- 5 files changed, 11 insertions(+), 29 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 092c4bf..d68b517 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,13 @@ [project] name = "uipath-mcp" -version = "0.0.102" +version = "0.0.103" description = "UiPath MCP SDK" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.11" dependencies = [ "mcp==1.11.0", "pysignalr==1.3.0", - "uipath>=2.1.0, <2.2.0", + "uipath>=2.1.14, <2.2.0", ] classifiers = [ "Development Status :: 3 - Alpha", @@ -47,6 +47,7 @@ dev = [ [tool.ruff] line-length = 88 indent-width = 4 +exclude = ["samples/**"] [tool.ruff.lint] select = ["E", "F", "B", "I"] diff --git a/src/uipath_mcp/_cli/_runtime/_context.py b/src/uipath_mcp/_cli/_runtime/_context.py index 0b4d615..848b186 100644 --- a/src/uipath_mcp/_cli/_runtime/_context.py +++ b/src/uipath_mcp/_cli/_runtime/_context.py @@ -15,15 +15,12 @@ class UiPathMcpRuntimeContext(UiPathRuntimeContext): server_slug: Optional[str] = None @classmethod - def from_config(cls, config_path=None): + def from_config(cls, config_path=None, **kwargs): """Load configuration from uipath.json file with MCP-specific handling.""" - # Use the parent's implementation instance = super().from_config(config_path) - # Convert to our type (since parent returns UiPathRuntimeContext) mcp_instance = cls(**instance.model_dump()) - # Add AgentHub-specific configuration handling import json import os diff --git a/src/uipath_mcp/_cli/_templates/pyproject.toml.template b/src/uipath_mcp/_cli/_templates/pyproject.toml.template index 5c71b10..39d167b 100644 --- a/src/uipath_mcp/_cli/_templates/pyproject.toml.template +++ b/src/uipath_mcp/_cli/_templates/pyproject.toml.template @@ -4,6 +4,6 @@ version = "0.0.1" description = "Description for $project_name project" authors = [{ name = "John Doe", email = "john.doe@myemail.com" }] dependencies = [ - "uipath-mcp>=0.0.101", + "uipath-mcp>=0.0.103", ] requires-python = ">=3.11" diff --git a/src/uipath_mcp/_cli/cli_new.py b/src/uipath_mcp/_cli/cli_new.py index cf4e3e3..b5bbaad 100644 --- a/src/uipath_mcp/_cli/cli_new.py +++ b/src/uipath_mcp/_cli/cli_new.py @@ -3,29 +3,13 @@ from typing import List, Optional, Tuple import click +from uipath._cli._utils._common import clean_directory from uipath._cli._utils._console import ConsoleLogger from uipath._cli.middlewares import MiddlewareResult console = ConsoleLogger() -def clean_directory(directory: str) -> None: - """Clean up Python files in the specified directory. - - Args: - directory (str): Path to the directory to clean. - - This function removes all Python files (*.py) from the specified directory. - It's used to prepare a directory for new MCP server template files. - """ - for file_name in os.listdir(directory): - file_path = os.path.join(directory, file_name) - - if os.path.isfile(file_path) and file_name.endswith(".py"): - # Delete the file - os.remove(file_path) - - def write_template_file( target_directory: str, file_path: str, diff --git a/uv.lock b/uv.lock index e5317ef..69dfe06 100644 --- a/uv.lock +++ b/uv.lock @@ -1996,7 +1996,7 @@ wheels = [ [[package]] name = "uipath" -version = "2.1.1" +version = "2.1.14" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "azure-monitor-opentelemetry" }, @@ -2011,14 +2011,14 @@ dependencies = [ { name = "tomli" }, { name = "truststore" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/c8/3a/ec026311bf9e0bee34f310c9144337102fb527f129725362764e955f17e4/uipath-2.1.1.tar.gz", hash = "sha256:2a263d2b0c27892321b16a8538cbee6853e41dc14d89ae3ecaa130d9caf3b280", size = 1907270 } +sdist = { url = "https://files.pythonhosted.org/packages/cf/79/5f95d2451bdfd2a0511dda2114ca79beb0dfedeb5d7984a94ce07f41e3fc/uipath-2.1.14.tar.gz", hash = "sha256:9aaa4955ac557c06ac125020a2e225cae2c16cbca9d60d5b84b45e9d2c6f1ea5", size = 1938877 } wheels = [ - { url = "https://files.pythonhosted.org/packages/4e/1d/8fb6e56901d900d636be27e6b4fddff3d9d3ed19f9371653afdf970f7f73/uipath-2.1.1-py3-none-any.whl", hash = "sha256:4b48d716e557ba6263d13cdde6c9359c21c35eee3bb309990edb0de22cb5da37", size = 136616 }, + { url = "https://files.pythonhosted.org/packages/f1/2b/7e4037a8747393ad3b983b30c4b5c71207c406e247b76d94fe3cf0fdbf2f/uipath-2.1.14-py3-none-any.whl", hash = "sha256:44e2802d50e008f71b702dc0bc1cd12c528d2df660127a689c65eae40f81d25b", size = 174963 }, ] [[package]] name = "uipath-mcp" -version = "0.0.101" +version = "0.0.103" source = { editable = "." } dependencies = [ { name = "mcp" }, @@ -2041,7 +2041,7 @@ dev = [ requires-dist = [ { name = "mcp", specifier = "==1.11.0" }, { name = "pysignalr", specifier = "==1.3.0" }, - { name = "uipath", specifier = ">=2.1.0,<2.2.0" }, + { name = "uipath", specifier = ">=2.1.14,<2.2.0" }, ] [package.metadata.requires-dev]