-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Build path
sources without build systems by default
#14413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/080
Are you sure you want to change the base?
Conversation
Closes #13057 Sets `UV_TOOL_BIN_DIR` to `/usr/local/bin` for all derived images to allow `uv tool install` to work out of the box. Note, when the default image user is overwritten (e.g. `USER <UID>`) by a less privileged one, an alternative writable location would now need to be set by downstream consumers to prevent issues, hence I'm labeling this as a breaking change for 0.8.x release. Relates to astral-sh/uv-docker-example#55 Each image was tested to work with uv tool with `UV_TOOL_BIN_DIR` set to `/usr/local/bin` with the default root user and alternative non-root users to confirm breaking nature of the change.
While reviewing #14107, @oconnor663 pointed out a bug where we allow `uv python pin --rm` to delete the global pin without the `--global` flag. I think that shouldn't be allowed? I'm not 100% certain though.
Right now, `--python-platform linux` to defaults to `manylinux_2_17`. Defaulting to `manylinux_2_17` causes some problems for users, since it means we can't use (e.g.) `manylinux_2_28` wheels, and end up having to build from source. cibuildwheel made `manylinux_2_28` their default in pypa/cibuildwheel#1988, and there's a lot of discussion in pypa/cibuildwheel#1772 and pypa/cibuildwheel#2047. In short, the `manylinux_2014` image is EOL, and the vast majority of consumers now run at least glibc 2.28 (https://mayeut.github.io/manylinux-timeline/):  Note that this only changes the _default_. Users can still compile against `manylinux_2_17` by specifying it.
@@ -82,19 +82,22 @@ impl PyProjectToml { | |||
/// non-package ("virtual") project. | |||
pub fn is_package(&self) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left the existing logic in place in is_package
(factoring out the tool.uv.package
check) to constrain this change to path sources only.
This should be based on #14164 right? |
Yes, updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to update https://docs.astral.sh/uv/reference/settings/#package in conjunction with this change.
This doesn’t actually change the behavior there. It’s limited to updating the default behavior when a path source definition has no package value. But we can discuss if we want this to hold more generally. I was trying to limit the scope of the change to the issue. |
path
sources without build systems by default
Can you add test coverage for cases where there are various |
There are already existing tests but I can point them out |
Yes please. I'm particularly interested in |
|
There should be some documentation change here. Perhaps in https://docs.astral.sh/uv/concepts/projects/dependencies/#path |
@@ -438,6 +438,21 @@ $ uv add ~/projects/bar/ | |||
bar = { path = "../projects/bar", package = true } | |||
``` | |||
|
|||
If the project is not marked as a non-package and no value is set for `package` on the source, the default behavior is to install it as a package, even if it lacks a [build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which "project" are you referring to here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you wrap the line so it's ~close to the line length in the rest of the file? The autoformatter can't wrap admonitions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels weird this is first framed around "If the project is marked as a non-package", since that's the advanced use-case. The more common scenario is that the dependency just doesn't declare a build system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I was trying to emphasize the combination of package
values since the point about building dependencies without a declared build system is already covered in the build systems section of the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That section is about building the current project, where-as here we need to talk about how we build projects when they're dependencies.
a7c3e8c
to
ace14ba
Compare
733f184
to
cab8774
Compare
```toml title="pyproject.toml" | ||
[project] | ||
dependencies = ["bar"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid project
table? (missing name and version)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is following a pattern found throughout this file. If we want to change that, I think it's out of scope here.
ba457ce
to
9c050fc
Compare
41a8fa6
to
b63bb85
Compare
b63bb85
to
c4fcb8b
Compare
c4fcb8b
to
d57677f
Compare
de0b93c
to
421e2c7
Compare
We currently treat path sources as virtual if they do not specify a build system, which is surprising behavior. This PR updates the behavior to treat path sources as packages unless the path source is explicitly marked as
package = false
or its owntool.uv.package
is set tofalse
.Closes #12015