@@ -55,10 +55,17 @@ def change_log_new(package_folder: str, lastest_pypi_version: bool) -> str:
5555def get_version_info (package_name : str , tag_is_stable : bool = False ) -> Tuple [str , str ]:
5656 from pypi_tools .pypi import PyPIClient
5757
58+ SDK_VERSIONS_WITH_CHANGELOG_ISSUE = {}
59+ SKIP_SDK_VERSIONS = {"azure-mgmt-datatransfer" : "1.0.0b1" } # could be removed after new SDK version released
60+
5861 try :
59- client = PyPIClient ()
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+ client = PyPIClient (force_pypi = True )
63+ # Ignore 0.0.0 placeholder releases, including prereleases like 0.0.0b1 via base_version.
64+ ordered_versions = [
65+ v
66+ for v in client .get_ordered_versions (package_name )
67+ if v .base_version != "0.0.0" and str (v ) != SKIP_SDK_VERSIONS .get (package_name )
68+ ]
6269 if not ordered_versions :
6370 return "" , ""
6471 last_release = ordered_versions [- 1 ]
@@ -72,10 +79,9 @@ def get_version_info(package_name: str, tag_is_stable: bool = False) -> Tuple[st
7279 # temporary logic to always get latest version from pypi for specific packages whose latest stable version
7380 # is not updated for a long time and has some issue in changelog generation.
7481 # This is a workaround before we have a better solution to determine the version for changelog generation.
75- sdks_with_changelog_issue = {}
76- if package_name in sdks_with_changelog_issue and (
77- last_version == sdks_with_changelog_issue [package_name ]
78- or last_stable_version == sdks_with_changelog_issue [package_name ]
82+ if package_name in SDK_VERSIONS_WITH_CHANGELOG_ISSUE and (
83+ last_version == SDK_VERSIONS_WITH_CHANGELOG_ISSUE [package_name ]
84+ or last_stable_version == SDK_VERSIONS_WITH_CHANGELOG_ISSUE [package_name ]
7985 ):
8086 _LOGGER .info (
8187 f"Package { package_name } has changelog generation issue with version { last_version } , fallback to get latest version from pypi"
0 commit comments