diff --git a/mozregression/__init__.py b/mozregression/__init__.py index 8e10cb462..704309354 100644 --- a/mozregression/__init__.py +++ b/mozregression/__init__.py @@ -1 +1,3 @@ -__version__ = "3.0.4" +from .version import version + +__version__ = version diff --git a/pyproject.toml b/pyproject.toml index 525b70c2b..e97b0f078 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,13 @@ +# pyproject.toml +[build-system] +requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] + +[tool.setuptools_scm] +write_to = "mozregression/version.py" + [tool.black] line-length = 100 -exclude = "gui/mozregui/ui" +# excludes handled in setup.cfg, since it's called via flake8 [tool.isort] line_length = 100 diff --git a/requirements/base.txt b/requirements/base.txt index fc2f55281..ceaec7b42 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -13,6 +13,7 @@ mozrunner==7.8.0 mozversion==2.3.0 redo==2.0.3 requests==2.23.0 +setuptools_scm==3.5.0 taskcluster==29.0.1 # for some reason we need to specify a specific version of six diff --git a/setup.cfg b/setup.cfg index 7111b469d..5d879cdae 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [flake8] -exclude = .git,__pycache__,vendor,gui/mozregui/ui +exclude = .git,__pycache__,vendor,gui/mozregui/ui,mozregression/version.py max-line-length = 100 # E121,E123,E126,E226,E24,E704,W503: Ignored in default pycodestyle config: # https://github.com/PyCQA/pycodestyle/blob/2.2.0/pycodestyle.py#L72 diff --git a/setup.py b/setup.py index 6670d793c..00b84050b 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,5 @@ from setuptools import setup -from mozregression import __version__ - # we pin these dependencies in the requirements files -- all of these # should be python 3 compatible DEPENDENCIES = [ @@ -31,7 +29,7 @@ setup( name="mozregression", - version=__version__, + use_scm_version=True, description=desc, long_description=long_desc, author="Mozilla Automation and Tools Team", @@ -46,6 +44,7 @@ package_data={"mozregression": ["*.yaml"]}, platforms=["Any"], python_requires=">=3.5", + setup_requires=["setuptools_scm"], install_requires=DEPENDENCIES, classifiers=[ "Development Status :: 5 - Production/Stable",