mirror of
				https://github.com/enpaul/tox-poetry-installer.git
				synced 2025-11-04 07:46:06 +00:00 
			
		
		
		
	Merge pull request #22 from enpaul/enp/recursive
Fix recursive dependencies causing recursion error
This commit is contained in:
		@@ -1,6 +1,5 @@
 | 
				
			|||||||
"""Helper utility functions, usually bridging Tox and Poetry functionality"""
 | 
					"""Helper utility functions, usually bridging Tox and Poetry functionality"""
 | 
				
			||||||
from pathlib import Path
 | 
					from pathlib import Path
 | 
				
			||||||
from typing import List
 | 
					 | 
				
			||||||
from typing import Sequence
 | 
					from typing import Sequence
 | 
				
			||||||
from typing import Set
 | 
					from typing import Set
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -109,21 +108,22 @@ def find_transients(packages: PackageMap, dependency_name: str) -> Set[PoetryPac
 | 
				
			|||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        top_level = packages[dependency_name]
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        def find_deps_of_deps(name: str) -> List[PoetryPackage]:
 | 
					        def find_deps_of_deps(name: str, transients: PackageMap):
 | 
				
			||||||
            if name in PoetryProvider.UNSAFE_PACKAGES:
 | 
					            if name in PoetryProvider.UNSAFE_PACKAGES:
 | 
				
			||||||
                reporter.warning(
 | 
					                reporter.warning(
 | 
				
			||||||
                    f"{constants.REPORTER_PREFIX} installing package '{name}' using Poetry is not supported; skipping installation of package '{name}'"
 | 
					                    f"{constants.REPORTER_PREFIX} installing package '{name}' using Poetry is not supported; skipping installation of package '{name}'"
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
                return []
 | 
					            else:
 | 
				
			||||||
            transients = [packages[name]]
 | 
					                transients[name] = packages[name]
 | 
				
			||||||
            for dep in packages[name].requires:
 | 
					                for dep in packages[name].requires:
 | 
				
			||||||
                transients += find_deps_of_deps(dep.name)
 | 
					                    if dep.name not in transients.keys():
 | 
				
			||||||
            return transients
 | 
					                        find_deps_of_deps(dep.name, transients)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return set(find_deps_of_deps(top_level.name))
 | 
					        transients: PackageMap = {}
 | 
				
			||||||
 | 
					        find_deps_of_deps(packages[dependency_name].name, transients)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return set(transients.values())
 | 
				
			||||||
    except KeyError:
 | 
					    except KeyError:
 | 
				
			||||||
        if any(
 | 
					        if any(
 | 
				
			||||||
            delimiter in dependency_name
 | 
					            delimiter in dependency_name
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user