diff --git a/src/setuptools_scm/__init__.py b/src/setuptools_scm/__init__.py
index 6b22b28..beb7168 100644
--- a/src/setuptools_scm/__init__.py
+++ b/src/setuptools_scm/__init__.py
@@ -23,6 +23,7 @@ TEMPLATES = {
 # file generated by setuptools_scm
 # don't change, don't track in version control
 version = {version!r}
+version_tuple = {version_tuple!r}
 """,
     ".txt": "{version}",
 }
@@ -80,8 +81,19 @@ def dump_version(root, version, write_to, template=None):
                 os.path.splitext(target)[1], target
             )
         )
+
+    # version_tuple: each field is converted to an int if possible or kept as string
+    fields = tuple(version.split("."))
+    version_fields = []
+    for field in fields:
+        try:
+            v = int(field)
+        except ValueError:
+            v = field
+        version_fields.append(v)
+
     with open(target, "w") as fp:
-        fp.write(template.format(version=version))
+        fp.write(template.format(version=version, version_tuple=tuple(version_fields)))
 
 
 def _do_parse(config):

diff --git a/testing/test_basic_api.py b/testing/test_basic_api.py
index c5104f5..5111542 100644
--- a/testing/test_basic_api.py
+++ b/testing/test_basic_api.py
@@ -101,9 +101,13 @@ def test_dump_version(tmpdir):
 
     dump_version(sp, "1.0", "first.txt")
     assert tmpdir.join("first.txt").read() == "1.0"
-    dump_version(sp, "1.0", "first.py")
+
+    dump_version(sp, "1.0.dev42", "first.py")
     content = tmpdir.join("first.py").read()
-    assert repr("1.0") in content
+    lines = content.splitlines()
+    assert "version = '1.0.dev42'" in lines
+    assert "version_tuple = (1, 0, 'dev42')" in lines
+
     import ast
 
     ast.parse(content)

enable version-tuples/lazy parsed versions in write_to contents
follow up to https://github.com/pytest-dev/pytest/pull/7605

a way to have easy static version tuples or a available layz parsed version to do version comparisation correctly is nice to have,
if only the string is there, users of a library are tempted into potentially hazardous solutions to compare versions too quick and too error prone
testing/test_basic_api.py::test_dump_version
testing/test_basic_api.py::test_do[ls] testing/test_basic_api.py::test_do[dir] testing/test_basic_api.py::test_data_from_mime testing/test_basic_api.py::test_version_from_pkginfo testing/test_basic_api.py::test_root_parameter_creation testing/test_basic_api.py::test_version_from_scm testing/test_basic_api.py::test_root_parameter_pass_by testing/test_basic_api.py::test_parentdir_prefix testing/test_basic_api.py::test_fallback testing/test_basic_api.py::test_pretended[1.0] testing/test_basic_api.py::test_pretended[1.2.3.dev1+ge871260] testing/test_basic_api.py::test_pretended[1.2.3.dev15+ge871260.d20180625] testing/test_basic_api.py::test_pretended[2345] testing/test_basic_api.py::test_root_relative_to testing/test_basic_api.py::test_parse_plain_fails