@@ -87,23 +87,27 @@ impl PyProjectManifest {
8787 continue ; // Skip python version constraint
8888 }
8989 if let Some ( version) = extract_poetry_version ( item) {
90- deps. push ( DependencySpec {
91- name : name. to_owned ( ) ,
92- current_req : version,
93- section : DependencySection :: Dependencies ,
94- } ) ;
90+ if !is_wildcard_req ( & version) {
91+ deps. push ( DependencySpec {
92+ name : name. to_owned ( ) ,
93+ current_req : version,
94+ section : DependencySection :: Dependencies ,
95+ } ) ;
96+ }
9597 }
9698 }
9799 }
98100 // Poetry dev-dependencies
99101 if let Some ( dev_deps) = poetry. get ( "dev-dependencies" ) . and_then ( Item :: as_table) {
100102 for ( name, item) in dev_deps {
101103 if let Some ( version) = extract_poetry_version ( item) {
102- deps. push ( DependencySpec {
103- name : name. to_owned ( ) ,
104- current_req : version,
105- section : DependencySection :: DevDependencies ,
106- } ) ;
104+ if !is_wildcard_req ( & version) {
105+ deps. push ( DependencySpec {
106+ name : name. to_owned ( ) ,
107+ current_req : version,
108+ section : DependencySection :: DevDependencies ,
109+ } ) ;
110+ }
107111 }
108112 }
109113 }
@@ -210,6 +214,10 @@ fn parse_pep508_spec(spec: &str, section: DependencySection) -> Option<Dependenc
210214 return None ; // No version constraint
211215 }
212216
217+ if is_wildcard_req ( rest) {
218+ return None ; // `*`, `==*`, etc. already mean "any version"
219+ }
220+
213221 Some ( DependencySpec {
214222 name : name. to_owned ( ) ,
215223 current_req : rest. to_owned ( ) ,
@@ -257,6 +265,18 @@ fn replace_version_in_pep508(spec: &str, new_version: &str) -> String {
257265 format ! ( "{name}{extras}{new_version}{marker}" )
258266}
259267
268+ /// Check if a version requirement is an unresolvable wildcard like `*` or `==*`.
269+ ///
270+ /// Such requirements already mean "any/latest version", so updating them
271+ /// would be a meaningless no-op and we filter them out at parse time.
272+ fn is_wildcard_req ( req : & str ) -> bool {
273+ let stripped = req
274+ . trim ( )
275+ . trim_start_matches ( [ '=' , '~' , '^' , '>' , '<' ] )
276+ . trim ( ) ;
277+ matches ! ( stripped, "" | "*" )
278+ }
279+
260280/// Extract a version string from a Poetry dependency value.
261281fn extract_poetry_version ( item : & Item ) -> Option < String > {
262282 match item {
0 commit comments