@@ -114,7 +114,7 @@ pub async fn uv_pip_compile(
114
114
let mut logs = String :: new ( ) ;
115
115
logs. push_str ( & format ! ( "\n resolving dependencies..." ) ) ;
116
116
logs. push_str ( & format ! ( "\n content of requirements:\n {}\n " , requirements) ) ;
117
- let mut requirements = if let Some ( pip_local_dependencies) =
117
+ let requirements = if let Some ( pip_local_dependencies) =
118
118
WORKER_CONFIG . read ( ) . await . pip_local_dependencies . as_ref ( )
119
119
{
120
120
let deps = pip_local_dependencies. clone ( ) ;
@@ -144,17 +144,20 @@ pub async fn uv_pip_compile(
144
144
} ;
145
145
146
146
#[ cfg( feature = "enterprise" ) ]
147
- {
148
- requirements = replace_pip_secret ( db , w_id , & requirements , worker_name , job_id ) . await ? ;
149
- }
147
+ let requirements = replace_pip_secret ( db , w_id , & requirements , worker_name , job_id ) . await ? ;
148
+
149
+ let mut req_hash = format ! ( "py-{}" , calculate_hash ( & requirements ) ) ;
150
150
151
151
if no_uv || * USE_PIP_COMPILE {
152
+ // Set no_uv if not setted
152
153
no_uv = true ;
153
- // We want to make sure that when we specify `no_uv` lockfile will be resolved again
154
- requirements. push_str ( "\n #no_uv" ) ;
154
+ // Make sure that if we put #no_uv (switch to pip-compile) to python code or used `USE_PIP_COMPILE=true` variable.
155
+ // Windmill will recalculate lockfile using pip-compile and dont take potentially broken lockfile (generated by uv) from cache (our db).
156
+ // It will recalculate lockfile even if inputs have not been changed.
157
+ req_hash. push_str ( "-no_uv" ) ;
158
+ // Will be in format:
159
+ // py-000..000-no_uv
155
160
}
156
-
157
- let req_hash = format ! ( "py-{}" , calculate_hash( & requirements) ) ;
158
161
if !no_cache {
159
162
if let Some ( cached) = sqlx:: query_scalar!(
160
163
"SELECT lockfile FROM pip_resolution_cache WHERE hash = $1" ,
0 commit comments