diff --git a/Makefile b/Makefile index 8662626d31..dcf26c662e 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,8 @@ NPM_BIN ?= npm CHROMIUM_BIN=/tmp/chrome-linux/chrome GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD) MANAGEMENT_COMMAND ?= awx-manage -VERSION := $(shell $(PYTHON) setup.py --version) -COLLECTION_VERSION := $(shell $(PYTHON) setup.py --version | cut -d . -f 1-3) +VERSION := $(shell $(PYTHON) -m setuptools_scm) +COLLECTION_VERSION := $(shell $(PYTHON) -m setuptools_scm | cut -d . -f 1-3) # NOTE: This defaults the container image version to the branch that's active COMPOSE_TAG ?= $(GIT_BRANCH) diff --git a/pyproject.toml b/pyproject.toml index 3dbfd016a3..351a98ee3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,3 +3,9 @@ line-length = 160 fast = true skip-string-normalization = true exclude = "awx_collection" + +[build-system] +requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] + + +[tool.setuptools_scm]