Comments (7)
Not directly from the resolve but it should be fairly trivial to piece this back together from the flat list since they contain both the names and the dependencies.
from rattler.
What would you like the graph to look like in terms of data structure?
from rattler.
Following since we're doing this manually right now.
Probably an adjacency list is fine? Optionally a topological sorting of the entries might be handy (esp. for folks using py-rattler it's probably faster to do the toposort inside the rust code).
from rattler.
Topological sorting is already implemented here: https://mamba-org.github.io/rattler/py-rattler/package_record/#rattler.repo_data.package_record.PackageRecord.sort_topologically
from rattler.
I would see any tree like structure that would allow us to easily print something like:
absl-py=2.1.0=py38h06a4308_0
└─╼ python=3.8.19=h955ad1f_0 (absl-py wants >=3.8,<3.9.0a0)
├─╼ ld_impl_linux-64=2.38=h1181459_1 (python wants None)
├─╼ libffi=3.4.4=h6a678d5_1 (python wants >=3.4,<4.0a0)
│ ├─╼ libgcc-ng=11.2.0=h1234567_1 (libffi wants >=11.2.0, python wants >=11.2.0, ncurses wants >=11.2.0, openssl wants >=7.5.0, readline wants >=11.2.0, sqlite wants >=11.2.0, zlib wants >=11.2.0, tk wants >=11.2.0, xz wants >=11.2.0)
│ │ ├─╼ _libgcc_mutex=0.1=main (libgcc-ng wants *, _openmp_mutex wants ==0.1, libgomp wants ==0.1)
│ │ ├─╼ _openmp_mutex=5.1=1_gnu (libgcc-ng wants None)
│ │ │ ├─╼ libgomp=11.2.0=h1234567_1 (_openmp_mutex wants >=7.5.0)
│ │ │ │ └─╼ _libgcc_mutex=0.1=main (libgcc-ng wants *, _openmp_mutex wants ==0.1, libgomp wants ==0.1)
│ │ │ └─╼ _libgcc_mutex=0.1=main (libgcc-ng wants *, _openmp_mutex wants ==0.1, libgomp wants ==0.1)
│ │ └─╼ __glibc >=2.17 (libgcc-ng wants __glibc >=2.17, libstdcxx-ng wants __glibc >=2.17) ╾ libstdcxx-ng=11.2.0=h1234567_1 (libffi wants >=11.2.0, python wants >=11.2.0)
│ └─╼ libstdcxx-ng=11.2.0=h1234567_1 (libffi wants >=11.2.0, python wants >=11.2.0)
│ └─╼ ...
├─╼ ncurses=6.4=h6a678d5_0 (python wants >=6.4,<7.0a0, readline wants >=6.3,<7.0a0, sqlite wants >=6.4,<7.0a0) ╾ readline=8.2=h5eee18b_0 (python wants >=8.0,<9.0a0, sqlite wants >=8.0,<9.0a0), sqlite=3.45.3=h5eee18b_0 (python wants >=3.41.2,<4.0a0)
│ └─╼ libgcc-ng=11.2.0=h1234567_1 (libffi wants >=11.2.0, python wants >=11.2.0, ncurses wants >=11.2.0, openssl wants >=7.5.0, readline wants >=11.2.0, sqlite wants >=11.2.0, zlib wants >=11.2.0, tk wants >=11.2.0, xz wants >=11.2.0)
├─╼ openssl=3.0.13=h7f8727e_2 (python wants >=3.0.13,<4.0a0)
│ ├─╼ ca-certificates=2024.3.11=h06a4308_0 (openssl wants None)
│ └─╼ libgcc-ng=11.2.0=h1234567_1 (libffi wants >=11.2.0, python wants >=11.2.0, ncurses wants >=11.2.0, openssl wants >=7.5.0, readline wants >=11.2.0, sqlite wants >=11.2.0, zlib wants >=11.2.0, tk wants >=11.2.0, xz wants >=11.2.0)
├─╼ readline=8.2=h5eee18b_0 (python wants >=8.0,<9.0a0, sqlite wants >=8.0,<9.0a0) ╾ sqlite=3.45.3=h5eee18b_0 (python wants >=3.41.2,<4.0a0)
│ └─╼ libgcc-ng=11.2.0=h1234567_1 (libffi wants >=11.2.0, python wants >=11.2.0, ncurses wants >=11.2.0, openssl wants >=7.5.0, readline wants >=11.2.0, sqlite wants >=11.2.0, zlib wants >=11.2.0, tk wants >=11.2.0, xz wants >=11.2.0)
├─╼ sqlite=3.45.3=h5eee18b_0 (python wants >=3.41.2,<4.0a0)
│ ├─╼ zlib=1.2.13=h5eee18b_1 (sqlite wants >=1.2.13,<2.0a0, tk wants >=1.2.13,<1.3.0a0, python wants >=1.2.13,<1.3.0a0) ╾ tk=8.6.14=h39e8969_0 (python wants >=8.6.12,<8.7.0a0), python=3.8.19=h955ad1f_0 (absl-py wants >=3.8,<3.9.0a0)
│ │ └─╼ libgcc-ng=11.2.0=h1234567_1 (libffi wants >=11.2.0, python wants >=11.2.0, ncurses wants >=11.2.0, openssl wants >=7.5.0, readline wants >=11.2.0, sqlite wants >=11.2.0, zlib wants >=11.2.0, tk wants >=11.2.0, xz wants >=11.2.0)
│ └─╼ libgcc-ng=11.2.0=h1234567_1 (libffi wants >=11.2.0, python wants >=11.2.0, ncurses wants >=11.2.0, openssl wants >=7.5.0, readline wants >=11.2.0, sqlite wants >=11.2.0, zlib wants >=11.2.0, tk wants >=11.2.0, xz wants >=11.2.0)
├─╼ tk=8.6.14=h39e8969_0 (python wants >=8.6.12,<8.7.0a0)
│ └─╼ libgcc-ng=11.2.0=h1234567_1 (libffi wants >=11.2.0, python wants >=11.2.0, ncurses wants >=11.2.0, openssl wants >=7.5.0, readline wants >=11.2.0, sqlite wants >=11.2.0, zlib wants >=11.2.0, tk wants >=11.2.0, xz wants >=11.2.0)
├─╼ xz=5.4.6=h5eee18b_1 (python wants >=5.4.6,<6.0a0)
│ └─╼ libgcc-ng=11.2.0=h1234567_1 (libffi wants >=11.2.0, python wants >=11.2.0, ncurses wants >=11.2.0, openssl wants >=7.5.0, readline wants >=11.2.0, sqlite wants >=11.2.0, zlib wants >=11.2.0, tk wants >=11.2.0, xz wants >=11.2.0)
└─╼ libgcc-ng=11.2.0=h1234567_1 (libffi wants >=11.2.0, python wants >=11.2.0, ncurses wants >=11.2.0, openssl wants >=7.5.0, readline wants >=11.2.0, sqlite wants >=11.2.0, zlib wants >=11.2.0, tk wants >=11.2.0, xz wants >=11.2.0)
(sorry if this is a little dense)
The format of this big blob is basically:
root
└─╼ dep_a <version> <build string> (applied constraints)
...
where applied constraints shows all the constraints that affected and led to the solve to pick this version and where these constraints are coming from.
Obviously text is not necessarily the right format. The data structure could be use to generate a graphviz visualization (similar to spack) or generate an HTML file to interactively visualize the graph (similar to conan for example).
from rattler.
I think we should add networkx
and then create a DAG structure based on the resolved records. That can be implemented as a free function and the function can import networkx
so that it remains an optional dependency.
The user can then do whatever they want with the graph - print it as ascii, plot it with matplotlib, etc.
Should be fairly simple to implement in the Python parts of py-rattler
.
from rattler.
@wolfv implement to_graph
. Is that enough for your usecase?
from rattler.
Related Issues (20)
- pyrattler: authenticated client should also use retry and oci middlewares
- RepodataGateway Reporter - more information
- Solving mlflow=2.12.2=py39hb3b8efb_0 takes a lot of time HOT 5
- Cannot solve cmdstan=2.33.1=hc24a2e5_0 (linux) from osx-arm64 HOT 12
- Add `VersionSpec` python bindings
- The python bindings quick start example is out of date
- Timestamp in RepoDataRecord is in seconds instead of milliseconds HOT 10
- Use `rustc-hash` instead of `fxhash` HOT 2
- how do you feed entries from `run_constrains` to the `solver` function in py-rattler? HOT 2
- `InvalidBracket` for matchspec HOT 2
- Create repodata records from package urls HOT 1
- Matchspec::from_string gives RegexConstraintsNotSupported for X.Y.Z.*. HOT 2
- Use prefetched repodatas in `solve()`? HOT 4
- NamelessMatchSpec::from_str more strict than MatchSpec::from_str HOT 2
- Get `sha256`, `size` and `md5` from direct url package.
- Empty `repodata.json` should be valid HOT 1
- Clobbering a folder with a file is broken
- Gateway.query in Python returns all versions HOT 4
- unable to parse package name "libxgboost-0.6+218_omp_0.tar.bz2" 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 rattler.