Skip to content

Commit 540d221

Browse files
msyycCopilot
andauthored
Fix apiview reqs install on Python 3.13 and update version calculation logic (#47608)
* Fix apiview reqs install on Python 3.13 lazy-object-proxy==1.10.0 has no cp313 wheel, so pip builds it from source. The isolated build env fails to fetch setuptools_scm from the private feed (401 -> interactive prompt -> EOFError). Pre-install build deps from PyPI and use --no-build-isolation as a workaround until lazy-object-proxy works on Python 3.13. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * update --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 72b7a0e commit 540d221

2 files changed

Lines changed: 28 additions & 5 deletions

File tree

eng/tools/azure-sdk-tools/packaging_tools/package_utils.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ def get_version_info(package_name: str, tag_is_stable: bool = False) -> Tuple[st
5757

5858
try:
5959
client = PyPIClient()
60-
ordered_versions = client.get_ordered_versions(package_name)
60+
# Ignore 0.0.0 when it appears on PyPI as a placeholder or name-reservation version.
61+
ordered_versions = [v for v in client.get_ordered_versions(package_name) if v.base_version != "0.0.0"]
62+
if not ordered_versions:
63+
return "", ""
6164
last_release = ordered_versions[-1]
6265
stable_releases = [x for x in ordered_versions if not x.is_prerelease]
6366
last_stable_version = str(stable_releases[-1] if stable_releases else "")
@@ -85,10 +88,6 @@ def get_version_info(package_name: str, tag_is_stable: bool = False) -> Tuple[st
8588
last_version = ""
8689
last_stable_version = ""
8790

88-
# Ignore 0.0.0 when it appears on PyPI as a placeholder or name-reservation version.
89-
if last_version and Version(last_version).base_version == "0.0.0":
90-
return "", ""
91-
9291
return last_version, last_stable_version
9392

9493

eng/tools/azure-sdk-tools/packaging_tools/sdk_generator.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,29 @@ def main(generate_input, generate_output):
316316
apiview_start_time = time.time()
317317
try:
318318
_LOGGER.info(f"install apiview generation tool")
319+
# Workaround for Python 3.13: lazy-object-proxy==1.10.0 (pinned in
320+
# eng/apiview_reqs.txt) ships no cp313 wheel, so pip builds it from
321+
# source. The isolated build environment fails to fetch its build deps
322+
# (setuptools_scm) from the azure-sdk private feed (401 -> interactive
323+
# prompt -> EOFError), which breaks the whole install. Pre-install the
324+
# build deps from PyPI and disable build isolation so the source build
325+
# uses them instead of reaching out to the private feed.
326+
# TODO: revert this logic once it works on Python 3.13 (e.g. once
327+
# lazy-object-proxy ships a cp313 wheel on the feed).
328+
check_call(
329+
[
330+
"python",
331+
"-m",
332+
"pip",
333+
"install",
334+
"setuptools>=64",
335+
"setuptools_scm>=8",
336+
"wheel",
337+
"--index-url=https://pypi.org/simple/",
338+
],
339+
timeout=600,
340+
stderr=None if data.get("runMode") == "release" else subprocess.DEVNULL,
341+
)
319342
check_call(
320343
[
321344
"python",
@@ -325,6 +348,7 @@ def main(generate_input, generate_output):
325348
"-r",
326349
"eng/apiview_reqs.txt",
327350
"--index-url=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/",
351+
"--no-build-isolation",
328352
],
329353
timeout=600,
330354
stderr=None if data.get("runMode") == "release" else subprocess.DEVNULL,

0 commit comments

Comments
 (0)