@@ -531,6 +531,22 @@ impl Workspace {
531
531
& self . sources
532
532
}
533
533
534
+ /// Returns an iterator over all sources in the workspace.
535
+ pub fn iter_sources ( & self ) -> impl Iterator < Item = & Source > {
536
+ self . packages
537
+ . values ( )
538
+ . filter_map ( |member| {
539
+ member. pyproject_toml ( ) . tool . as_ref ( ) . and_then ( |tool| {
540
+ tool. uv
541
+ . as_ref ( )
542
+ . and_then ( |uv| uv. sources . as_ref ( ) )
543
+ . map ( ToolUvSources :: inner)
544
+ . map ( |sources| sources. values ( ) )
545
+ } )
546
+ } )
547
+ . flatten ( )
548
+ }
549
+
534
550
/// The `pyproject.toml` of the workspace.
535
551
pub fn pyproject_toml ( & self ) -> & PyProjectToml {
536
552
& self . pyproject_toml
@@ -1608,6 +1624,9 @@ mod tests {
1608
1624
"name": "bird-feeder",
1609
1625
"version": "1.0.0",
1610
1626
"requires-python": ">=3.12",
1627
+ "dependencies": [
1628
+ "anyio>=4.3.0,<5"
1629
+ ],
1611
1630
"optional-dependencies": null
1612
1631
},
1613
1632
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -1619,6 +1638,9 @@ mod tests {
1619
1638
"name": "bird-feeder",
1620
1639
"version": "1.0.0",
1621
1640
"requires-python": ">=3.12",
1641
+ "dependencies": [
1642
+ "anyio>=4.3.0,<5"
1643
+ ],
1622
1644
"optional-dependencies": null
1623
1645
},
1624
1646
"tool": null
@@ -1653,6 +1675,9 @@ mod tests {
1653
1675
"name": "bird-feeder",
1654
1676
"version": "1.0.0",
1655
1677
"requires-python": ">=3.12",
1678
+ "dependencies": [
1679
+ "anyio>=4.3.0,<5"
1680
+ ],
1656
1681
"optional-dependencies": null
1657
1682
},
1658
1683
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -1664,6 +1689,9 @@ mod tests {
1664
1689
"name": "bird-feeder",
1665
1690
"version": "1.0.0",
1666
1691
"requires-python": ">=3.12",
1692
+ "dependencies": [
1693
+ "anyio>=4.3.0,<5"
1694
+ ],
1667
1695
"optional-dependencies": null
1668
1696
},
1669
1697
"tool": null
@@ -1697,6 +1725,10 @@ mod tests {
1697
1725
"name": "albatross",
1698
1726
"version": "0.1.0",
1699
1727
"requires-python": ">=3.12",
1728
+ "dependencies": [
1729
+ "bird-feeder",
1730
+ "tqdm>=4,<5"
1731
+ ],
1700
1732
"optional-dependencies": null
1701
1733
},
1702
1734
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -1707,6 +1739,10 @@ mod tests {
1707
1739
"name": "bird-feeder",
1708
1740
"version": "1.0.0",
1709
1741
"requires-python": ">=3.8",
1742
+ "dependencies": [
1743
+ "anyio>=4.3.0,<5",
1744
+ "seeds"
1745
+ ],
1710
1746
"optional-dependencies": null
1711
1747
},
1712
1748
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -1717,6 +1753,9 @@ mod tests {
1717
1753
"name": "seeds",
1718
1754
"version": "1.0.0",
1719
1755
"requires-python": ">=3.12",
1756
+ "dependencies": [
1757
+ "idna==3.6"
1758
+ ],
1720
1759
"optional-dependencies": null
1721
1760
},
1722
1761
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -1732,6 +1771,10 @@ mod tests {
1732
1771
"name": "albatross",
1733
1772
"version": "0.1.0",
1734
1773
"requires-python": ">=3.12",
1774
+ "dependencies": [
1775
+ "bird-feeder",
1776
+ "tqdm>=4,<5"
1777
+ ],
1735
1778
"optional-dependencies": null
1736
1779
},
1737
1780
"tool": {
@@ -1786,6 +1829,10 @@ mod tests {
1786
1829
"name": "albatross",
1787
1830
"version": "0.1.0",
1788
1831
"requires-python": ">=3.12",
1832
+ "dependencies": [
1833
+ "bird-feeder",
1834
+ "tqdm>=4,<5"
1835
+ ],
1789
1836
"optional-dependencies": null
1790
1837
},
1791
1838
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -1796,6 +1843,10 @@ mod tests {
1796
1843
"name": "bird-feeder",
1797
1844
"version": "1.0.0",
1798
1845
"requires-python": ">=3.12",
1846
+ "dependencies": [
1847
+ "anyio>=4.3.0,<5",
1848
+ "seeds"
1849
+ ],
1799
1850
"optional-dependencies": null
1800
1851
},
1801
1852
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -1806,6 +1857,9 @@ mod tests {
1806
1857
"name": "seeds",
1807
1858
"version": "1.0.0",
1808
1859
"requires-python": ">=3.12",
1860
+ "dependencies": [
1861
+ "idna==3.6"
1862
+ ],
1809
1863
"optional-dependencies": null
1810
1864
},
1811
1865
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -1861,6 +1915,9 @@ mod tests {
1861
1915
"name": "albatross",
1862
1916
"version": "0.1.0",
1863
1917
"requires-python": ">=3.12",
1918
+ "dependencies": [
1919
+ "tqdm>=4,<5"
1920
+ ],
1864
1921
"optional-dependencies": null
1865
1922
},
1866
1923
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -1872,6 +1929,9 @@ mod tests {
1872
1929
"name": "albatross",
1873
1930
"version": "0.1.0",
1874
1931
"requires-python": ">=3.12",
1932
+ "dependencies": [
1933
+ "tqdm>=4,<5"
1934
+ ],
1875
1935
"optional-dependencies": null
1876
1936
},
1877
1937
"tool": null
@@ -1973,6 +2033,9 @@ mod tests {
1973
2033
"name": "albatross",
1974
2034
"version": "0.1.0",
1975
2035
"requires-python": ">=3.12",
2036
+ "dependencies": [
2037
+ "tqdm>=4,<5"
2038
+ ],
1976
2039
"optional-dependencies": null
1977
2040
},
1978
2041
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -1983,6 +2046,9 @@ mod tests {
1983
2046
"name": "seeds",
1984
2047
"version": "1.0.0",
1985
2048
"requires-python": ">=3.12",
2049
+ "dependencies": [
2050
+ "idna==3.6"
2051
+ ],
1986
2052
"optional-dependencies": null
1987
2053
},
1988
2054
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -1994,6 +2060,9 @@ mod tests {
1994
2060
"name": "albatross",
1995
2061
"version": "0.1.0",
1996
2062
"requires-python": ">=3.12",
2063
+ "dependencies": [
2064
+ "tqdm>=4,<5"
2065
+ ],
1997
2066
"optional-dependencies": null
1998
2067
},
1999
2068
"tool": {
@@ -2062,6 +2131,9 @@ mod tests {
2062
2131
"name": "albatross",
2063
2132
"version": "0.1.0",
2064
2133
"requires-python": ">=3.12",
2134
+ "dependencies": [
2135
+ "tqdm>=4,<5"
2136
+ ],
2065
2137
"optional-dependencies": null
2066
2138
},
2067
2139
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -2072,6 +2144,9 @@ mod tests {
2072
2144
"name": "seeds",
2073
2145
"version": "1.0.0",
2074
2146
"requires-python": ">=3.12",
2147
+ "dependencies": [
2148
+ "idna==3.6"
2149
+ ],
2075
2150
"optional-dependencies": null
2076
2151
},
2077
2152
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -2083,6 +2158,9 @@ mod tests {
2083
2158
"name": "albatross",
2084
2159
"version": "0.1.0",
2085
2160
"requires-python": ">=3.12",
2161
+ "dependencies": [
2162
+ "tqdm>=4,<5"
2163
+ ],
2086
2164
"optional-dependencies": null
2087
2165
},
2088
2166
"tool": {
@@ -2152,6 +2230,9 @@ mod tests {
2152
2230
"name": "albatross",
2153
2231
"version": "0.1.0",
2154
2232
"requires-python": ">=3.12",
2233
+ "dependencies": [
2234
+ "tqdm>=4,<5"
2235
+ ],
2155
2236
"optional-dependencies": null
2156
2237
},
2157
2238
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -2162,6 +2243,9 @@ mod tests {
2162
2243
"name": "bird-feeder",
2163
2244
"version": "1.0.0",
2164
2245
"requires-python": ">=3.12",
2246
+ "dependencies": [
2247
+ "anyio>=4.3.0,<5"
2248
+ ],
2165
2249
"optional-dependencies": null
2166
2250
},
2167
2251
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -2172,6 +2256,9 @@ mod tests {
2172
2256
"name": "seeds",
2173
2257
"version": "1.0.0",
2174
2258
"requires-python": ">=3.12",
2259
+ "dependencies": [
2260
+ "idna==3.6"
2261
+ ],
2175
2262
"optional-dependencies": null
2176
2263
},
2177
2264
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -2183,6 +2270,9 @@ mod tests {
2183
2270
"name": "albatross",
2184
2271
"version": "0.1.0",
2185
2272
"requires-python": ">=3.12",
2273
+ "dependencies": [
2274
+ "tqdm>=4,<5"
2275
+ ],
2186
2276
"optional-dependencies": null
2187
2277
},
2188
2278
"tool": {
@@ -2252,6 +2342,9 @@ mod tests {
2252
2342
"name": "albatross",
2253
2343
"version": "0.1.0",
2254
2344
"requires-python": ">=3.12",
2345
+ "dependencies": [
2346
+ "tqdm>=4,<5"
2347
+ ],
2255
2348
"optional-dependencies": null
2256
2349
},
2257
2350
"pyproject_toml": "[PYPROJECT_TOML]"
@@ -2263,6 +2356,9 @@ mod tests {
2263
2356
"name": "albatross",
2264
2357
"version": "0.1.0",
2265
2358
"requires-python": ">=3.12",
2359
+ "dependencies": [
2360
+ "tqdm>=4,<5"
2361
+ ],
2266
2362
"optional-dependencies": null
2267
2363
},
2268
2364
"tool": {
0 commit comments