Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def grayskull_audit_feedstock(fctx: FeedstockContext, ctx: MigratorSessionContext):
"""Uses grayskull to audit the requirements for a python package
"""
# TODO: come back to this, since CF <-> PyPI is not one-to-one and onto
pkg_name = fctx.attrs["name"]
pkg_version = fctx.attrs["version"]
recipe = GrayskullFactory.create_recipe(
"pypi", pkg_name, pkg_version, download=False
)
with tempfile.TemporaryDirectory() as td:
recipe.generate_recipe(
td,
mantainers=list(
{
m: None
for m in fctx.attrs["meta_yaml"]["extra"]["recipe-maintainers"]
}
),
)
with open(os.path.join(td, pkg_name, "meta.yaml"), "r") as f:
out = f.read()
return out