RTECO-992 - Added support for uv package manager#3436
RTECO-992 - Added support for uv package manager#3436agrasth wants to merge 11 commits intojfrog:masterfrom
Conversation
5f863ce to
ce3bc96
Compare
ce3bc96 to
37ae599
Compare
There was a problem hiding this comment.
command definition should be part of jfrog-cli-artifactory
| if: matrix.os.name != 'macos' | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.11.5" |
There was a problem hiding this comment.
Can we have a matrix step with latest version of python as well.
There was a problem hiding this comment.
Added python-version as a matrix dimension: ["3.11.5", "3.x"]. The 3.x entry always resolves to the latest stable Python 3 via actions/setup-python.
|
|
||
| - name: Setup UV | ||
| if: matrix.os.name != 'macos' | ||
| uses: astral-sh/setup-uv@v5 |
There was a problem hiding this comment.
same with uv package manager as well create matrix step and check if it possible to fetch lastest version always.
There was a problem hiding this comment.
Added uv-version as a matrix dimension: ["0.6.17", "latest"]. The astral-sh/setup-uv action supports version: "latest" to always fetch the newest release. The version input is now templated from the matrix.
| Action: PoetryCmd, | ||
| }, | ||
| { | ||
| Name: "uv", |
There was a problem hiding this comment.
let's mark the command as hidden for now.
There was a problem hiding this comment.
Added Hidden: true to the uv command definition. The command definition will move to jfrog-cli-artifactory in a follow-up.
| } | ||
|
|
||
| // uvPyprojectToml holds the [tool.uv] fields we need from pyproject.toml. | ||
| type uvPyprojectToml struct { |
There was a problem hiding this comment.
we don't need nested structs here and isn't github.com/BurntSushi/toml library used for parsing toml files?
There was a problem hiding this comment.
Replaced the anonymous nested struct in uvPyprojectToml with a named uvToolUv type and reused the existing uvIndexEntry type for the index slice. github.com/BurntSushi/toml was already the parser in use.
| log.Info("UV auth [publish]: using UV_PUBLISH_USERNAME/PASSWORD (native, step 2b)") | ||
| default: | ||
| // deployerRepo is already resolved (CLI flag > pyproject.toml) before auth block. | ||
| switch { |
There was a problem hiding this comment.
is this nested switch block? Looks like a code smell. Please avoid.
There was a problem hiding this comment.
Removed the nested switch entirely. The fallback path is now extracted into uvInjectPublishCredentials which uses early returns instead of nesting.
| // (when index and publish URL share the same Artifactory host, | ||
| // the index native credentials are valid for publish too) | ||
| // Fallback: jf server config (only if publish host == jf config host) | ||
| switch { |
There was a problem hiding this comment.
Please refactor this entire block.
There was a problem hiding this comment.
Refactored into two flat functions: uvApplyPublishAuth (single-level switch over all 5 priority steps) and uvInjectPublishCredentials (early-return guards for steps 4b and fallback). Call site is now a single line.
…d, flat structs and no nested switch in publish auth
…emove UV helpers from cli.go and buildinfo.go
bbea393 to
2cf421e
Compare
… macOS matrix slot
Update python.NewNativeUvCommand() call to python.NewNativeUVCommand() to match the renamed identifier in jfrog-cli-artifactory.
ae57501 to
c94d20b
Compare
4d1e242 to
eba1156
Compare
…traversal false positive
b2938f8 to
247b05e
Compare
masterbranch.go vet ./....go fmt ./....Adds
jf uv— a transparent wrapper over theuvCLI with Artifactory credential injection, build-info collection, and full support for alluvsubcommands (sync,lock,add,remove,build,publish,run,tree, etc.).How it works
jf uv <args>behaves identically touv <args>with two additions:UV_INDEX_*env vars before callinguv, following UV's own auth priority chain (env vars → embedded URL → netrc → jf config)jf rt bpTypical workflow
CI/Integration notes
UV_INDEX_URL,UV_DEFAULT_INDEX, andUV_INDEX_*_USERNAME/PASSWORDenv vars — jf defers to any native auth already present[dependency-groups](PEP 735) and[tool.uv.dev-dependencies]both supported;--no-dev,--only-dev,--group,--only-group,--no-group,--all-groupsall respected viauv pip listground truthjf uv run --script <file>collects build-info from the script's own inline dependencies (not the surrounding project)Hidden: truepending migration of the definition tojfrog-cli-artifactoryTest coverage
Added
uv_test.gowith integration tests covering: sync/lock/add/remove/build/publish pipelines, all auth methods, virtual/local/remote repo combinations, build-info verification (deps, artifacts, requestedBy chains, sha1/md5),--module,--server-id,--project, dev/group dependency handling, and CI/VCS properties.