Skip to content

Commit

Permalink
Bump to v0.4.0 (#6764)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh authored Aug 28, 2024
1 parent 9f03465 commit d9bd3bc
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 15 deletions.
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,56 @@
# Changelog

## 0.4.0

This release adds first-class support for Python projects that are not designed as Python packages (e.g., web applications, data science projects, etc.).

In doing so, it includes some breaking changes around uv's handling of projects. Previously, uv required that all projects could be built into distributable Python packages, and installed them into the virtual environment. Projects created by `uv init` always included a `[build-system]` definition and existing projects that did not define a `[build-system]` would use the legacy setuptools build backend by default.

Most users are not developing libraries that need to be packaged and published to PyPI. Instead, they're building applications using web frameworks, or running collections of Python scripts in the project's root directory. In these cases, requiring a `[build-system]` was confusing and error-prone. In this release, uv changes the default behavior to orient around these common use cases.

In summary, the major changes are:

- uv no longer attempts to package and install projects that do not define a `[build-system]`.
- While the project itself will not be installed into the virtual environment, its dependencies will still be included.
- The previous behavior can be recovered by setting `package = true` in the `[tool.uv]` section of your `pyproject.toml`.
- `uv init` no longer creates a `src/` directory or defines a `[build-system]` by default.
- The previous behavior can be recovered with `uv init --lib` or `uv init --app --package`.
- uv allows and recommends including `[project]` definitions in virtual workspace roots.
- Previously, the uv required the `[project]` section to be omitted.
- uv allows disabling packaging of projects, even if they define a `[build-system]`, by setting `package = false` in the `[tool.uv]` section of your `pyproject.toml`.

See the latest documentation on [build systems in projects](http://localhost:8000/uv/concepts/projects/#build-systems) for more details.

### Enhancements

- Add first-class support for non-packaged projects ([#6585](https://github.com/astral-sh/uv/pull/6585))
- Add `--app` and `--lib` options to `uv init` ([#6689](https://github.com/astral-sh/uv/pull/6689))
- Use `virtual` source label in lockfile for non-packaged dependencies ([#6728](https://github.com/astral-sh/uv/pull/6728))
- Read hash from URL fragment if `--hashes` are omitted ([#6731](https://github.com/astral-sh/uv/pull/6731))
- Support `{package}@{version}` in `uv tool install` ([#6762](https://github.com/astral-sh/uv/pull/6762))
- Publish additional Docker tags without patch version ([#6734](https://github.com/astral-sh/uv/pull/6734))

### Bug fixes

- Accept either strings or structs for hosts ([#6763](https://github.com/astral-sh/uv/pull/6763))
- Avoid including non-excluded members in parent workspaces ([#6735](https://github.com/astral-sh/uv/pull/6735))
- Avoid reading stale `.egg-info` from mutable sources ([#6714](https://github.com/astral-sh/uv/pull/6714))
- Avoid writing invalid PEP 723 scripts on `tool.uv.sources` ([#6706](https://github.com/astral-sh/uv/pull/6706))
- Compare virtual members when invalidating lockfile ([#6754](https://github.com/astral-sh/uv/pull/6754))
- Do not require workspace members to sync with `--frozen` ([#6737](https://github.com/astral-sh/uv/pull/6737))
- Implement deserialization for trusted host ([#6716](https://github.com/astral-sh/uv/pull/6716))
- Avoid showing duplicate paths in `uv python list` ([#6740](https://github.com/astral-sh/uv/pull/6740))
- Raise an error for unclosed script tags in PEP 723 scripts ([#6704](https://github.com/astral-sh/uv/pull/6704))

### Documentation

- Add dependabot and renovate documentation page ([#6236](https://github.com/astral-sh/uv/pull/6236))
- Bind to the host to allow connections in FastAPI Docker example ([#6753](https://github.com/astral-sh/uv/pull/6753))
- Fix some broken links ([#6705](https://github.com/astral-sh/uv/pull/6705))
- Update FastAPI guide for virtual projects and use `uv init` to create the `pyproject.toml` ([#6752](https://github.com/astral-sh/uv/pull/6752))
- Update project documentation for the application / library concepts ([#6718](https://github.com/astral-sh/uv/pull/6718))
- Update workspace documentation to remove legacy virtual projects ([#6720](https://github.com/astral-sh/uv/pull/6720))

## 0.3.5

### Enhancements
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/uv-version/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "uv-version"
version = "0.3.5"
version = "0.4.0"
edition = { workspace = true }
rust-version = { workspace = true }
homepage = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "uv"
version = "0.3.5"
version = "0.4.0"
edition = { workspace = true }
rust-version = { workspace = true }
homepage = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ Request a specific version by including it in the URL:
=== "macOS and Linux"

```console
$ curl -LsSf https://astral.sh/uv/0.3.5/install.sh | sh
$ curl -LsSf https://astral.sh/uv/0.4.0/install.sh | sh
```

=== "Windows"

```console
$ powershell -c "irm https://astral.sh/uv/0.3.5/install.ps1 | iex"
$ powershell -c "irm https://astral.sh/uv/0.4.0/install.ps1 | iex"
```

### PyPI
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/integration/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ Note this requires `curl` to be available.
In either case, it is best practice to pin to a specific uv version, e.g., with:

```dockerfile
COPY --from=ghcr.io/astral-sh/uv:0.3.5 /uv /bin/uv
COPY --from=ghcr.io/astral-sh/uv:0.4.0 /uv /bin/uv
```

Or, with the installer:

```dockerfile
ADD https://astral.sh/uv/0.3.5/install.sh /uv-installer.sh
ADD https://astral.sh/uv/0.4.0/install.sh /uv-installer.sh
```

### Installing a project
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/integration/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ It is considered best practice to pin to a specific uv version, e.g., with:

- name: Set up uv
# Install a specific uv version using the installer
run: curl -LsSf https://astral.sh/uv/0.3.5/install.sh | sh
run: curl -LsSf https://astral.sh/uv/0.4.0/install.sh | sh
```

=== "macOS"
Expand All @@ -94,7 +94,7 @@ It is considered best practice to pin to a specific uv version, e.g., with:

- name: Set up uv
# Install a specific uv version using the installer
run: curl -LsSf https://astral.sh/uv/0.3.5/install.sh | sh
run: curl -LsSf https://astral.sh/uv/0.4.0/install.sh | sh
```

=== "Windows"
Expand All @@ -112,7 +112,7 @@ It is considered best practice to pin to a specific uv version, e.g., with:

- name: Set up uv
# Install a specific uv version using the installer
run: irm https://astral.sh/uv/0.3.5/install.ps1 | iex
run: irm https://astral.sh/uv/0.4.0/install.ps1 | iex
shell: powershell
```

Expand Down
6 changes: 3 additions & 3 deletions docs/guides/integration/pre-commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To compile requirements via pre-commit, add the following to the `.pre-commit-co
```yaml title=".pre-commit-config.yaml"
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.3.5
rev: 0.4.0
hooks:
# Compile requirements
- id: pip-compile
Expand All @@ -20,7 +20,7 @@ To compile alternative files, modify `args` and `files`:
```yaml title=".pre-commit-config.yaml"
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.3.5
rev: 0.4.0
hooks:
# Compile requirements
- id: pip-compile
Expand All @@ -33,7 +33,7 @@ To run the hook over multiple files at the same time:
```yaml title=".pre-commit-config.yaml"
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.3.5
rev: 0.4.0
hooks:
# Compile requirements
- id: pip-compile
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "uv"
version = "0.3.5"
version = "0.4.0"
description = "An extremely fast Python package and project manager, written in Rust."
authors = [{ name = "Astral Software Inc.", email = "[email protected]" }]
requires-python = ">=3.8"
Expand Down

0 comments on commit d9bd3bc

Please sign in to comment.