Commit graph

11 commits

Author SHA1 Message Date
konsti
5386701cc1
Build backend: Make preview default and add configuration docs (#12804)
Add configuration documentation for the build backend and make it the
preview default.

The build backend should generally work with default configuration
unless you want specific features such as flat layout or module
renaming, there is only a dedicated configuration, but no concept or
guide page for the build backend. Once the build backend is stable, we
can update the guide documentation to explain that uv defaults to its
own build backend, but other build backends are also supported.

The uv build backend becomes the default in preview, giving it more
exposure from users and preparing it to make it the default proper. The
current documentation retains warnings that the build backend is in
preview.

To see current uses of `uv_build` on GitHub:
https://github.com/search?q=path%3A**%2Fpyproject.toml+uv_build%3E%3D0&type=code

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-05-05 13:52:31 +00:00
Jatinderjit Singh
a95f4cf553
Fix --directory path in examples (#12165)
Some checks are pending
CI / integration test | uv_build (push) Blocked by required conditions
CI / check cache | ubuntu (push) Blocked by required conditions
CI / check cache | macos aarch64 (push) Blocked by required conditions
CI / check system | python on debian (push) Blocked by required conditions
CI / check system | python on fedora (push) Blocked by required conditions
CI / check system | python on ubuntu (push) Blocked by required conditions
CI / check system | python on opensuse (push) Blocked by required conditions
CI / check system | python on rocky linux 8 (push) Blocked by required conditions
CI / check system | python on rocky linux 9 (push) Blocked by required conditions
CI / check system | pyston (push) Blocked by required conditions
CI / check system | python on macos aarch64 (push) Blocked by required conditions
CI / check system | homebrew python on macos aarch64 (push) Blocked by required conditions
CI / check system | python on macos x86-64 (push) Blocked by required conditions
CI / check system | python3.10 on windows x86-64 (push) Blocked by required conditions
CI / check system | python3.10 on windows x86 (push) Blocked by required conditions
CI / check system | python3.13 on windows x86-64 (push) Blocked by required conditions
CI / check system | x86-64 python3.13 on windows aarch64 (push) Blocked by required conditions
CI / check system | windows registry (push) Blocked by required conditions
CI / check system | python3.12 via chocolatey (push) Blocked by required conditions
CI / check system | conda3.8 on linux x86-64 (push) Blocked by required conditions
CI / check system | python3.9 via pyenv (push) Blocked by required conditions
CI / check system | python3.13 (push) Blocked by required conditions
CI / check system | conda3.11 on macos aarch64 (push) Blocked by required conditions
CI / check system | conda3.8 on macos aarch64 (push) Blocked by required conditions
CI / check system | conda3.11 on linux x86-64 (push) Blocked by required conditions
CI / check system | conda3.11 on windows x86-64 (push) Blocked by required conditions
CI / check system | conda3.8 on windows x86-64 (push) Blocked by required conditions
CI / check system | amazonlinux (push) Blocked by required conditions
CI / check system | embedded python3.10 on windows x86-64 (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
<!--
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 examples assume that the packages are in the project root directory.
However, they are nested inside `src`, and the commands in the examples
do not work as intended.

I could not find any related issues.

## Test Plan

<!-- How was it tested? -->

I tested it by executing the commands on my terminal - Linux and Windows
(PowerShell).

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2025-03-18 15:50:03 -04:00
Aria Desires
fbe9e33b8d
Note that main.py used to be hello.py (#11519)
Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-02-14 21:59:25 +00:00
Aria Desires
9138b35c66 Create main.py instead of hello.py in uv init (#10369)
Initially it seemed like `app.py` might be slightly more desirable but
people seem to overwhelmingly favour `main.py` as a good "generic" name.

Fixes #7782
2025-02-13 16:17:49 -06:00
Zanie Blue
7ec68e1dda
Allow opt-in to .python-version in uv init with --pin-python (#11265)
For use with `--bare`
2025-02-05 17:21:58 -06:00
Zanie Blue
acbbb2b82a
Add --bare option to uv init (#11192)
People are looking for a less opinionated version of `uv init`. The goal
here is to create a `pyproject.toml` and nothing else. With the `--lib`
or `--package` flags, we'll still configure a build backend but we won't
create the source tree. This disables things like the default
`description`, author behavior, and VCS.

See

- https://github.com/astral-sh/uv/issues/8178
- https://github.com/astral-sh/uv/issues/7181
- https://github.com/astral-sh/uv/issues/6750
2025-02-05 10:12:27 -06:00
Kevin Marchais
a2a2662d43
Fix ruff linting warnings from generated template files for extension modules (#10371)
## Summary

This PR fixes two ruff linting issues in the generated template files
when using: `uv init --build-backend` for extension modules.

1. Removes unnecessary `from __future__ import annotations` imports from
generated .pyi files
([PYI044](https://docs.astral.sh/ruff/rules/future-annotations-in-stub/))
2. Adds missing blank line after `hello_from_bin` import to comply with
isort formatting
([I001](https://docs.astral.sh/ruff/rules/unsorted-imports/))

## Test Plan

```bash
cargo run -- init --build-backend scikit-build-core example-ext
uvx ruff check example-ext --select ALL

cargo run -- init --build-backend maturin example-ext
uvx ruff check example-ext --select ALL
```

## Remaining warnings

There are still warnings remainings in the generated `__init__.py`
files:
- [D104](https://docs.astral.sh/ruff/rules/undocumented-public-package/)
Missing docstring in public package
-
[D103](https://docs.astral.sh/ruff/rules/undocumented-public-function/)
Missing docstring in public function
- [T201](https://docs.astral.sh/ruff/rules/print/) `print` found
2025-01-07 17:07:44 +00:00
Zanie Blue
83c5eae1f3
Avoid referencing scikit-build (#9320)
It is different than `scikit-buid-core`
2024-11-21 08:42:47 -06:00
Zanie Blue
d391961fa5
Touchup the extension module guide (#9293)
Co-authored-by: pantheraleo-7 <159872817+pantheraleo-7@users.noreply.github.com>
2024-11-21 14:24:21 +00:00
Zanie Blue
110c38e549
Improve the project creation documentation (#9236) 2024-11-20 08:50:14 -06:00
Zanie Blue
ca9aaf1c48
Reorganize the project concept documentation (#9121)
- Adds a collapsible section for the project concept
- Splits the project concept document into several child documents.
- Moves the workspace and dependencies documents to under the project
section
- Adds a mkdocs plugin for redirects, so links to the moved documents
still work

I attempted to make the minimum required changes to the contents of the
documents here. There is a lot of room for improvement on the content of
each new child document. For review purposes, I want to do that work
separately. I'd prefer if the review focused on this structure and idea
rather than the content of the files.

I expect to do this to other documentation pages that would otherwise be
very nested.

The project concept landing page and nav (collapsed by default) looks
like this now:

<img width="1507" alt="Screenshot 2024-11-14 at 11 28 45 AM"
src="https://github.com/user-attachments/assets/88288b09-8463-49d4-84ba-ee27144b62a5">
2024-11-19 13:52:12 -06:00