Skip to content

feat: save dependencies metadata#427

Merged
cristipufu merged 1 commit into
mainfrom
feat/dependencies
Jul 9, 2025
Merged

feat: save dependencies metadata#427
cristipufu merged 1 commit into
mainfrom
feat/dependencies

Conversation

@cristipufu

@cristipufu cristipufu commented Jul 1, 2025

Copy link
Copy Markdown
Member

Summary

Adds support for parsing and saving project dependencies from pyproject.toml into the package’s operate.json.

Development Package

  • Add this package as a dependency in your pyproject.toml:
[project]
dependencies = [
  # Exact version:
  "uipath==2.0.76.dev1004270554",

  # Any version from PR
  "uipath>=2.0.76.dev1004270000,<2.0.76.dev1004280000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath = { index = "testpypi" }

@cristipufu cristipufu requested a review from Copilot July 1, 2025 16:39
@cristipufu cristipufu self-assigned this Jul 1, 2025
@cristipufu cristipufu added the build:dev Create a dev build from the pr label Jul 1, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for parsing and saving project dependencies from pyproject.toml into the package’s operate.json.

  • Implements parse_dependency_string and extract_dependencies_from_toml to handle PEP 508 specs.
  • Updates read_toml_project, generate_operate_file, and pack_fn to include dependencies metadata.
  • Adds test_dependencies_version_formats in test_pack.py to verify a wide range of version formats.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/cli/test_pack.py Added test_dependencies_version_formats to validate parsing and inclusion of dependency metadata.
src/uipath/_cli/cli_pack.py Introduced regex-based parsing functions, integrated dependency extraction, and wired metadata into operate.json. Removed unused version helper.
Comments suppressed due to low confidence (3)

src/uipath/_cli/cli_pack.py:447

  • The branch for non-string dependency entries isn’t covered in tests. Consider adding a case with a non-string dependency to verify the warning path.
            console.warning(f"Skipping non-string dependency: {dep}")

src/uipath/_cli/cli_pack.py:474

  • After logging this error, the function continues and will reference an undefined content. Consider returning or re-raising here to avoid runtime errors.
        console.error(f"Failed to read or parse pyproject.toml: {e}")

src/uipath/_cli/cli_pack.py:442

  • [nitpick] Ensure that console is imported or otherwise available, or switch to click.echo or a module-level logger to avoid a NameError at runtime.
        console.warning("dependencies should be a list in pyproject.toml")

Comment thread src/uipath/_cli/cli_pack.py
@cristipufu cristipufu merged commit 7035c31 into main Jul 9, 2025
16 checks passed
@cristipufu cristipufu deleted the feat/dependencies branch July 9, 2025 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build:dev Create a dev build from the pr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants