@@ -35,23 +35,24 @@ def _source_filter(version) -> bool:
3535 for specifier in ILLEGAL_SPECIFIERS
3636 )
3737
38- def find_illegal (section ) -> List [str ]:
38+ def find_illegal (part ) -> List [str ]:
3939 return [
4040 f"{ name } = { version } "
41- for name , version in section .items ()
41+ for name , version in part .items ()
4242 if _source_filter (version )
4343 ]
4444 illegal : Dict [str , List [str ]] = {}
4545 toml = tomlkit .loads (pyproject_toml )
4646 poetry = toml .get ("tool" , {}).get ("poetry" , {})
47+
4748 part = poetry .get ("dependencies" , {})
48- illegal_group = find_illegal (part )
49- if illegal_group :
49+ if illegal_group := find_illegal (part ):
5050 illegal ["tool.poetry.dependencies" ] = illegal_group
51+
5152 part = poetry .get ("dev" , {}).get ("dependencies" , {})
52- illegal_group = find_illegal (part )
53- if illegal_group :
53+ if illegal_group := find_illegal (part ):
5454 illegal ["tool.poetry.dev.dependencies" ] = illegal_group
55+
5556 part = poetry .get ("group" , {})
5657 for group , content in part .items ():
5758 illegal_group = find_illegal (content .get ("dependencies" , {}))
0 commit comments