Skip to content

Commit

Permalink
Resolve Failing Documentation Build for azure-mgmt-core (#14239)
Browse files Browse the repository at this point in the history
* properly update the dev versioning requirements for packages in sanitize_setup

* add only the blob-changefeed override due to outdated req on azure-storage-blob

* update regression to update the local versions of the package to MATCH the wheel versions. nightly should be expecting azure-storage-blob==12.3.7a

* resolve faulty logic causing dev build to always be true.

* set dev-build so that the files on disk match the expected version that will be installed from the wheel directory
  • Loading branch information
scbedd authored Oct 5, 2020
1 parent 6fee44a commit 66cd75c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
11 changes: 11 additions & 0 deletions eng/pipelines/templates/steps/test_regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ parameters:
BuildTargetingString: 'azure-*'
ServiceDirectory: ''
BuildStagingDirectory: $(Build.ArtifactStagingDirectory)
DevFeedName: 'public/azure-sdk-for-python'

steps:
- task: UsePythonVersion@0
Expand All @@ -14,6 +15,16 @@ steps:
artifactName: 'artifacts'
targetPath: $(Build.ArtifactStagingDirectory)

- template: ../steps/set-dev-build.yml
parameters:
ServiceDirectory: ${{ parameters.ServiceDirectory }}
BuildTargetingString: ${{ parameters.BuildTargetingString }}

- ${{if eq(variables['System.TeamProject'], 'internal') }}:
- template: ../steps/auth-dev-feed.yml
parameters:
DevFeedName: ${{ parameters.DevFeedName }}

- script: |
pip install -r eng/ci_tools.txt
displayName: 'Prep Environment'
Expand Down
15 changes: 11 additions & 4 deletions eng/tox/sanitize_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import logging
import glob
from packaging.specifiers import SpecifierSet
from packaging.version import Version
from pkg_resources import Requirement
from pypi_tools.pypi import PyPIClient

Expand All @@ -22,7 +23,7 @@
sys.path.append(setup_parser_path)
from setup_parser import get_install_requires, parse_setup

DEV_BUILD_IDENTIFIER = ".dev"
DEV_BUILD_IDENTIFIER = "a"

def update_requires(setup_py_path, requires_dict):
# This method changes package requirement by overriding the specifier
Expand Down Expand Up @@ -62,12 +63,17 @@ def get_version(pkg_name):
# When building package with dev build version, version for packages in same service is updated to dev build
# and other packages will not have dev build number
# strip dev build number so we can check if package exists in PyPI and replace
if DEV_BUILD_IDENTIFIER in version:
version = version[:version.find(DEV_BUILD_IDENTIFIER)]

version_obj = Version(version)
if version_obj.pre:
if version_obj.pre[0] == DEV_BUILD_IDENTIFIER:
version = version_obj.base_version

return version
else:
logging.error("setyp.py is not found for package {} to identify current version".format(pkg_name))
exit(1)


def process_requires(setup_py_path):
# This method process package requirement to verify if all required packages are available on PyPI
Expand All @@ -82,11 +88,12 @@ def process_requires(setup_py_path):
for req in requires:
pkg_name = req.key
spec = SpecifierSet(str(req).replace(pkg_name, ""))

if not is_required_version_on_pypi(pkg_name, spec):
old_req = str(req)
version = get_version(pkg_name)
logging.info("Updating version {0} in requirement {1} to dev build version".format(version, old_req))
new_req = old_req.replace(version, "{}.dev".format(version))
new_req = old_req.replace(version, "{}{}".format(version, DEV_BUILD_IDENTIFIER))
logging.info("New requirement for package {0}: {1}".format(pkg_name, new_req))
requirement_to_update[old_req] = new_req

Expand Down
2 changes: 1 addition & 1 deletion scripts/devops_tasks/build_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ def verify_update_package_requirement(pkg_root):
target_dir = root_dir

targeted_packages = process_glob_string(args.glob_string, target_dir, args.package_filter_string)
build_packages(targeted_packages, args.distribution_directory, args.is_dev_build)
build_packages(targeted_packages, args.distribution_directory, bool(args.is_dev_build))
3 changes: 2 additions & 1 deletion scripts/devops_tasks/git_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
'azure-cosmos': '3.2.0',
'azure-servicebus': '0.50.3',
'azure-eventgrid': '1.3.0',
'azure-schemaregistry-avroserializer': '1.0.0b1'
'azure-schemaregistry-avroserializer': '1.0.0b1',
'azure-storage-blob-changefeed' : '12.0.0b2'
}

# This method identifies release tag for latest or oldest released version of a given package
Expand Down

0 comments on commit 66cd75c

Please sign in to comment.