Skip to content

Commit

Permalink
Merge branch 'main' into gen-env
Browse files Browse the repository at this point in the history
# Conflicts:
#	crates/uv-static/src/env_vars.rs
#	docs/configuration/environment.md
  • Loading branch information
j178 committed Nov 1, 2024
2 parents 46b3d68 + bf8436c commit 66993df
Show file tree
Hide file tree
Showing 203 changed files with 14,802 additions and 6,784 deletions.
135 changes: 72 additions & 63 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,37 +108,30 @@ jobs:
- name: "Clippy"
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings

cargo-clippy-xwin:
# Do not set timeout below 15 minutes as uncached xwin Windows SDK download can take 10+ minutes
timeout-minutes: 20
cargo-clippy-windows:
timeout-minutes: 15
needs: determine_changes
if: ${{ github.repository == 'astral-sh/uv' && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }}
runs-on: ubuntu-latest
runs-on:
labels: "windows-latest-xlarge"
name: "cargo clippy | windows"
steps:
- uses: actions/checkout@v4
- name: Load xwin cache
uses: actions/cache@v4
with:
path: "${{ github.workspace}}/.xwin"
key: cargo-xwin-x86_64
- name: Load rust cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: Swatinem/rust-cache@v2

- name: Create Dev Drive using ReFS
run: ${{ github.workspace }}/.github/workflows/setup-dev-drive.ps1

# actions/checkout does not let us clone into anywhere outside ${{ github.workspace }}, so we have to copy the clone...
- name: Copy Git Repo to Dev Drive
run: |
Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.UV_WORKSPACE }}" -Recurse
- name: "Install Rust toolchain"
run: rustup target add x86_64-pc-windows-msvc
- name: "Install cargo-xwin"
uses: taiki-e/install-action@v2
with:
tool: cargo-xwin
- name: Install xwin dependencies
run: sudo apt-get install --no-install-recommends -y lld llvm clang cmake ninja-build
run: rustup component add clippy

- name: "Clippy"
run: cargo xwin clippy --target x86_64-pc-windows-msvc --workspace --all-targets --all-features --locked --profile fast-build -- -D warnings
env:
XWIN_ARCH: "x86_64"
XWIN_CACHE_DIR: "${{ github.workspace}}/.xwin"
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings

cargo-dev-generate-all:
timeout-minutes: 10
Expand Down Expand Up @@ -303,7 +296,7 @@ jobs:
# See https://github.com/astral-sh/uv/issues/6940
UV_LINK_MODE: copy
run: |
cargo nextest run --no-default-features --features python,pypi --workspace --status-level skip --failure-output immediate-final --no-fail-fast -j 20 --final-status-level slow
cargo nextest run --no-default-features --features python,pypi,python-managed --workspace --status-level skip --failure-output immediate-final --no-fail-fast -j 20 --final-status-level slow
- name: "Smoke test"
working-directory: ${{ env.UV_WORKSPACE }}
Expand All @@ -329,11 +322,10 @@ jobs:
# Separate jobs for the nightly crate
windows-trampoline-check:
# Do not set timeout below 15 minutes as uncached xwin Windows SDK download can take 10+ minutes
timeout-minutes: 20
timeout-minutes: 15
needs: determine_changes
if: ${{ github.repository == 'astral-sh/uv' && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }}
runs-on: ubuntu-latest
runs-on: windows-latest-xlarge
name: "check windows trampoline | ${{ matrix.target-arch }}"
strategy:
fail-fast: false
Expand All @@ -342,50 +334,45 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Load xwin cache
uses: actions/cache@v4
with:
path: "${{ github.workspace }}/.xwin"
key: cargo-xwin-${{ matrix.target-arch }}
- name: Create Dev Drive using ReFS
run: ${{ github.workspace }}/.github/workflows/setup-dev-drive.ps1

