Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[project]
name = "uipath_sdk"
version = "0.0.3"
description = "UiPath Client for the UiPath API"
version = "0.0.4"
description = "UiPath SDK"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"click>=8.1.8",
"httpx>=0.28.1",
"python-dotenv>=1.0.1",
]
Expand All @@ -20,6 +19,9 @@ classifiers = [
Homepage = "https://uipath.com"
Repository = "https://github.com/UiPath/platform-sdk.git"

[project.scripts]
uipath = "uipath_cli.cli:cli"


[build-system]
requires = ["hatchling"]
Expand All @@ -28,6 +30,7 @@ build-backend = "hatchling.build"

[dependency-groups]
dev = [
"click>=8.1.8",
"bandit>=1.8.2",
"mypy>=1.14.1",
"ruff>=0.9.4",
Expand All @@ -40,8 +43,10 @@ indent-width = 4


[tool.ruff.lint]
select = ["E", "F", "B", "I"]
select = ["E", "F", "B", "I"]

[tool.ruff.lint.per-file-ignores]
"*" = ["E501"]

[tool.ruff.format]
quote-style = "double"
Expand Down
1 change: 0 additions & 1 deletion src/uipath_cli/.python-version

This file was deleted.

17 changes: 17 additions & 0 deletions src/uipath_cli/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# type: ignore
import click

from .cli_init import cli_init as init
from .cli_pack import cli_pack as pack


@click.group()
def cli() -> None:
pass


cli.add_command(init)
cli.add_command(pack)

if __name__ == "__main__":
cli()
70 changes: 46 additions & 24 deletions src/uipath_cli/cli-init.py → src/uipath_cli/cli_init.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import click
# type: ignore
import json
import os
import shutil
import json

import click


def get_final_path(target_directory, project_name):
final_path = os.path.abspath(target_directory)
Expand All @@ -15,49 +18,68 @@ def get_final_path(target_directory, project_name):

return final_path


def generateInitFile(target_directory, project_name):
final_path = get_final_path(target_directory, project_name)


template_path = os.path.join(os.path.dirname(__file__), 'templates/main.py.template')
target_path = os.path.join(final_path, 'main.py')
template_path = os.path.join(
os.path.dirname(__file__), "templates/main.py.template"
)
target_path = os.path.join(final_path, "main.py")

shutil.copyfile(template_path, target_path)


def generateRequirementsFile(target_directory, project_name):
final_path = get_final_path(target_directory, project_name)
requirements_path = os.path.join(final_path, 'requirements.txt')
with open(requirements_path, 'w') as f:

requirements_path = os.path.join(final_path, "requirements.txt")
with open(requirements_path, "w") as f:
f.write("uipath==1.0.1\n")


def generateConfigFile(target_directory, project_name, description, type):
final_path = get_final_path(target_directory, project_name)
config_path = os.path.join(final_path, 'config.json')

config_path = os.path.join(final_path, "config.json")
config_data = {
"project_name": project_name,
"description": description,
"type": type,
}

with open(config_path, 'w') as config_file:
with open(config_path, "w") as config_file:
json.dump(config_data, config_file, indent=4)


@click.command()
@click.option("--name", prompt="Name", default="my-first-project", help="Name of your project")
@click.option("--type", prompt="Type (process/agent)", help="Whether the project is a process or an agent")
@click.option("--description", prompt="Description", default="", help="Description for your project")
@click.option("--directory", prompt="Target Directory", default="./proj", help="Target directory for your project")
def hello(name, description, directory, type):
click.echo(f"Initializing project {name} with description {description} in directory {directory}")
@click.option(
"--name", prompt="Name", default="my-first-project", help="Name of your project"
)
@click.option(
"--type",
prompt="Type (process/agent)",
help="Whether the project is a process or an agent",
)
@click.option(
"--description",
prompt="Description",
default="",
help="Description for your project",
)
@click.option(
"--directory",
prompt="Target Directory",
default="./proj",
help="Target directory for your project",
)
def cli_init(name, description, directory, type):
click.echo(
f"Initializing project {name} with description {description} in directory {directory}"
)
generateInitFile(directory, name)
generateRequirementsFile(directory, name)
generateConfigFile(directory, name, description, type)
click.echo(f"Make sure to run `pip install -r {os.path.join(directory, 'requirements.txt')}` to install dependencies")

if __name__ == '__main__':
hello()



click.echo(
f"Make sure to run `pip install -r {os.path.join(directory, 'requirements.txt')}` to install dependencies"
)
Loading