@@ -1911,6 +1911,37 @@ in
1911
1911
} ;
1912
1912
} ;
1913
1913
} ;
1914
+ uv-export = mkOption {
1915
+ description = "uv export hook" ;
1916
+ type = types . submodule {
1917
+ imports = [ hookModule ] ;
1918
+ options . settings = {
1919
+ format =
1920
+ mkOption {
1921
+ type = types . enum [ "requirements.txt" "pylock.toml" ] ;
1922
+ description = "Output format of the project's lockfile." ;
1923
+ # Most useful for compliance with PEP 751
1924
+ default = "pylock.toml" ;
1925
+ example = "requirements.txt" ;
1926
+ } ;
1927
+ locked =
1928
+ mkOption {
1929
+ type = types . bool ;
1930
+ description = ''
1931
+ Assert that the `uv.lock` will remain unchanged.
1932
+ Requires that the lockfile is up-to-date. If the lockfile is missing or needs to be updated, uv will exit with an error.
1933
+ '' ;
1934
+ default = true ;
1935
+ } ;
1936
+ flags =
1937
+ mkOption {
1938
+ type = types . str ;
1939
+ description = "Flags passed to `uv export`" ;
1940
+ default = "" ;
1941
+ } ;
1942
+ } ;
1943
+ } ;
1944
+ } ;
1914
1945
vale = mkOption {
1915
1946
description = "vale hook" ;
1916
1947
type = types . submodule {
@@ -4032,6 +4063,39 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.fourm
4032
4063
"${ hooks . typstyle . package } /bin/typstyle -i" ;
4033
4064
files = "\\ .typ$" ;
4034
4065
} ;
4066
+ uv-check = {
4067
+ name = "uv check" ;
4068
+ description = "Check if uv's lockfile is up-to-date." ;
4069
+ package = tools . uv ;
4070
+ entry = "${ hooks . uv-check . package } /bin/uv lock --check" ;
4071
+ files = "^(uv\\ .lock$|pyproject\\ .toml)$" ;
4072
+ pass_filenames = false ;
4073
+ } ;
4074
+ uv-lock = {
4075
+ name = "uv lock" ;
4076
+ description = "Update uv's lockfile." ;
4077
+ package = tools . uv ;
4078
+ entry = "${ hooks . uv-lock . package } /bin/uv lock" ;
4079
+ files = "^(uv\\ .lock$|pyproject\\ .toml)$" ;
4080
+ pass_filenames = false ;
4081
+ } ;
4082
+ uv-export = {
4083
+ name = "uv export" ;
4084
+ description = "Export uv's lockfile." ;
4085
+ package = tools . uv ;
4086
+ files = "^(uv\\ .lock$|pyproject\\ .toml)$" ;
4087
+ pass_filenames = false ;
4088
+ entry =
4089
+ let
4090
+ cmdArgs =
4091
+ mkCmdArgs
4092
+ ( with hooks . uv-export . settings ; [
4093
+ [ ( format != "requirements" ) " --format ${ format } --output-file ${ format } " ]
4094
+ [ locked " --locked" ]
4095
+ ] ) ;
4096
+ in
4097
+ "${ hooks . uv-export . package } /bin/uv export${ cmdArgs } ${ hooks . uv-export . settings . flags } " ;
4098
+ } ;
4035
4099
vale = {
4036
4100
name = "vale" ;
4037
4101
description = "A markup-aware linter for prose built with speed and extensibility in mind." ;
0 commit comments