@@ -84,6 +84,8 @@ def conda(self):
8484 else :
8585 changelog = {}
8686 for typ , changelog in (("local" , None ), ("global" , changelog )):
87+ if "conda" not in self ._pkg :
88+ continue
8789 meta = CondaRecipeGenerator (
8890 meta = self ._pkg ["conda.recipe.meta" ],
8991 pkg = self ._pkg ,
@@ -272,14 +274,14 @@ def pyproject(self) -> list[DynamicFile]:
272274 },
273275 }
274276 out = {}
275- for key , value in self ._pkg ["pyproject" ].items ():
277+ for key , value in sorted ( self ._pkg ["pyproject" ].items () ):
276278 if not value :
277279 continue
278280 if key in pyproject :
279281 out [key ] = self ._convert_to_toml_format (data = value , types = pyproject [key ])
280282 else :
281283 out [key ] = value
282- file_content = _ps .write .to_toml_string (data = out , sort_keys = False )
284+ file_content = _ps .write .to_toml_string (data = out , sort_keys = True )
283285 file = DynamicFile (
284286 type = DynamicFileType .PKG_CONFIG ,
285287 subtype = (f"{ self ._type } _pyproject" , f"{ self ._type .upper ()} PyProject" ),
@@ -292,7 +294,7 @@ def pyproject(self) -> list[DynamicFile]:
292294 @staticmethod
293295 def _convert_to_toml_format (data : dict , types : dict ) -> dict :
294296 out = {}
295- for key , val in data .items ():
297+ for key , val in sorted ( data .items () ):
296298 if not val :
297299 continue
298300 if key in types :
0 commit comments