3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-12 06:00:53 +00:00

Add proper pyproject.toml metadata for dist-info creation

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-06-25 20:35:37 +00:00
parent dbefbfb89f
commit 7f5be8814b
4 changed files with 240 additions and 16 deletions

View file

@ -112,21 +112,27 @@ def _clean_native_build():
rmtree(BUILD_DIR)
def _z3_version():
post = os.getenv('Z3_VERSION_SUFFIX', '')
if RELEASE_DIR is None:
fn = os.path.join(SRC_DIR, 'scripts', 'mk_project.py')
if os.path.exists(fn):
with open(fn) as f:
for line in f:
n = re.match(r".*set_version\((.*), (.*), (.*), (.*)\).*", line)
if not n is None:
return n.group(1) + '.' + n.group(2) + '.' + n.group(3) + '.' + n.group(4) + post
return "?.?.?.?"
else:
version = RELEASE_METADATA[0]
if version.count('.') == 2:
version += '.0'
return version + post
# Import version from z3_version module for consistency
try:
from z3_version import get_version
return get_version()
except ImportError:
# Fallback to original implementation
post = os.getenv('Z3_VERSION_SUFFIX', '')
if RELEASE_DIR is None:
fn = os.path.join(SRC_DIR, 'scripts', 'mk_project.py')
if os.path.exists(fn):
with open(fn) as f:
for line in f:
n = re.match(r".*set_version\((.*), (.*), (.*), (.*)\).*", line)
if not n is None:
return n.group(1) + '.' + n.group(2) + '.' + n.group(3) + '.' + n.group(4) + post
return "?.?.?.?"
else:
version = RELEASE_METADATA[0]
if version.count('.') == 2:
version += '.0'
return version + post
def _configure_z3():
global IS_SINGLE_THREADED
@ -284,7 +290,7 @@ class sdist(_sdist):
# The Azure Dev Ops pipelines use internal OS version tagging that don't correspond
# to releases.
internal_build_re = re.compile("(.+)\_7")
internal_build_re = re.compile(r"(.+)\_7")
class bdist_wheel(_bdist_wheel):