Marcel Telka
2022-12-15 f31ed205c8c380d032132c168457d78e0d939f62
make-rules/setup.py-defaults.mk: support for Post-releases

1 files modified
24 ■■■■■ changed files
make-rules/setup.py-defaults.mk 24 ●●●●● patch | view | raw | blame | history
make-rules/setup.py-defaults.mk
@@ -13,9 +13,31 @@
# Copyright 2022 Marcel Telka
#
#
# Component defaults
#
# To support Post-releases (see PEP 440) we need to convert the 'post' part of
# the (human) version number to some numbers.  According to PEP 440 we need to
# make sure that Post-release always immediately follows the corresponding
# release and is ahead of any subsequent release.  We do so by converting word
# 'post' to sequence of zeros.
#
# Unfortunately it is not possible to create solution that would work in all
# cases, so we arbitrarily chose to use 'three dotted zeros'.
#
# Example when the 'three dotted zeros' solution won't work properly:
#
#    HUMAN_VERSION        COMPONENT_VERSION
#    1.1            1.1
#    1.2            1.2
#    1.2.post1        1.2.0.0.0.1
#    1.2.post2        1.2.0.0.0.2
#    1.2.0.0.0.0.1        1.2.0.0.0.0.1
#    1.2.0.0.0.1        1.2.0.0.0.1
#
COMPONENT_VERSION ?=        $(shell echo $(HUMAN_VERSION) | $(GSED) -e 's/post/0.0.0./')
COMPONENT_CLASSIFICATION ?=    Development/Python
COMPONENT_SRC ?=        $(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_SRC ?=        $(COMPONENT_NAME)-$(HUMAN_VERSION)
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.