File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ build:
1414 # nodejs: "16"
1515 # rust: "1.55"
1616 # golang: "1.17"
17+ jobs :
18+ pre_build :
19+ - python -m pip install -e .
20+ - python -c "import bo4e; print(bo4e.__gh_version__)"
21+ # This ensures that before trying to build the documentation, the package will have information about the
22+ # version tag. This is necessary for the documentation to build the links correctly.
1723
1824# Build documentation in the docs/ directory with Sphinx
1925sphinx :
Original file line number Diff line number Diff line change 177177# The name for this set of Sphinx documents. If None, it defaults to
178178# "<project> v<release> documentation".
179179try :
180- from bo4e import __version__ as version
180+ from bo4e import __gh_version__ as version
181+
182+ print (f"Got version { version } from __gh_version__" )
181183except ImportError :
182184 pass
183185else :
184186 release = version
185187
188+ print (f"Using version { release } for documentation" )
189+
186190# A shorter title for the navigation bar. Default is the same as html_title.
187191# html_short_title = None
188192
Original file line number Diff line number Diff line change 1212# Please keep this name in sync with the name of the project in pyproject.toml
1313# This name is the name of the package on pypi.org
1414if re .match (r"^(\d+\.\d+\.\d+)(rc\d+)?$" , __version__ ):
15- __gh_version__ = re .sub (r"^(\d+\.\d+\.\d+)(rc\d+)?$" , r"v\1-\2" , __version__ )
15+
16+ def _repl (match : re .Match [str ]) -> str :
17+ if match .group (2 ) is not None :
18+ return f"v{ match .group (1 )} -{ match .group (2 )} "
19+ return f"v{ match .group (1 )} "
20+
21+ __gh_version__ = re .sub (r"^(\d+\.\d+\.\d+)(rc\d+)?$" , _repl , __version__ )
1622else :
1723 __gh_version__ = f"v{ __version__ } "
You can’t perform that action at this time.
0 commit comments