Commit graph

34 commits

Author SHA1 Message Date
Charlie Marsh
fda227616c
Allow users to provide pre-defined metadata for resolution (#7442)
## Summary

This PR enables users to provide pre-defined static metadata for
dependencies. It's intended for situations in which the user depends on
a package that does _not_ declare static metadata (e.g., a
`setup.py`-only sdist), and that is expensive to build or even cannot be
built on some architectures. For example, you might have a Linux-only
dependency that can't be built on ARM -- but we need to build that
package in order to generate the lockfile. By providing static metadata,
the user can instruct uv to avoid building that package at all.

For example, to override all `anyio` versions:

```toml
[project]
name = "project"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = ["anyio"]

[[tool.uv.dependency-metadata]]
name = "anyio"
requires-dist = ["iniconfig"]
```

Or, to override a specific version:

```toml
[project]
name = "project"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = ["anyio"]

[[tool.uv.dependency-metadata]]
name = "anyio"
version = "3.7.0"
requires-dist = ["iniconfig"]
```

The current implementation uses `Metadata23` directly, so we adhere to
the exact schema expected internally and defined by the standards. Any
entries are treated similarly to overrides, in that we won't even look
for `anyio@3.7.0` metadata in the above example. (In a way, this also
enables #4422, since you could remove a dependency for a specific
package, though it's probably too unwieldy to use in practice, since
you'd need to redefine the _rest_ of the metadata, and do that for every
package that requires the package you want to omit.)

This is under-documented, since I want to get feedback on the core ideas
and names involved.

Closes https://github.com/astral-sh/uv/issues/7393.
2024-09-18 03:18:05 +00:00
Charlie Marsh
778da3350a
Add --no-editable support to uv sync and uv export (#7371)
## Summary

Closes https://github.com/astral-sh/uv/issues/5792.
2024-09-17 14:50:36 +00:00
Charlie Marsh
8d4b6ca971
Add documentation on platform-specific dependencies (#7411)
## Summary

Closes https://github.com/astral-sh/uv/issues/6758.
2024-09-15 17:55:37 -04:00
Aditya Pratap Singh
adcb67a882
Fix documentation typos for uv build --build-constraint flag (#7330)
Summary

This pull request fixes a typo in the --build-constraints flag, which
should be singular (--build-constraint). This update ensures consistency
across the documentation and prevents potential confusion for users.

Closes #7315

## Test Plan
The change was verified by reviewing the relevant documentation files
where the flag is referenced. No functional code changes were made, so
no additional testing is required beyond confirming the documentation
update.

## Tested
The change was tested by visually inspecting the updated documentation
to confirm that the typo has been corrected
2024-09-12 14:07:33 -05:00
Charlie Marsh
3f011f3b7b
Add uv run --no-sync (#7192)
## Summary

When `--no-sync` is provided, we won't lock or sync, but we will run the
command in the project environment.

Closes https://github.com/astral-sh/uv/issues/7165.
2024-09-10 17:29:43 -04:00
Zanie Blue
b5cc913d5c
Create py.typed files during uv init --lib (#7232) 2024-09-10 15:16:00 -05:00
Bartosz Sławecki
5905f40f50
Use type hints in code from uv init (#7225)
Let's promote type hints!

<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->
The generated script now annotates the return type of the dummy function
`hello()`.

## Test Plan

<!-- How was it tested? -->
All existing tests have been synced with this update.
2024-09-09 15:37:21 -05:00
Mathieu Kniewallner
8341d810b2
docs: list supported sdist formats (#7168)
## Summary

Explicitly list the formats and extensions that uv supports, based on
[this
list](86ee8d2c01/crates/distribution-filename/src/extension.rs (L70-L77)).
Not a huge fan of adding the section in `concepts/resolution.md`, but I
did not find a better place. Alternatively we could maybe add a
dedicated page that shortly explains Python package types (wheels,
sdists), where such a section could live?

## Test Plan

Local run of the documentation.
2024-09-07 19:16:12 +00:00
FishAlchemist
aa3297a8d7
Replace incorrect `--source and --binary flags with correct --sdist and --wheel flags in uv build` (#7156)
## Summary
Replace incorrect ``--source`` and ``--binary`` flags with correct
``--sdist`` and ``--wheel`` flags in uv build.
 

![image](https://github.com/user-attachments/assets/f72a9c73-bfce-441b-8756-d0cb22afcd7d)

## Test Plan
Run the server locally

![image](https://github.com/user-attachments/assets/f702f19f-96b8-4338-bd1b-e2fb35f5697a)
2024-09-07 07:50:56 -04:00
Charlie Marsh
80f51cee06
Accept --build-constraints in uv build (#7085)
## Summary

Closes #7082.

Closes #7065.
2024-09-05 18:46:36 +00:00
Jakub Beránek
ae16c4e524
Document how to manually update locked package version (#7083)
This PR updates documentation to explicitly mention how to update a
specific package with a locked version to a different version.

Fixes: https://github.com/astral-sh/uv/issues/7019

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-09-05 16:37:43 +00:00
my1e5
86c8906d10
Update docs on .python-version file (#7051)
## Summary

Closes https://github.com/astral-sh/uv/issues/7027

* When displaying the file structure of a uv-managed project show the
`.python-version` file which is now created by default.
* Mention the purpose of the `.python-version` file in `Guides/Working
on projects/Project structure`
* In `Concepts/Python versions/Project python versions`, changed
sentence about `.python-version` file to reflect the fact it is included
by default so is likely to be present.
2024-09-04 19:22:34 -04:00
Ed Morley
c1effd6b05
Misc projects docs grammar fixes (#7048)
Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-09-04 20:58:36 +00:00
Zanie Blue
5ca3ded53b
Touchup to the project environment config section (#7038) 2024-09-04 15:02:35 -05:00
Zanie Blue
b2cb3bb2ae
Add project docs for project.scripts (#7010)
Closes https://github.com/astral-sh/uv/issues/6998

Common point of confusion because Poetry defines these in
`tool.poetry.scripts`
2024-09-04 12:16:31 -05:00
Charlie Marsh
724a93bfdb
Add documentation for uv build (#6991) 2024-09-04 15:53:14 +00:00
Zanie Blue
88ba1e90a0
Add docs for UV_PROJECT_ENVIRONMENT (#6987) 2024-09-03 19:47:05 -04:00
Zanie Blue
614839e88b
Add optional dependencies section to the lockfile document (#6982)
Closes https://github.com/astral-sh/uv/issues/6729
2024-09-03 19:37:36 -04:00
Charlie Marsh
cbfc928a9c
Add uv export --format requirements.txt (#6778)
## Summary

The interface here is intentionally a bit more limited than `uv pip
compile`, because we don't want `requirements.txt` to be a system of
record -- it's just an export format. So, we don't write annotation
comments (i.e., which dependency is requested from which), we don't
allow writing extras, etc. It's just a flat list of requirements, with
their markers and hashes.

Closes #6007.

Closes #6668.

Closes #6670.
2024-08-29 17:46:42 +00:00
my1e5
f956ab8fae
Update default hello.py to pass ruff format (#6811)
Closes https://github.com/astral-sh/uv/issues/6808
2024-08-29 10:31:52 -04:00
Zanie Blue
75a5066e10
Improvements to the application and library documentation (#6726) 2024-08-27 23:15:12 +00:00
Zanie Blue
d5d8375c7e
Update project documentation for the application / library concepts (#6718)
Follows https://github.com/astral-sh/uv/pull/6689 and
https://github.com/astral-sh/uv/pull/6585
2024-08-27 16:22:31 -05:00
Zanie Blue
cee0d2daf5
Improve lockfile concept documentation, add coverage for upgrades (#6698) 2024-08-27 11:20:53 -05:00
Karim Abou Zeid
5ef0375204
Fix docs for disabling build isolation with uv sync (#6674)
Self-explanatory
2024-08-27 08:49:59 -04:00
Charlie Marsh
486c9848a1
Add docs for disabling build isolation with uv sync (#6607)
## Summary

This requires some care, so worth documenting the intended workflows.

Closes https://github.com/astral-sh/uv/issues/6437.
2024-08-26 18:21:43 +00:00
Zanie Blue
cba329ee21
Add tip for using managed = false to disable project management (#6465)
Closes https://github.com/astral-sh/uv/issues/6463
2024-08-22 18:06:57 -05:00
Charlie Marsh
3395d24959
Allow user to constrain supported lock environments (#6210)
## Summary

The strategy here is: if the user provides supported environments, we
use those as the initial forks when resolving. As a result, we never add
or explore branches that are disjoint with the supported environments.
(If the supported environments change, we ignore the lockfile entirely,
so we don't have to worry about any interactions between supported
environments and the preference forks.)

Closes https://github.com/astral-sh/uv/issues/6184.
2024-08-20 13:28:04 +00:00
Theo BABILON
070d5b7402
Fixed projects guide typo (#6033)
Sorry for spam, also noticed this tiny repetition

Co-authored-by: tbabilon <theo.babilon@mlp.com>
2024-08-12 07:09:11 -05:00
Zanie Blue
44a6dbfa53
Improvements to the documentation (#5718) 2024-08-03 08:41:33 -05:00
konsti
db371560bc
Use prettier to format the documentation (#5708)
To enforce the 100 character line limit in markdown files introduced in
https://github.com/astral-sh/uv/pull/5635, and to automate the
formatting of markdown files, i've added prettier and formatted our
markdown files with it.

I've excluded the changelog and the generated references documentation
from this for having too many changes, but we can also include them.

I'm not particular on which style we use. My main motivations are
(major) not having to reflow markdown files myself anymore and (minor)
consistence between all markdown files. I've chosen prettier for similar
reason as we chose black, it's a single good style that's automated and
shared in the community. I do prefer prettier's style of not breaking
inside of a link name though.

This PR is in two parts, the first adds prettier to CI and documents
using it, while the second actually formats the docs. When merge
conflicts arise, we can drop the last commit and regenerate it with `npx
prettier --prose-wrap always --write BENCHMARKS.md CONTRIBUTING.md
README.md STYLE.md docs/*.md docs/concepts/**/*.md docs/guides/**/*.md
docs/pip/**/*.md`.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-08-02 08:58:31 -05:00
Zanie Blue
f971631adf
Wrap documentation at 100 characters (#5635)
Basically sick of dealing with mixed formatting here. Going with the
number at
7c08e61b73/.editorconfig (L20)
2024-07-30 22:17:58 +00:00
Zanie Blue
b081425a77
Improvements to the project concept docs (#5634) 2024-07-30 22:11:52 +00:00
Zanie Blue
8545ae2312
Rename more use of "lock file" to "lockfile" (#5629) 2024-07-30 19:09:43 +00:00
Zanie Blue
6eb8f85668
Update documentation sections (#5452)
Reframes "the low-level interface" as "the pip interface"
Adds indexes to all sections
Renames "commercial indexes" to "alternative indexes"
2024-07-25 12:37:22 -05:00
Renamed from docs/projects.md (Browse further)