Skip to content

Commit

Permalink
build: setuptools_scm infers the version from git
Browse files Browse the repository at this point in the history
I think that was the whole point of usign setuptools_scm.
  • Loading branch information
DimitriPapadopoulos committed Jan 11, 2024
1 parent 2e4f485 commit 98072a6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include yamllint/_version.py
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ documentation = "https://yamllint.readthedocs.io"

[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=61"]
requires = ["setuptools>=64", "setuptools-scm[toml]>=8"]

[tool.setuptools]
packages = ["yamllint", "yamllint.conf", "yamllint.rules"]

[tool.setuptools.package-data]
yamllint = ["conf/*.yaml"]

[tool.setuptools.dynamic]
version = {attr = "yamllint.__version__"}
[tool.setuptools-scm]
write_to = "yamllint/_version.py"
7 changes: 5 additions & 2 deletions yamllint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@
repetition and cosmetic problems such as lines length, trailing spaces,
indentation, etc."""

try:
from ._version import version as __version__
except ImportError:
__version__ = "unknown version"

APP_NAME = 'yamllint'
APP_VERSION = '1.33.0'
APP_VERSION = __version__
APP_DESCRIPTION = __doc__

__author__ = 'Adrien Vergé'
__copyright__ = 'Copyright 2022, Adrien Vergé'
__license__ = 'GPLv3'
__version__ = APP_VERSION

0 comments on commit 98072a6

Please sign in to comment.