Skip to content

refactor(platform): add uipath.platform.constants as the single source of truth#1781

Merged
vldcmp-uipath merged 4 commits into
mainfrom
feat/core-constants-source-of-truth
Jul 1, 2026
Merged

refactor(platform): add uipath.platform.constants as the single source of truth#1781
vldcmp-uipath merged 4 commits into
mainfrom
feat/core-constants-source-of-truth

Conversation

@vldcmp-uipath

@vldcmp-uipath vldcmp-uipath commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Gives shared constants a cheap-to-import home and makes the platform package import lazily, so CLI / agent-runtime hot paths don't pay for the full service layer just to read a constant.

  • New uipath.platform.constants — a constants/ package sibling to common/, the single source of truth for the shared string constants.
  • Lazy uipath/platform/__init__.py (PEP 562)UiPath and the config types resolve on attribute access, so importing uipath.platform.constants no longer drags in the service layer. Cold import uipath.platform.constants drops ~273ms → ~6ms and pulls in neither httpx nor pydantic.
  • Both re-export paths deprecateduipath.platform.common.constants and uipath._utils.constants forward to uipath.platform.constants and emit a FutureWarning.
  • All internal importers migrated (source + tests, both packages) to uipath.platform.constants, so the SDK/CLI never trips its own deprecation warning — import uipath._cli is warning-free.
  • Tests — parity + deprecation tests, structural invariants for the constants module, and coverage of ConfigurationManager env-var/path properties.

Compatibility

  • External consumers importing uipath.platform.common.constants keep working (with a deprecation warning).
  • uipath.eval.constants is a separate, unrelated module — untouched.
  • uipath-core is unchanged by this PR.

Version bumps

  • uipath-platform 0.1.88 → 0.1.89
  • uipath 2.12.3 → 2.12.4 (platform pin → >=0.1.89)
  • uipath-core unchanged (0.5.28)

Testing

  • ruff clean on src + tests for all three packages.
  • All three full test suites pass (0 failures).
  • Verified: import uipath.platform.constants = ~6ms with no httpx/pydantic; from uipath.platform import UiPath still works (lazy); import uipath._cli emits no deprecation warning; both deprecated paths warn when imported directly; shim ↔ canonical parity holds.

Note: the branch name (feat/core-constants-source-of-truth) is a leftover from an earlier iteration that placed the module in uipath-core; the constants now live in uipath.platform.constants.

🤖 Generated with Claude Code

@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime test:uipath-integrations labels Jul 1, 2026
@vldcmp-uipath vldcmp-uipath force-pushed the feat/core-constants-source-of-truth branch 3 times, most recently from be39460 to 8990ca1 Compare July 1, 2026 15:40
@vldcmp-uipath vldcmp-uipath changed the title refactor(core): make uipath.core.constants the single source of truth refactor(platform): add uipath.platform.constants as the single source of truth Jul 1, 2026
vldcmp-uipath and others added 4 commits July 1, 2026 19:08
…e of truth

Establishes a cheap-to-import home for shared constants and makes the platform
package import lazily so the CLI/agent-runtime hot paths don't pay for the full
service layer just to read a constant.

- Add `uipath.platform.constants` (a `constants/` package sibling to `common/`)
  as the single source of truth for the shared string constants.
- Make `uipath/platform/__init__.py` lazy (PEP 562): `UiPath` and the config
  types resolve on attribute access, so importing `uipath.platform.constants`
  no longer pulls in the service layer. Cold `import uipath.platform.constants`
  drops ~273ms -> ~6ms and imports neither httpx nor pydantic.
- Deprecate BOTH re-export paths — `uipath.platform.common.constants` and
  `uipath._utils.constants` now forward to `uipath.platform.constants` and emit
  a FutureWarning pointing there.
- Migrate every internal importer (source + tests, both packages) to
  `uipath.platform.constants`, so the SDK/CLI never trips its own deprecation
  warning (`import uipath._cli` is warning-free).
- Tests: parity + deprecation tests and structural invariants for the constants
  module; cover ConfigurationManager env-var/path properties.
- Document `uipath.platform.constants` in the uipath-platform README.

External consumers importing `uipath.platform.common.constants` keep working
(with a deprecation warning). `uipath.eval.constants` is a separate, unrelated
module and is untouched. `uipath-core` is unchanged.

Version bumps: uipath-platform 0.1.88 -> 0.1.89, uipath 2.12.2 -> 2.12.3
(uipath's platform pin -> >=0.1.89).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…stants blurb

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vldcmp-uipath vldcmp-uipath force-pushed the feat/core-constants-source-of-truth branch from a70e452 to 0c1ea75 Compare July 1, 2026 16:09
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

@vldcmp-uipath vldcmp-uipath merged commit f45f948 into main Jul 1, 2026
163 checks passed
@vldcmp-uipath vldcmp-uipath deleted the feat/core-constants-source-of-truth branch July 1, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants