Skip to content

Treat 0.0.0 as invalid version in get_version_info#46549

Merged
msyyc merged 5 commits intomainfrom
copilot/fix-package-utils-version
Apr 27, 2026
Merged

Treat 0.0.0 as invalid version in get_version_info#46549
msyyc merged 5 commits intomainfrom
copilot/fix-package-utils-version

Conversation

@msyyc
Copy link
Copy Markdown
Member

@msyyc msyyc commented Apr 27, 2026

Description

Although 0.0.0 may exist as a published version on PyPI for some packages, it is not a valid release version for our purposes. This change updates get_version_info in package_utils.py to return empty strings when the latest version returned from PyPI starts with 0.0.0, so downstream logic does not treat it as a real previous release.

Changes

Copilot AI review requested due to automatic review settings April 27, 2026 04:37
@msyyc msyyc requested review from mccoyp and scbedd as code owners April 27, 2026 04:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates get_version_info to treat 0.0.0 (and currently any version string beginning with 0.0.0) as an invalid “previous release” so downstream tooling doesn’t consider it a real prior PyPI version.

Changes:

  • Add a guard in get_version_info to return ("", "") when the computed last_version starts with 0.0.0.

Comment thread eng/tools/azure-sdk-tools/packaging_tools/package_utils.py Outdated
Comment thread eng/tools/azure-sdk-tools/packaging_tools/package_utils.py Outdated
Comment thread eng/tools/azure-sdk-tools/packaging_tools/package_utils.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 27, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • pypi.org
    • Triggering command: /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/lib/python3.9/site-packages/pip/__pip-REDACTED__.py install --ignore-installed --no-user --prefix /tmp/pip-build-env-t99mohg_/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i REDACTED -- setuptools>=42 wheel (dns block)
  • scanning-api.github.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@msyyc msyyc merged commit 6937f74 into main Apr 27, 2026
15 checks passed
@msyyc msyyc deleted the copilot/fix-package-utils-version branch April 27, 2026 06:32
fafhrd91 pushed a commit to fafhrd91/azure-sdk-for-python that referenced this pull request Apr 28, 2026
* Treat 0.0.0 as invalid version in get_version_info

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Use packaging.version.Version for 0.0.0 check; add unit tests

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/4ebec9df-c06c-4b15-a0a9-97e80d6dc045

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>

* Improve assertion in 0.0.0.1 test to check specific return value

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/4ebec9df-c06c-4b15-a0a9-97e80d6dc045

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants