Include tag distance and commit hash in dev versions when possible (#5664)

* Include tag distance and commit hash in dev versions when possible

* Fix test
This commit is contained in:
jack1142
2022-04-03 03:51:34 +02:00
committed by GitHub
parent febca8ccbb
commit 35f1681dc1
6 changed files with 80 additions and 11 deletions

View File

@@ -2,9 +2,16 @@ import os
import sys
from setuptools import setup
# Since we're importing `redbot` package, we have to ensure that it's in sys.path.
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
from redbot._version import _get_version
version = _get_version(ignore_installed=True)
if os.getenv("TOX_RED", False) and sys.version_info >= (3, 10):
# We want to be able to test Python versions that we do not support yet.
setup(python_requires=">=3.8.1")
setup(python_requires=">=3.8.1", version=version)
else:
# Metadata and options defined in setup.cfg
setup()
setup(version=version)