- uses: rui314/setup-mold@v1
# actions/checkout does not let us clone into anywhere outside ${{ github.workspace }}, so we have to copy the clone...
- name: Copy Git Repo to Dev Drive
run: |
Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.UV_WORKSPACE }}" -Recurse
- uses: Swatinem/rust-cache@v2
with:
workspaces: ${{ github.workspace }}/crates/uv-trampoline
workspaces: ${{ env.UV_WORKSPACE }}/crates/uv-trampoline

- name: "Install Rust toolchain"
working-directory: ${{ github.workspace }}/crates/uv-trampoline
working-directory: ${{ env.UV_WORKSPACE }}/crates/uv-trampoline
run: |
rustup target add ${{ matrix.target-arch }}-pc-windows-msvc
rustup component add rust-src --target ${{ matrix.target-arch }}-pc-windows-msvc
- name: "Install cargo-xwin and cargo-bloat"
- name: "Install cargo-bloat"
uses: taiki-e/install-action@v2
with:
tool: cargo-xwin,cargo-bloat

- name: "Install xwin dependencies"
run: sudo apt-get install --no-install-recommends -y lld llvm clang cmake ninja-build
tool: cargo-bloat

- name: "Clippy"
working-directory: ${{ github.workspace }}/crates/uv-trampoline
if: matrix.target-arch == 'x86_64'
run: cargo xwin clippy --all-features --locked --target x86_64-pc-windows-msvc --tests -- -D warnings
env:
XWIN_ARCH: "x86_64"
XWIN_CACHE_DIR: "${{ github.workspace }}/.xwin"
working-directory: ${{ env.UV_WORKSPACE }}/crates/uv-trampoline
run: cargo clippy --all-features --locked --target x86_64-pc-windows-msvc --tests -- -D warnings

- name: "Bloat Check"
working-directory: ${{ github.workspace }}/crates/uv-trampoline
if: matrix.target-arch == 'x86_64'
working-directory: ${{ env.UV_WORKSPACE }}/crates/uv-trampoline
run: |
cargo xwin bloat --release --target x86_64-pc-windows-msvc | \
grep -v -i -E 'core::fmt::write|core::fmt::getcount' | \
grep -q -E 'core::fmt|std::panicking|std::backtrace_rs' && exit 1 || exit 0
env:
XWIN_ARCH: "x86_64"
XWIN_CACHE_DIR: "${{ github.workspace }}/.xwin"
$output = cargo bloat --release --target x86_64-pc-windows-msvc
$filteredOutput = $output | Select-String -Pattern 'core::fmt::write|core::fmt::getcount' -NotMatch
$containsPatterns = $filteredOutput | Select-String -Pattern 'core::fmt|std::panicking|std::backtrace_rs'
if ($containsPatterns) {
Exit 1
} else {
Exit 0
}
# Separate jobs for the nightly crate
windows-trampoline-test:
Expand All @@ -397,6 +384,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# Note, we exclude `aarch64` because it's not supported by the GitHub runner
target-arch: ["x86_64", "i686"]
steps:
- uses: actions/checkout@v4
Expand All @@ -408,16 +396,23 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
workspaces: ${{ github.workspace }}/crates/uv-trampoline
- name: "Test committed binaries"
working-directory: ${{ github.workspace }}
run: |
rustup target add ${{ matrix.target-arch }}-pc-windows-msvc
cargo test -p uv-trampoline-builder --target ${{ matrix.target-arch }}-pc-windows-msvc
# Build and copy the new binaries
- name: "Build"
working-directory: ${{ github.workspace }}/crates/uv-trampoline
run: |
cargo build --target ${{ matrix.target-arch }}-pc-windows-msvc
cp target/${{ matrix.target-arch }}-pc-windows-msvc/debug/uv-trampoline-console.exe trampolines/uv-trampoline-${{ matrix.target-arch }}-console.exe
cp target/${{ matrix.target-arch }}-pc-windows-msvc/debug/uv-trampoline-gui.exe trampolines/uv-trampoline-${{ matrix.target-arch }}-gui.exe
- name: "Test"
working-directory: ${{ github.workspace }}/crates/uv-trampoline
run: cargo test --target ${{ matrix.target-arch }}-pc-windows-msvc --test *
- name: "Test new binaries"
working-directory: ${{ github.workspace }}
run: |
# We turn off the default "production" test feature since these are debug binaries
cargo test -p uv-trampoline-builder --target ${{ matrix.target-arch }}-pc-windows-msvc --no-default-features
typos:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -707,7 +702,7 @@ jobs:
- name: "Install free-threaded Python via uv"
run: |
./uv python install 3.13t
./uv python install -v 3.13t
./uv venv -p 3.13t --python-preference only-managed
- name: "Check version"
Expand Down Expand Up @@ -779,7 +774,7 @@ jobs:
run: chmod +x ./uv

