diff --git a/upgrade/scripts/upgrade_python_package.py b/upgrade/scripts/upgrade_python_package.py index 0dd9673..b38d5d7 100644 --- a/upgrade/scripts/upgrade_python_package.py +++ b/upgrade/scripts/upgrade_python_package.py @@ -82,18 +82,22 @@ def get_constraints_file_path(package_name, site_packages_dir=None): # get oll path with pathlib oll_path = Path(oll.__file__).parent + print(oll_path) # get constraints.txt file path from oll_path constraints_file_path = oll_path / "constraints.txt" + print(constraints_file_path) if constraints_file_path.exists(): return str(constraints_file_path) raise ImportError except (TypeError, ImportError, AttributeError): + print("constraints error") + print(site.getsitepackages()) site_packages_dir = ( Path(site_packages_dir) if site_packages_dir else Path(site.getsitepackages()[1]) ) - + print(site_packages_dir) package_name = package_name.replace("-", "_") constraints_file_path = site_packages_dir / package_name / "constraints.txt" if os.path.exists(constraints_file_path): @@ -211,7 +215,9 @@ def install_wheel( str(parse_wheel_filename(wheel_name)[1]) for wheel_name in wheel_names ] wheel_mapping = {k: v for (k, v) in zip(parsed_wheel_versions, wheel_paths)} + print(wheel_mapping) versions = filter_versions(SpecifierSet(version_cmd), parsed_wheel_versions) + print(f"filtered versions: {versions}") wheel = wheel_mapping.get(versions[-1]) except IndexError: print(f"Wheel {package_name} not found") @@ -247,7 +253,9 @@ def install_wheel( resp += pip("check") except: # try to install with constraints + print("before constraints") constraints_file_path = get_constraints_file_path(package_name) + print("after constraints") try: resp += install_with_constraints( to_install, @@ -257,6 +265,7 @@ def install_wheel( wheels_path, *args, ) + print("after constraints 2") except: if slack_webhook_url is not None: try: