A silly mistake where I sorted the list of the versions, but never extracted the top results!
>>> LATEST_RELEASE_TEST_PYPI=$(curl -s https://test.pypi.org/rss/project/django-jazzmin/releases.xml | sed -n 's/\s*<title>\([{a,b}0-9.]*\).*/\1/p' | head -n 2 | xargs)
>>> LATEST_RELEASE_GITHUB=$(curl -s "https://api.github.com/repos/farridav/django-jazzmin/tags" | jq -r '.[0].name[1:]')
>>> LATEST_RELEASE=$(printf "${LATEST_RELEASE_GITHUB}\n${LATEST_RELEASE_TEST_PYPI}" | sort -V -r | head -n 1)
>>> poetry version $LATEST_RELEASE
... Bumping version from 3.0.1a0 to 3.0.0
>>> poetry version prerelease
... Bumping version from 3.0.0 to 3.0.1a0
A silly mistake where I sorted the list of the versions, but never extracted the top results!