File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -209,3 +209,6 @@ cython_debug/
209209marimo /_static /
210210marimo /_lsp /
211211__marimo__ /
212+
213+ # Ignore autocalver git log markers.
214+ git-log-head
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ validation:
1111
1212extra :
1313 project_name : beeware-docs-tools
14+ package_name : beeware-docs-tools
1415 social :
1516 - icon : fontawesome/brands/github
1617 link : https://github.com/beeware
Original file line number Diff line number Diff line change 11[build-system ]
22requires = [
33 " setuptools==80.9.0" ,
4+ " autocalver" ,
45]
56build-backend = " setuptools.build_meta"
67
78[project ]
9+ dynamic = [" version" ]
810name = " beeware-docs-tools"
9- version = " 2025.08.15.0"
1011description = " Tools for building BeeWare's documentation with a common theme and translations."
1112readme = " README.md"
1213requires-python = " >= 3.12"
@@ -35,7 +36,6 @@ dependencies = [
3536 " pyspelling==2.10" ,
3637 " python-Levenshtein==0.27.1" ,
3738 " PyYAML==6.0.2" ,
38- " setuptools-scm==9.2.0" ,
3939 " translate-toolkit @ git+https://github.com/translate/translate@aa35159f03f53aa536381643dfafbc2a19a24784" ,
4040]
4141
@@ -72,3 +72,10 @@ beeware_docs_tools = [
7272 " **/*.png" ,
7373 " **/*.woff2" ,
7474]
75+
76+ [tool .autocalver ]
77+ use = true
78+ log = " git-log-head"
79+ log_command = " git log -n 1 --date=iso"
80+ is_main_var = " BUILD_BRANCH_REF"
81+ is_main_match = " .*/main$"
Original file line number Diff line number Diff line change 11import subprocess
22from argparse import ArgumentParser , Namespace
3+ from importlib .metadata import metadata
34from pathlib import Path
45import yaml
5- from setuptools_scm import get_version
66from tempfile import TemporaryDirectory
77
88
99SOURCE_DIR = Path .cwd ()
1010
11- version = get_version (relative_to = SOURCE_DIR / "tox.ini" )
12-
1311
1412def parse_args () -> Namespace :
1513 parser = ArgumentParser ()
@@ -81,7 +79,11 @@ def main():
8179 config_file = yaml .load (
8280 open (SOURCE_DIR / "docs" / "config.yml" ), Loader = yaml .SafeLoader
8381 )
84- config_file ["extra" ].update ({"version" : f"{ version } " })
82+ try :
83+ version = metadata (config_file ["extra" ]["package_name" ])["version" ]
84+ config_file ["extra" ]["version" ] = version
85+ except KeyError :
86+ pass
8587
8688 with (temp_md_directory / "config.yml" ).open (
8789 "w" , encoding = "utf-8"
Original file line number Diff line number Diff line change 11import subprocess
22from argparse import ArgumentParser , Namespace
3+ from importlib .metadata import metadata
34from pathlib import Path
45import yaml
5- from setuptools_scm import get_version
66from tempfile import TemporaryDirectory
77
88# The theme overrides directory in config.yml is relative to the docs directory.
1212
1313SOURCE_DIR = Path .cwd ()
1414
15- version = get_version (relative_to = SOURCE_DIR / "tox.ini" )
16-
1715
1816def parse_args () -> Namespace :
1917 parser = ArgumentParser ()
@@ -72,7 +70,11 @@ def main():
7270 config_file = yaml .load (
7371 open (SOURCE_DIR / "docs" / "config.yml" ), Loader = yaml .SafeLoader
7472 )
75- config_file ["extra" ].update ({"version" : f"{ version } " })
73+ try :
74+ version = metadata (config_file ["extra" ]["package_name" ])["version" ]
75+ config_file ["extra" ]["version" ] = version
76+ except KeyError :
77+ pass
7678
7779 with (temp_md_directory / "config.yml" ).open (
7880 "w" , encoding = "utf-8"
You can’t perform that action at this time.
0 commit comments