Comments (5)
I don't have enough context to interpret that issue.
- What do you end up using this information for?
- Why can't it be reconstructed from
dp.get_dependencies
(whatever your internal equivalent is)? - What API would would make sense to user? incompatibilities are not part of our public API, it's going to require a lot of explanation to describe how an arbitrary incompatibilities relates to something a user provided.
from pubgrub.
@charliermarsh can probably give you more details, but we need them to annotated requirements.txt
with the source of a requirement and to show dependencies in our lockfile uv.lock
, both through the intermediary of a petgraph graph. We don't implement get_dependencies
, we call add_incompatibility_from_dependencies
manually; We can reconstruct it, but since pubgrub already knows the graph we should be able to read it out instead of reconstructing it on our side.
from pubgrub.
We can reconstruct it, but since pubgrub already knows the graph we should be able to read it out instead of reconstructing it on our side.
pubgrub does not know the graph. It analyzes the problem as a "set of simultaneous constraints" not as a "graph". Wherever the code lives it is going to be "reconstructing" the graph from the output and some source of dependencies. It is probably worth us implementing a helper method that takes a solution and a dependency provider and reconstructs the graph, but you would need to adapt it to your resolution loop. Alternatively if it can be constructed by iterating over all incompatibilities that are user provided dependencies we could add a method to state. That would probably look very similar to the code you've already written. How hard would it be to upstream?
from pubgrub.
Candidly I don't mind what we do today (iterate over the incompatibilities to build up a graph), though I recognize that it's an implementation detail of PubGrub.
We extract the dependencies and packages here: https://github.com/astral-sh/uv/blob/b3a99d9ff927b34f06aa40c63ea89551d1c246f7/crates/uv-resolver/src/resolver/mod.rs#L1508. We just look for FromDependencyOf
incompatibilities.
Then we build it into a petgraph
here: https://github.com/astral-sh/uv/blob/b3a99d9ff927b34f06aa40c63ea89551d1c246f7/crates/uv-resolver/src/resolution/graph.rs#L66.
(I may merge these steps in the future, they're distinct for historical-ish reasons.)
from pubgrub.
Ironically, today in my work trying to model cargoes resolver with pubgrub I minimized a clear example of cyclic package dependencys which requires looking at pubgrub's output as a graph. The fates have definitely decided that now is the time for us to be thinking about this issue.
from pubgrub.
Related Issues (20)
- Create a contributions guide HOT 1
- Update reporter implementations to use `&mut Write` instead of buffering strings
- When can the algorithm use `simplify` HOT 2
- Move off actions-rs HOT 1
- Update criterion or replace it
- How to get the report formatting presented in the README HOT 8
- Tests fail when using semantic Eq for Term HOT 7
- Out of date documentation for Dev HOT 1
- Build a benchmark based on UV slow case HOT 5
- A new release and switching the default branch to dev HOT 6
- Declare minimum Rust version HOT 1
- Switch to `swatinem/rust-cache` instead of bespoke `actions/cache` in CI
- CI is failing on dev. HOT 2
- Allow changing the `Display` of `Range` HOT 4
- Panic: "add_derivation should not be called after a decision" HOT 4
- The pubgrub api should be one top level module HOT 2
- Expose apis that allow implementing your own solver loop
- Merge custom incompatibility reasons
- Remove `PubGrubError::Failure` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pubgrub.