Marcel Telka
2022-11-08 ef316148917e69a111acaf12e1a72555764f6386
make-rules: fix Python package names normalization

2 files modified
4 ■■■■ changed files
make-rules/pyproject.mk 2 ●●● patch | view | raw | blame | history
make-rules/setup.py-defaults.mk 2 ●●● patch | view | raw | blame | history
make-rules/pyproject.mk
@@ -108,7 +108,7 @@
            from pyproject_installer.build_cmd._build import parse_build_system_spec; \
            [print(x) for x in parse_build_system_spec(Path("'$(SOURCE_DIR)'"))["requires"]]' \
        | $(GSED) -e $$'s/^[ \t]*''\([a-zA-Z0-9]\([a-zA-Z0-9._-]*[a-zA-Z0-9]\)\{0,1\}\).*/\1/' \
        | tr [A-Z] [a-z] | $(GSED) -e 's/[.-_]\{1,\}/-/g' \
        | tr [A-Z] [a-z] | $(GSED) -e 's/[._-]\{1,\}/-/g' \
        | $(GSED) -e 's/.*/depend type=require fmri=pkg:\/library\/python\/&-$$(PYV)/' \
        > $@
make-rules/setup.py-defaults.mk
@@ -19,7 +19,7 @@
COMPONENT_ARCHIVE ?=        $(COMPONENT_SRC).tar.gz
# To make the package name comparable we normalize it here by following the
# PyPA Core metadata specifications and PEP 503.
COMPONENT_FMRI ?=        library/python/$(shell echo $(COMPONENT_NAME) | tr [A-Z] [a-z] | $(GSED) -e 's/[.-_]\{1,\}/-/g')
COMPONENT_FMRI ?=        library/python/$(shell echo $(COMPONENT_NAME) | tr [A-Z] [a-z] | $(GSED) -e 's/[._-]\{1,\}/-/g')
COMPONENT_PROJECT_URL ?=    https://pypi.org/project/$(COMPONENT_NAME)/
COMPONENT_ARCHIVE_URL ?=    $(call pypi_url)
COMPONENT_PYPI ?=        $(COMPONENT_NAME)