-
Notifications
You must be signed in to change notification settings - Fork 901
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
Report marker diagnostics during parsing, rather than evaluation #9338
Conversation
55a569d
to
5eca3e9
Compare
Ah shoot, I accidentally merged #9341 into this branch. |
Please review the first commit, but ignore the second. |
3602e09
to
47cb7a5
Compare
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's the much better place
len, | ||
input: cursor.to_string(), | ||
}) | ||
.inspect(|value| match value { |
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.
nit: ?
to remove the inspect
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.
Is that better? Then I have to assign and return the value
crates/uv-pep508/src/verbatim_url.rs
Outdated
@@ -9,8 +9,6 @@ use std::sync::LazyLock; | |||
use thiserror::Error; | |||
use url::{ParseError, Url}; | |||
|
|||
use uv_fs::{normalize_absolute_path, normalize_url_path}; |
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 forgot to comment that, but this one is an explicit import to make exporting and rewriting to https://github.com/konstin/pep508_rs/blob/d155787317425e8ab897beef55a947e8ef28f9d8/src/verbatim_url.rs#L12-L13 easier
## Summary This PR introduces a set of parallel structs to `MarkerValueString`, `MarkerValueExtra`, and `MarkerValueVersion` that remove various pieces of information and representations that shouldn't be available in the marker algebra. To start, I've _just_ removed the invalid extra component from `MarkerValueExtra` -- there are no other changes to the representation. So, throughout the marker algebra, we can't represent and thus don't have to worry about clauses with invalid extras. The subsequent changes I plan to make are: 1. Removing `python_version`, since we exclusively use `python_version_full` in the algebra. 2. Removing the deprecated aliases, such that we re-map to the correct marker value. 3. Consolidating `sys_platform` and `platform_release` (the original motivation).
47cb7a5
to
274b7db
Compare
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.5.4` -> `0.5.5` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>astral-sh/uv (astral-sh/uv)</summary> ### [`v0.5.5`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#055) [Compare Source](astral-sh/uv@0.5.4...0.5.5) ##### Enhancements - Add aliases for build backend requests ([#​9294](astral-sh/uv#9294)) - Avoid displaying empty paths ([#​9312](astral-sh/uv#9312)) - Allow constraints in `uv tool upgrade` ([#​9375](astral-sh/uv#9375)) - Remove conflict between `--no-sync` and `--frozen` in `uv run` ([#​9400](astral-sh/uv#9400)) - Respect dependency sources in overrides and constraints ([#​9455](astral-sh/uv#9455)) - Show an interpreter-focused message for `--target` and `--prefix` ([#​9373](astral-sh/uv#9373)) - Add `--no-extra` flag and setting ([#​9387](astral-sh/uv#9387)) - Add `uv export --prune` ([#​9389](astral-sh/uv#9389)) - Add dedicated error message for musl install attempts ([#​9430](astral-sh/uv#9430)) - Add various grammar changes to conflict error messages ([#​9369](astral-sh/uv#9369)) - Annotate default groups in conflict error messages ([#​9368](astral-sh/uv#9368)) - Report marker diagnostics during parsing, rather than evaluation ([#​9338](astral-sh/uv#9338)) - Use consistent formatting for build system errors ([#​9340](astral-sh/uv#9340)) - Use rich diagnostics for build failures ([#​9335](astral-sh/uv#9335)) ##### Preview features - Improve build backend excludes ([#​9281](astral-sh/uv#9281)) - Include PEP 639 `license-files` metadata during `uv publish` ([#​9442](astral-sh/uv#9442)) ##### Performance - Initialize rayon lazily ([#​9435](astral-sh/uv#9435)) - Migrate to PubGrub's arena for package names ([#​9448](astral-sh/uv#9448)) ##### Bug fixes - Allow dependency groups to include the containing package ([#​9385](astral-sh/uv#9385)) - Allow syncing to empty virtual environment directories ([#​9427](astral-sh/uv#9427)) - Allow system Python discovery with `--target` and `--prefix` ([#​9371](astral-sh/uv#9371)) - Don't warn when `--output-file` is empty ([#​9417](astral-sh/uv#9417)) - Fix Python interpreter discovery on non-glibc hosts ([#​9005](astral-sh/uv#9005)) - Fix `tool.uv.dependency-metadata.[].version` schema ([#​9468](astral-sh/uv#9468)) - Only respect preferences across the same indexes ([#​9302](astral-sh/uv#9302)) - Re-compile when `--compile` is passed to an install operation ([#​9378](astral-sh/uv#9378)) - Remove `--upgrade`, `--no-upgrade`, and `--upgrade-package` from `uv tool upgrade` ([#​9318](astral-sh/uv#9318)) - Remove dev dependencies in `--all-groups --no-dev` ([#​9300](astral-sh/uv#9300)) - Surface extras and group conflicts in `uv export` ([#​9365](astral-sh/uv#9365)) - Treat deprecated aliases as equivalent in marker algebra ([#​9342](astral-sh/uv#9342)) - Treat less compatible tags as lower priority in resolver ([#​9339](astral-sh/uv#9339)) ##### Documentation - Avoid referencing `scikit-build` (instead of `scikit-build-core`) ([#​9320](astral-sh/uv#9320)) - Expand entry points documentation ([#​9329](astral-sh/uv#9329)) - Fix example `pyproject.toml` in project concept documentation ([#​9298](astral-sh/uv#9298)) - Fix header level of "Conflicting dependencies" page ([#​9330](astral-sh/uv#9330)) - Touch-up the extension module guide ([#​9293](astral-sh/uv#9293)) - Update the dependencies documentation ([#​9359](astral-sh/uv#9359)) - Reference `--no-progress` option in related environment variable ([#​9357](astral-sh/uv#9357)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Summary
I want to move towards a more normalized marker representation within the marker tree, which means that the things we warn against will disappear by the time we get to evaluation. I think it makes more sense to show these warnings when we create the tree, rather than when we evaluate it.