@@ -63,13 +63,34 @@ def is_self_dev_dep_with_dev_context_only_utils(package, dependency, wrong_self_
63
63
64
64
return is_special_cased
65
65
66
+
67
+ # `cargo publish` is fine with circular dev-dependencies if
68
+ # they are path deps.
69
+ # However, cargo still fails if deps are path deps with versions
70
+ # (this when you use `workspace = true`): https://github.com/rust-lang/cargo/issues/4242
71
+ # Unlike in is_self_dev_dep_with_dev_context_only_utils(),
72
+ # we don't have a clean way of checking if someone used a workspace dev
73
+ # dep when they probably meant to use a path dev dep,
74
+ # so this function just checks if a dev dep is a path dep
75
+ # and provides no special warnings.
76
+ def is_path_dev_dep (dependency ):
77
+ no_explicit_version = '*'
78
+ return (
79
+ dependency ['kind' ] == 'dev'
80
+ and 'path' in dependency
81
+ and dependency ['req' ] == no_explicit_version
82
+ )
83
+
66
84
def should_add (package , dependency , wrong_self_dev_dependencies ):
67
85
related_to_solana = dependency ['name' ].startswith ('solana' )
68
86
self_dev_dep_with_dev_context_only_utils = is_self_dev_dep_with_dev_context_only_utils (
69
87
package , dependency , wrong_self_dev_dependencies
70
88
)
71
-
72
- return related_to_solana and not self_dev_dep_with_dev_context_only_utils
89
+ return (
90
+ related_to_solana
91
+ and not self_dev_dep_with_dev_context_only_utils
92
+ and not is_path_dev_dep (dependency )
93
+ )
73
94
74
95
def get_packages ():
75
96
metadata = load_metadata ()
0 commit comments