Skip to content

Commit

Permalink
resolve 409 failures by enabling dev versioning for mgmt/nspkg, but _…
Browse files Browse the repository at this point in the history
…not_ auto incrementing (Azure#19868)
  • Loading branch information
scbedd authored Jul 20, 2021
1 parent f496498 commit a54df6f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion eng/tox/sanitize_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def process_requires(setup_py_path):
requires = [
Requirement.parse(r)
for r in get_install_requires(setup_py_path)
if r.startswith("azure") and "-nspkg" not in r
if r.startswith("azure")
]
# Find package requirements that are not available on PyPI
requirement_to_update = {}
Expand Down
2 changes: 1 addition & 1 deletion eng/versioning/version_increment.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def increment_version(old_version):

package_name = args.package_name.replace('_', '-')

packages = get_packages(args, package_name)
packages = get_packages(args, package_name, additional_excludes = ["mgmt", "-nspkg"])

package_map = { pkg[1][0]: pkg for pkg in packages }

Expand Down
12 changes: 6 additions & 6 deletions eng/versioning/version_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

logging.getLogger().setLevel(logging.INFO)

def path_excluded(path):
return "-nspkg" in path or "tests" in path or "mgmt" in path or is_metapackage(path)
def path_excluded(path, additional_excludes):
return any([excl in path for excl in additional_excludes]) or "tests" in path or is_metapackage(path)

# Metapackages do not have an 'azure' folder within them
def is_metapackage(package_path):
Expand All @@ -44,13 +44,13 @@ def is_metapackage(package_path):
azure_path = path.join(dir_path, 'azure')
return not path.exists(azure_path)

def get_setup_py_paths(glob_string, base_path):
def get_setup_py_paths(glob_string, base_path, additional_excludes):
setup_paths = process_glob_string(glob_string, base_path)
filtered_paths = [path.join(p, 'setup.py') for p in setup_paths if not path_excluded(p)]
filtered_paths = [path.join(p, 'setup.py') for p in setup_paths if not path_excluded(p, additional_excludes)]
return filtered_paths


def get_packages(args, package_name = ""):
def get_packages(args, package_name = "", additional_excludes = []):
# This function returns list of path to setup.py and setup info like install requires, version for all packages discovered using glob
# Followiong are the list of arguements expected and parsed by this method
# service, glob_string
Expand All @@ -59,7 +59,7 @@ def get_packages(args, package_name = ""):
else:
target_dir = root_dir

paths = get_setup_py_paths(args.glob_string, target_dir)
paths = get_setup_py_paths(args.glob_string, target_dir, additional_excludes)

# Check if package is excluded if a package name param is passed
if package_name and not any(filter(lambda x: package_name == os.path.basename(os.path.dirname(x)), paths)):
Expand Down

0 comments on commit a54df6f

Please sign in to comment.