- name: "Install PyPy"
run: ./uv python install pypy3.9
run: ./uv python install -v pypy3.9

- name: "Create a virtual environment"
run: |
Expand Down Expand Up @@ -1617,9 +1612,23 @@ jobs:
- uses: actions/checkout@v4

- name: "Install pyenv"
uses: "gabrielfalcao/pyenv-action@v18"
with:
default: 3.9.7
run: |
# Install pyenv
curl https://pyenv.run | bash
# Set up environment variables for current step
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
# Install Python 3.9
pyenv install 3.9
pyenv global 3.9
# Make environment variables persist across steps
echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV
echo "$HOME/.pyenv/bin" >> $GITHUB_PATH
echo "$HOME/.pyenv/shims" >> $GITHUB_PATH
- name: "Download binary"
uses: actions/download-artifact@v4
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ exclude: |
repos:
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.21
rev: v0.22
hooks:
- id: validate-pyproject

- repo: https://github.com/crate-ci/typos
rev: v1.26.0
rev: v1.26.8
hooks:
- id: typos

Expand Down Expand Up @@ -42,7 +42,7 @@ repos:
types_or: [yaml, json5]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
rev: v0.7.1
hooks:
- id: ruff-format
- id: ruff
Expand Down
128 changes: 126 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,130 @@
# Changelog

## 0.4.29

### Enhancements

