File tree Expand file tree Collapse file tree 2 files changed +89
-1
lines changed
Expand file tree Collapse file tree 2 files changed +89
-1
lines changed Original file line number Diff line number Diff line change 9191
9292 sitecustomize = pkgs . callPackage ./sitecustomize.nix { } ;
9393
94+ uv = pkgs . callPackage ./uv {
95+ rustPlatform = (
96+ let
97+ toolchain = pkgs . fenix . latest . toolchain ;
98+ in
99+ pkgs . makeRustPlatform {
100+ cargo = toolchain ;
101+ rustc = toolchain ;
102+ }
103+ ) ;
104+ } ;
105+
94106in
95107{
96108 id = "python-${ pythonVersion } " ;
104116 binary-wrapped-python
105117 pip-wrapper
106118 poetry-wrapper
107- pkgs . uv
119+ uv
108120 ] ;
109121
110122 replit . runners . python = {
Original file line number Diff line number Diff line change 1+ { lib
2+ , stdenv
3+ , cmake
4+ , fetchFromGitHub
5+ , installShellFiles
6+ , pkg-config
7+ , rustPlatform
8+ , versionCheckHook
9+ , python3Packages
10+ , nix-update-script
11+ ,
12+ } :
13+
14+ rustPlatform . buildRustPackage rec {
15+ pname = "uv" ;
16+ version = "0.5.11" ; # Technically 8 versions ahead of 0.5.11
17+
18+ src = fetchFromGitHub {
19+ owner = "astral-sh" ;
20+ repo = "uv" ;
21+ rev = "ddc290feb4ed2de4740c786af2436cf1f82a3190" ;
22+ hash = "sha256-/hm70Vptk0eg9MMzgbpkOg/x6mNJBTZ/25kfqiYc/7Y=" ;
23+ } ;
24+
25+ useFetchCargoVendor = true ;
26+ cargoHash = "sha256-k+ABi0xgtpuDwCEgUIqrG7m56iSeYMsDTvtC0YHoCwE=" ;
27+
28+ nativeBuildInputs = [
29+ cmake
30+ installShellFiles
31+ pkg-config
32+ ] ;
33+
34+ dontUseCmakeConfigure = true ;
35+
36+ RUSTFLAGS = "-Z threads=8" ;
37+
38+ cargoBuildFlags = [
39+ "--package"
40+ "uv"
41+ ] ;
42+
43+ # Tests require python3
44+ doCheck = false ;
45+
46+ postInstall = lib . optionalString ( stdenv . buildPlatform . canExecute stdenv . hostPlatform ) ''
47+ export HOME=$TMPDIR
48+ installShellCompletion --cmd uv \
49+ --bash <($out/bin/uv --generate-shell-completion bash) \
50+ --fish <($out/bin/uv --generate-shell-completion fish) \
51+ --zsh <($out/bin/uv --generate-shell-completion zsh)
52+ '' ;
53+
54+ nativeInstallCheckInputs = [
55+ versionCheckHook
56+ ] ;
57+ versionCheckProgramArg = [ "--version" ] ;
58+ doInstallCheck = true ;
59+
60+ passthru = {
61+ tests . uv-python = python3Packages . uv ;
62+ updateScript = nix-update-script { } ;
63+ } ;
64+
65+ meta = {
66+ description = "Extremely fast Python package installer and resolver, written in Rust" ;
67+ homepage = "https://github.com/astral-sh/uv" ;
68+ changelog = "https://github.com/astral-sh/uv/blob/${ version } /CHANGELOG.md" ;
69+ license = with lib . licenses ; [
70+ asl20
71+ mit
72+ ] ;
73+ maintainers = with lib . maintainers ; [ GaetanLepage ] ;
74+ mainProgram = "uv" ;
75+ } ;
76+ }
You can’t perform that action at this time.
0 commit comments