浏览代码

Revert "fix update_pyproject.py (#2345)"

This reverts commit ccab1812fd414080f0f844827b2f7d8ea1daf77f.
Rodja Trappe 1 年之前
父节点
当前提交
95dbbfb473
共有 1 个文件被更改,包括 2 次插入9 次删除
  1. 2 9
      .github/workflows/update_pyproject.py

+ 2 - 9
.github/workflows/update_pyproject.py

@@ -1,17 +1,10 @@
 #!/usr/bin/env python3
 import re
-import subprocess
+import sys
 from pathlib import Path
 
-VERSION_PATTERN = re.compile(r'v[0-9]+\.[0-9]+\.[0-9]+')
-
 if __name__ == '__main__':
-    command = 'git describe --tags $(git rev-list --tags --max-count=100)'
-    tags = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True, check=True) \
-        .stdout.strip().splitlines()
-    version = next(tag for tag in tags if VERSION_PATTERN.fullmatch(tag)).removeprefix('v')
-
     path = Path('pyproject.toml')
     content = path.read_text(encoding='utf-8')
-    content = re.sub(r'version = "[0-9]+\.[0-9]+\.[0-9]+-dev"', f'version = "{version}-dev"', content)
+    content = re.sub(r'version = "[0-9]+\.[0-9]+\.[0-9]+-dev"', f'version = "{sys.argv[1]}-dev"', content)
     path.write_text(content, encoding='utf-8')