- Sort errors during display in `uv python install` ([#8684](https://github.com/astral-sh/uv/pull/8684))
- Update resolver to use disjointness checks instead of marker equality ([#8661](https://github.com/astral-sh/uv/pull/8661))
- Add `riscv64` to supported Python platform tags ([#8660](https://github.com/astral-sh/uv/pull/8660))

### Bug fixes

- Fix hard and soft float libc detection for managed Python distributions on ARM ([#8498](https://github.com/astral-sh/uv/pull/8498))
- Handle cycles in `uv pip tree` ([#8689](https://github.com/astral-sh/uv/pull/8689))
- Respect dependency group markers in `uv export` ([#8659](https://github.com/astral-sh/uv/pull/8659))
- Support transitive dependencies in Git workspaces ([#8665](https://github.com/astral-sh/uv/pull/8665))
- Use portable paths for subdirectories in lock URLs ([#8707](https://github.com/astral-sh/uv/pull/8707))
- Update `uv init --virtual` to imply `--no-package` ([#8595](https://github.com/astral-sh/uv/pull/8595))

### Preview

- Install versioned Python executables into the bin directory during `uv python install` (Unix only) ([#8458](https://github.com/astral-sh/uv/pull/8458))

### Documentation

- Clarify relationship between specifiers and `requires-python` range ([#8688](https://github.com/astral-sh/uv/pull/8688))
- Fix broken link in docs ([#8552](https://github.com/astral-sh/uv/pull/8552))
- Fix outdated documentation on `Requires-Python` ([#8679](https://github.com/astral-sh/uv/pull/8679))
- Add Google Artifact Registry index authentication guide ([#8579](https://github.com/astral-sh/uv/pull/8579))

## 0.4.28

### Enhancements

- Add support for requesting free-threaded builds via `+freethreaded` ([#8645](https://github.com/astral-sh/uv/pull/8645))
- Improve trusted publishing error messages ([#8633](https://github.com/astral-sh/uv/pull/8633))
- Remove unneeded `return` from Maturin project template ([#8604](https://github.com/astral-sh/uv/pull/8604))
- Skip Python interpreter discovery for `uv export` ([#8638](https://github.com/astral-sh/uv/pull/8638))
- Hint about missing trusted publishing permission ([#8632](https://github.com/astral-sh/uv/pull/8632))

### Configuration

- Add environment variable to disable progress output ([#8600](https://github.com/astral-sh/uv/pull/8600))

### Bug fixes

- Fork when minimum Python version increases ([#8628](https://github.com/astral-sh/uv/pull/8628))
- Ignore empty groups when validating lock ([#8598](https://github.com/astral-sh/uv/pull/8598))
- Remove duplicate word in error message ([#8589](https://github.com/astral-sh/uv/pull/8589))
- Support cyclic dependencies in `uv tree` ([#8564](https://github.com/astral-sh/uv/pull/8564))
- Update `uv init` to imply `--package` when using `--build-backend` ([#8593](https://github.com/astral-sh/uv/pull/8593))
- Restore use of `dev-dependencies` and `requires-dev` for lockfile compatibility ([#8599](https://github.com/astral-sh/uv/pull/8599))

### Documentation

- Clarify `requires-python` requirement for dependencies ([#8619](https://github.com/astral-sh/uv/pull/8619))
- Update CLI documentation for `--cache-dir` ([#8627](https://github.com/astral-sh/uv/pull/8627))

## 0.4.27

This release includes support for the `[dependency-groups]` table as recently standardized in [PEP 735](https://peps.python.org/pep-0735/). The table allows for declaration of optional dependency groups that are not published as part of the package metadata, unlike `[project.optional-dependencies]`. There are new `--group`, `--only-group`, and `--no-group` options throughout the uv interface.

Previously, uv used a single `tool.uv.dev-dependencies` list for declaration of development dependencies. Now, uv supports declaring development dependencies in a standardized format and allows splitting development dependencies into multiple groups.

For compatibility, and to simplify usage for people that do not need multiple groups, uv special-cases the group named `dev`. The `dev` group is equivalent to `tool.uv.dev-dependencies`. The contents of `tool.uv.dev-dependencies` will merged into the `dev` group in uv's resolver. The `--dev`, `--only-dev`, and `--no-dev` flags remain as aliases for the corresponding `--group` options. Support for `tool.uv.dev-dependencies` remains in this release, but will display warnings in a future release.

uv syncs the `dev` group by default — this matches the exististing behavior for `tool.uv.dev-dependencies`. The default groups can be changed with the `tool.uv.default-groups` setting.

Thank you to Stephen Rosen who authored PEP 735.

### Enhancements

- Support for PEP 735 ([#8272](https://github.com/astral-sh/uv/pull/8272))
- Add support for `--dry-run` mode in `uv lock` ([#7783](https://github.com/astral-sh/uv/pull/7783))
- Don't allow non-string email in authors ([#8520](https://github.com/astral-sh/uv/pull/8520))
- Enforce lockfile schema versions ([#8509](https://github.com/astral-sh/uv/pull/8509))

### Bug fixes

- Always attach URL to network errors ([#8444](https://github.com/astral-sh/uv/pull/8444))
- Fix dangling non-platform dependencies in `uv tree` ([#8532](https://github.com/astral-sh/uv/pull/8532))
- Prefer `lto` over `debug` free-threaded managed Python builds ([#8515](https://github.com/astral-sh/uv/pull/8515))

### Documentation

- Add `tool.uv.sources` to the "Settings" reference ([#8543](https://github.com/astral-sh/uv/pull/8543))
- Add reference to `uv build` and `uv publish` in the landing pages ([#8542](https://github.com/astral-sh/uv/pull/8542))
- Avoid duplicate `[tool.uv]` header in TOML examples ([#8545](https://github.com/astral-sh/uv/pull/8545))
- Document `.netrc` environment variable and path ([#8511](https://github.com/astral-sh/uv/pull/8511))
- Fix `.netrc` typo in authentication docs ([#8521](https://github.com/astral-sh/uv/pull/8521))
- Fix heading level of "Script support" on docs landing page ([#8544](https://github.com/astral-sh/uv/pull/8544))
- Move the installation configuration docs to a separate page ([#8546](https://github.com/astral-sh/uv/pull/8546))
- Update docs for `--publish-url` to avoid duplication. ([#8561](https://github.com/astral-sh/uv/pull/8561))
- Fix typo ([#8554](https://github.com/astral-sh/uv/pull/8554))
- Fix typo in description of `--strict` flag ([#8513](https://github.com/astral-sh/uv/pull/8513))

## 0.4.26

### Enhancements

- Allow static dependency metadata entries for direct URL requirements ([#7846](https://github.com/astral-sh/uv/pull/7846))
- Use reinstall report formatting for `uv python install --reinstall` ([#8487](https://github.com/astral-sh/uv/pull/8487))
- Add support for system-level `uv.toml` configuration ([#7851](https://github.com/astral-sh/uv/pull/7851))

### Bug fixes

- Apply `requires-python` narrowing with upper bounds ([#8403](https://github.com/astral-sh/uv/pull/8403))
- Avoid rewriting `[[tool.uv.index]]` entries when credentials are provided ([#8502](https://github.com/astral-sh/uv/pull/8502))
- Fix `uv add` comment handling for empty arrays ([#8504](https://github.com/astral-sh/uv/pull/8504))
- Replace dashes with underscores in index credential variables ([#8452](https://github.com/astral-sh/uv/pull/8452))
- Respect `--allow-insecure-host` in `uv publish` ([#8440](https://github.com/astral-sh/uv/pull/8440))
- Allow arbitrary `--package` includes in `uv tree` ([#8507](https://github.com/astral-sh/uv/pull/8507))
- Remove existing Python install after successful download in `uv python install` ([#8485](https://github.com/astral-sh/uv/pull/8485))

### Documentation

- Add docs example for URLs with `[tool.uv.dependency-metadata]` ([#8484](https://github.com/astral-sh/uv/pull/8484))
- Add help page for build failures ([#8286](https://github.com/astral-sh/uv/pull/8286))
- Fix `cache-keys` typo in `tags = true` ([#8422](https://github.com/astral-sh/uv/pull/8422))
- Add documentation examples for manual branch, rev, and tag Git dependencies ([#8497](https://github.com/astral-sh/uv/pull/8497))

### Error messages

- Improve error message for cache info serialization ([#8500](https://github.com/astral-sh/uv/pull/8500))
- Suggest `--from` command when executable is available for `uvx` ([#8473](https://github.com/astral-sh/uv/pull/8473))
- Support `--with-editable` in `uv tool install` ([#8472](https://github.com/astral-sh/uv/pull/8472))

## 0.4.25

### Enhancements
Expand Down Expand Up @@ -1901,8 +2026,7 @@ and `uv tool run` ([#4717](https://github.com/astral-sh/uv/pull/4717))
- Add `uv tool uninstall` ([#4641](https://github.com/astral-sh/uv/pull/4641))
- Add support for specifying `name@version` in `uv tool run` ([#4572](https://github.com/astral-sh/uv/pull/4572))
- Allow `uv add` to specify optional dependency groups ([#4607](https://github.com/astral-sh/uv/pull/4607))
- Allow the package spec to be passed positionally
in `uv tool install` ([#4564](https://github.com/astral-sh/uv/pull/4564))
- Allow the package spec to be passed positionally in `uv tool install` ([#4564](https://github.com/astral-sh/uv/pull/4564))
- Avoid infinite loop for cyclic installs ([#4633](https://github.com/astral-sh/uv/pull/4633))
- Indent wheels like dependencies in the lockfile ([#4582](https://github.com/astral-sh/uv/pull/4582))
- Sync all packages in a virtual workspace ([#4636](https://github.com/astral-sh/uv/pull/4636))
Expand Down
Loading

0 comments on commit 66993df

Please sign in to comment.