Skip to content

Commit 06aaab0

Browse files
CI check fixes
Signed-off-by: Mikayla Thompson <[email protected]>
1 parent 3550e98 commit 06aaab0

File tree

6 files changed

+132
-11
lines changed

6 files changed

+132
-11
lines changed

_typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ extend-exclude = [
44
"ecosystem/**",
55
"scripts/**/*.in",
66
"crates/uv-build-frontend/src/pipreqs/mapping",
7+
"crates/uv/src/commands/tool/top_packages.txt",
78
]
89
ignore-hidden = false
910

crates/uv/tests/it/show_settings.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7831,7 +7831,7 @@ fn preview_features() {
78317831
show_settings: true,
78327832
preview: Preview {
78337833
flags: PreviewFeatures(
7834-
PYTHON_INSTALL_DEFAULT | PYTHON_UPGRADE | JSON_OUTPUT | PYLOCK | ADD_BOUNDS | PACKAGE_CONFLICTS | EXTRA_BUILD_DEPENDENCIES | DETECT_MODULE_CONFLICTS | FORMAT | NATIVE_AUTH | S3_ENDPOINT | CACHE_SIZE | INIT_PROJECT_FLAG | WORKSPACE_METADATA | WORKSPACE_DIR,
7834+
PYTHON_INSTALL_DEFAULT | PYTHON_UPGRADE | JSON_OUTPUT | PYLOCK | ADD_BOUNDS | PACKAGE_CONFLICTS | EXTRA_BUILD_DEPENDENCIES | DETECT_MODULE_CONFLICTS | FORMAT | NATIVE_AUTH | S3_ENDPOINT | CACHE_SIZE | INIT_PROJECT_FLAG | WORKSPACE_METADATA | WORKSPACE_DIR | TOOL_INSTALL_CONFIRMATION,
78357835
),
78367836
},
78377837
python_preference: Managed,
@@ -8059,7 +8059,7 @@ fn preview_features() {
80598059
show_settings: true,
80608060
preview: Preview {
80618061
flags: PreviewFeatures(
8062-
PYTHON_INSTALL_DEFAULT | PYTHON_UPGRADE | JSON_OUTPUT | PYLOCK | ADD_BOUNDS | PACKAGE_CONFLICTS | EXTRA_BUILD_DEPENDENCIES | DETECT_MODULE_CONFLICTS | FORMAT | NATIVE_AUTH | S3_ENDPOINT | CACHE_SIZE | INIT_PROJECT_FLAG | WORKSPACE_METADATA | WORKSPACE_DIR,
8062+
PYTHON_INSTALL_DEFAULT | PYTHON_UPGRADE | JSON_OUTPUT | PYLOCK | ADD_BOUNDS | PACKAGE_CONFLICTS | EXTRA_BUILD_DEPENDENCIES | DETECT_MODULE_CONFLICTS | FORMAT | NATIVE_AUTH | S3_ENDPOINT | CACHE_SIZE | INIT_PROJECT_FLAG | WORKSPACE_METADATA | WORKSPACE_DIR | TOOL_INSTALL_CONFIRMATION,
80638063
),
80648064
},
80658065
python_preference: Managed,

docs/reference/cli.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,9 @@ uv tool run [OPTIONS] [COMMAND]
23622362
<p>Can be provided multiple times.</p>
23632363
<p>Expects to receive either a hostname (e.g., <code>localhost</code>), a host-port pair (e.g., <code>localhost:8080</code>), or a URL (e.g., <code>https://localhost</code>).</p>
23642364
<p>WARNING: Hosts included in this list will not be verified against the system's certificate store. Only use <code>--allow-insecure-host</code> in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.</p>
2365-
<p>May also be set with the <code>UV_INSECURE_HOST</code> environment variable.</p></dd><dt id="uv-tool-run--build-constraints"><a href="#uv-tool-run--build-constraints"><code>--build-constraints</code></a>, <code>--build-constraint</code>, <code>-b</code> <i>build-constraints</i></dt><dd><p>Constrain build dependencies using the given requirements files when building source distributions.</p>
2365+
<p>May also be set with the <code>UV_INSECURE_HOST</code> environment variable.</p></dd><dt id="uv-tool-run--approve-all-tool-installs"><a href="#uv-tool-run--approve-all-tool-installs"><code>--approve-all-tool-installs</code></a></dt><dd><p>Automatically approve all tool installations without prompting.</p>
2366+
<p>When enabled, skips confirmation prompts for installing uncached packages. This is useful for CI/CD environments or when you trust all packages.</p>
2367+
</dd><dt id="uv-tool-run--build-constraints"><a href="#uv-tool-run--build-constraints"><code>--build-constraints</code></a>, <code>--build-constraint</code>, <code>-b</code> <i>build-constraints</i></dt><dd><p>Constrain build dependencies using the given requirements files when building source distributions.</p>
23662368
<p>Constraints files are <code>requirements.txt</code>-like files that only control the <em>version</em> of a requirement that's installed. However, including a package in a constraints file will <em>not</em> trigger the installation of that package.</p>
23672369
<p>May also be set with the <code>UV_BUILD_CONSTRAINT</code> environment variable.</p></dd><dt id="uv-tool-run--cache-dir"><a href="#uv-tool-run--cache-dir"><code>--cache-dir</code></a> <i>cache-dir</i></dt><dd><p>Path to the cache directory.</p>
23682370
<p>Defaults to <code>$XDG_CACHE_HOME/uv</code> or <code>$HOME/.cache/uv</code> on macOS and Linux, and <code>%LOCALAPPDATA%\uv\cache</code> on Windows.</p>

docs/reference/settings.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,6 +2204,73 @@ Accepts both standalone package names (`ruff`) and version specifiers (`ruff<0.5
22042204

22052205
---
22062206

2207+
### `install-prompt`
2208+
2209+
Settings for tool install confirmation prompts.
2210+
2211+
#### [`approve-all-heuristics`](#install-prompt_approve-all-heuristics) {: #install-prompt_approve-all-heuristics }
2212+
<span id="approve-all-heuristics"></span>
2213+
2214+
A list of heuristics to use when deciding whether to show a confirmation prompt.
2215+
2216+
Each heuristic checks a different condition. If all enabled heuristics pass (i.e., the
2217+
package matches all checks), the prompt is skipped. Available heuristics:
2218+
- `top-packages`: Skip prompt if package is in the top Python packages list
2219+
- `previously-installed`: Skip prompt if package has been previously approved (not yet implemented)
2220+
- `user-allowlist`: Skip prompt if package is in user's allowlist file (not yet implemented)
2221+
2222+
Defaults to `["top-packages"]`.
2223+
2224+
**Default value**: `["top-packages"]`
2225+
2226+
**Type**: `list[str]`
2227+
2228+
**Example usage**:
2229+
2230+
=== "pyproject.toml"
2231+
2232+
```toml
2233+
[tool.uv.install-prompt]
2234+
approve-all-heuristics = ["top-packages", "previously-installed"]
2235+
```
2236+
=== "uv.toml"
2237+
2238+
```toml
2239+
[install-prompt]
2240+
approve-all-heuristics = ["top-packages", "previously-installed"]
2241+
```
2242+
2243+
---
2244+
2245+
#### [`approve-all-tool-installs`](#install-prompt_approve-all-tool-installs) {: #install-prompt_approve-all-tool-installs }
2246+
<span id="approve-all-tool-installs"></span>
2247+
2248+
Automatically approve all tool installations without prompting.
2249+
2250+
When enabled, `uvx` and `uv tool run` will skip confirmation prompts for installing
2251+
uncached packages. This is useful for CI/CD environments or when you trust all packages.
2252+
2253+
**Default value**: `false`
2254+
2255+
**Type**: `bool`
2256+
2257+
**Example usage**:
2258+
2259+
=== "pyproject.toml"
2260+
2261+
```toml
2262+
[tool.uv.install-prompt]
2263+
approve-all-tool-installs = true
2264+
```
2265+
=== "uv.toml"
2266+
2267+
```toml
2268+
[install-prompt]
2269+
approve-all-tool-installs = true
2270+
```
2271+
2272+
---
2273+
22072274
### `pip`
22082275

22092276
Settings that are specific to the `uv pip` command-line interface.

scripts/uvx_usage_on_gh/fetch_uvx_usage.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,12 @@ def extract_package_name(match_text: str) -> Optional[str]:
128128
package = package.split("@")[0]
129129

130130
# Validation checks
131-
if package.startswith("--") or "/" in package or "\\" in package or len(package) < 2:
131+
if (
132+
package.startswith("--")
133+
or "/" in package
134+
or "\\" in package
135+
or len(package) < 2
136+
):
132137
return None
133138

134139
return package
@@ -303,7 +308,9 @@ async def wait_for_rate_limit(rate_limit: RateLimitInfo) -> None:
303308
await asyncio.sleep(RATE_LIMIT_DELAY)
304309

305310

306-
def build_size_query(base_query: str, start_bytes: int, end_bytes: Optional[int]) -> str:
311+
def build_size_query(
312+
base_query: str, start_bytes: int, end_bytes: Optional[int]
313+
) -> str:
307314
"""Build a GitHub Code Search query with size filter."""
308315
if end_bytes is None:
309316
return f"{base_query} size:>={start_bytes}"
@@ -365,6 +372,7 @@ async def check_packages_batch(
365372
Returns:
366373
Dictionary mapping package names to their existence status
367374
"""
375+
368376
async def check_one(package: str) -> tuple[str, bool]:
369377
async with semaphore:
370378
async with httpx.AsyncClient() as client:
@@ -422,7 +430,7 @@ async def search_uvx_usage(
422430
current_rate_limit = RateLimitInfo(None, None)
423431

424432
# Size buckets to work around GitHub's 1000 result limit
425-
# It would be way smarter to do this dynamically (query a given size range and do a
433+
# It would be way smarter to do this dynamically (query a given size range and do a
426434
# binary/proportional split on the number of results) but I already got this far
427435
# so I'm not going to change it for now.
428436
markdown_size_buckets = [
@@ -500,7 +508,9 @@ async def process_unknown_packages() -> None:
500508
packages_to_check = list(set(unknown_packages_queue))
501509
unknown_packages_queue.clear()
502510

503-
logger.info(f"Checking {len(packages_to_check)} unknown packages against PyPI...")
511+
logger.info(
512+
f"Checking {len(packages_to_check)} unknown packages against PyPI..."
513+
)
504514
results = await check_packages_batch(packages_to_check, pypi_cache, semaphore)
505515

506516
# Update valid package counts based on results
@@ -509,7 +519,9 @@ async def process_unknown_packages() -> None:
509519
count = all_package_counts.get(package, 0)
510520
if count > 0:
511521
valid_package_counts[package] = count
512-
logger.debug(f"Added {package} to valid packages ({count} occurrences)")
522+
logger.debug(
523+
f"Added {package} to valid packages ({count} occurrences)"
524+
)
513525
else:
514526
logger.warning(f"Package {package} validated but has no count")
515527

@@ -639,9 +651,7 @@ def write_top_packages(
639651
)
640652

641653
# Sort by count descending, then alphabetically
642-
sorted_packages = sorted(
643-
packages.items(), key=lambda x: (-x[1], x[0])
644-
)
654+
sorted_packages = sorted(packages.items(), key=lambda x: (-x[1], x[0]))
645655

646656
for package, count in sorted_packages:
647657
f.write(f"{package}\n")

uv.schema.json

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)