Skip to content

Commit df01e05

Browse files
committed
upd
1 parent ce96e8d commit df01e05

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

docs/source/conf.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,20 @@
147147

148148
# sphinx_multiversion
149149
# Whitelist for tags matching v1.0.0, v2.1.0 format
150-
smv_tag_whitelist = r'^v\d+\.\d+\.\d+$'
150+
# smv_tag_whitelist = r'^v\d+\.\d+\.\d+$'
151+
smv_tag_whitelist = r'^.*$'
151152

152153
# Whitelist for the dev branch
153154
smv_branch_whitelist = r'^dev$'
154155

155156
# Output format (keeping your current format)
156-
smv_outputdir_format = 'versions/{config.version}'
157+
smv_outputdir_format = 'versions/{ref.name}'
157158

158159
# Include both tags and dev branch as released
159160
smv_released_pattern = r'^(refs/tags/.*|refs/heads/dev)$'
160161

162+
smv_remote_whitelist = r'^(origin|upstream)$' # Use branches from origin and upstream
163+
161164
repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', "..")) # if conf.py is in docs/
162165
def setup(app) -> None: # noqa: ANN001
163166
generate_versions_json(app, repo_root, BASE_URL)

docs/source/docs_utils/versions_generator.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,13 @@
1010

1111

1212
def get_sorted_versions(repo_root, base_url):
13-
# Get the git repository root
14-
tags_output = subprocess.check_output(['git', '-C', repo_root, 'tag'], text=True).strip().split('\n')
15-
# Change to the repository root
16-
original_cwd = os.getcwd()
1713
os.chdir(repo_root)
1814
# Fetch tags and branches
1915
tags_output = subprocess.check_output(['git', 'tag'], text=True).strip().split('\n')
2016
tag_regex = re.compile(r"^v\d+\.\d+\.\d+$") # Matches tags like v0.0.1
2117
tags = [tag for tag in tags_output if tag_regex.match(tag)]
2218

23-
# Sort tags
24-
def version_key(tag):
25-
version = tag.lstrip('v')
26-
return [int(x) for x in version.split('.')]
27-
28-
sorted_tags = sorted(tags, key=version_key, reverse=True)
19+
sorted_tags = sorted(tags, reverse=True)
2920

3021
# Prepare versions list (similar to previous implementation)
3122
versions = []

0 commit comments

Comments
 (0)