Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more package mappings for PEP 725 #528

Merged
merged 2 commits into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
55 changes: 52 additions & 3 deletions grayskull/strategy/py_toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,54 @@ def get_pep725_mapping(purl: str):
"virtual:compiler/fortran": "{{ compiler('fortran') }}",
"virtual:compiler/rust": "{{ compiler('rust') }}",
"virtual:interface/blas": "{{ blas }}",
"pkg:generic/boost": "boost-cpp",
"pkg:generic/brial": "brial",
"pkg:generic/cddlib": "cddlib",
"pkg:generic/cliquer": "cliquer",
"pkg:generic/ecl": "ecl",
"pkg:generic/eclib": "eclib",
"pkg:generic/ecm": "ecm",
"pkg:generic/fflas-ffpack": "fflas-ffpack",
"pkg:generic/fplll": "fplll",
"pkg:generic/flint": "libflint",
"pkg:generic/libgd": "libgd",
"pkg:generic/gap": "gap-defaults",
"pkg:generic/gfan": "gfan",
"pkg:generic/gmp": "gmp",
"pkg:generic/giac": "giac",
"pkg:generic/givaro": "givaro",
"pkg:generic/pkg-config": "pkg-config",
"pkg:generic/glpk": "glpk",
"pkg:generic/gsl": "gsl",
"pkg:generic/iml": "iml",
"pkg:generic/lcalc": "lcalc",
"pkg:generic/libbraiding": "libbraiding",
"pkg:generic/libhomfly": "libhomfly",
"pkg:generic/lrcalc": "lrcalc",
"pkg:generic/libpng": "libpng",
"pkg:generic/linbox": "linbox",
"pkg:generic/m4ri": "m4ri",
"pkg:generic/m4rie": "m4rie",
"pkg:generic/mpc": "mpc",
"pkg:generic/mpfi": "mpfi",
"pkg:generic/mpfr": "mpfr",
"pkg:generic/maxima": "maxima",
"pkg:generic/nauty": "nauty",
"pkg:generic/ntl": "ntl",
"pkg:generic/pari": "pari",
"pkg:generic/pari-elldata": "pari-elldata",
"pkg:generic/pari-galdata": "pari-galdata",
"pkg:generic/pari-seadata": "pari-seadata",
"pkg:generic/palp": "palp",
"pkg:generic/planarity": "planarity",
"pkg:generic/ppl": "ppl",
"pkg:generic/primesieve": "primesieve",
"pkg:generic/primecount": "primecount",
"pkg:generic/qhull": "qhull",
"pkg:generic/rw": "rw",
"pkg:generic/singular": "singular",
"pkg:generic/symmetrica": "symmetrica",
"pkg:generic/sympow": "sympow",
}
return package_mapping.get(purl, purl)

Expand All @@ -278,9 +326,10 @@ def add_pep725_metadata(metadata: dict, toml_metadata: dict):
("run", "dependencies"),
)
for conda_section, pep725_section in section_map:
requirements[conda_section] = [
get_pep725_mapping(purl) for purl in externals.get(pep725_section, [])
]
requirements.setdefault(conda_section, [])
requirements[conda_section].extend(
[get_pep725_mapping(purl) for purl in externals.get(pep725_section, [])]
)
# TODO: handle optional dependencies properly
optional_features = toml_metadata.get(f"optional-{pep725_section}", {})
for feature_name, feature_deps in optional_features.items():
Expand Down