@@ -61,6 +61,22 @@ class Installer(ABC):
61
61
@abstractmethod
62
62
def install_cmd (self , python : str ) -> List [str ]: ...
63
63
64
+ def editable_install_cmd (
65
+ self ,
66
+ python : str ,
67
+ project_root : Path ,
68
+ project_name : str ,
69
+ extras : Optional [Sequence [NormalizedName ]],
70
+ ) -> List [str ]:
71
+ cmd = self .install_cmd (python )
72
+ cmd .append ("-e" )
73
+ if extras :
74
+ extras_str = "," .join (extras )
75
+ cmd .append (f"{ project_root } [{ extras_str } ]" )
76
+ else :
77
+ cmd .append (f"{ project_root } " )
78
+ return cmd
79
+
64
80
@abstractmethod
65
81
def uninstall_cmd (self , python : str ) -> List [str ]: ...
66
82
@@ -101,6 +117,18 @@ class UvpipInstaller(Installer):
101
117
def install_cmd (self , python : str ) -> List [str ]:
102
118
return [sys .executable , "-m" , "uv" , "pip" , "install" , "--python" , python ]
103
119
120
+ def editable_install_cmd (
121
+ self ,
122
+ python : str ,
123
+ project_root : Path ,
124
+ project_name : str ,
125
+ extras : Optional [Sequence [NormalizedName ]],
126
+ ) -> List [str ]:
127
+ cmd = super ().editable_install_cmd (python , project_root , project_name , extras )
128
+ # https://github.com/astral-sh/uv/issues/5484
129
+ cmd .append (f"--refresh-package={ project_name } " )
130
+ return cmd
131
+
104
132
def uninstall_cmd (self , python : str ) -> List [str ]:
105
133
return [sys .executable , "-m" , "uv" , "pip" , "uninstall" , "--python" , python ]
106
134
@@ -191,7 +219,7 @@ def pip_upgrade_project(
191
219
# 4. install project with constraints
192
220
project_name = get_project_name (python , project_root )
193
221
log_info (f"Installing/updating { project_name } " )
194
- cmd = installer .install_cmd (python )
222
+ cmd = installer .editable_install_cmd (python , project_root , project_name , extras )
195
223
if installer_options :
196
224
cmd .extend (installer_options )
197
225
cmd .extend (
@@ -201,12 +229,6 @@ def pip_upgrade_project(
201
229
* editable_constraints ,
202
230
]
203
231
)
204
- cmd .append ("-e" )
205
- if extras :
206
- extras_str = "," .join (extras )
207
- cmd .append (f"{ project_root } [{ extras_str } ]" )
208
- else :
209
- cmd .append (f"{ project_root } " )
210
232
log_debug (f"Running { shlex .join (cmd )} " )
211
233
constraints = constraints_without_editables_filename .read_text (
212
234
encoding = "utf-8"
0 commit comments