mirror of
				https://github.com/enpaul/tox-poetry-installer.git
				synced 2025-11-04 07:46:06 +00:00 
			
		
		
		
	Fix linting errors for pylint 3
This commit is contained in:
		@@ -11,7 +11,6 @@
 | 
				
			|||||||
# --disable=W"
 | 
					# --disable=W"
 | 
				
			||||||
disable=logging-fstring-interpolation
 | 
					disable=logging-fstring-interpolation
 | 
				
			||||||
        ,logging-format-interpolation
 | 
					        ,logging-format-interpolation
 | 
				
			||||||
        ,bad-continuation
 | 
					 | 
				
			||||||
        ,line-too-long
 | 
					        ,line-too-long
 | 
				
			||||||
        ,ungrouped-imports
 | 
					        ,ungrouped-imports
 | 
				
			||||||
        ,typecheck
 | 
					        ,typecheck
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -246,6 +246,21 @@ def find_dev_deps(
 | 
				
			|||||||
    return dedupe_packages(dev_group_deps + legacy_dev_group_deps)
 | 
					    return dedupe_packages(dev_group_deps + legacy_dev_group_deps)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@contextlib.contextmanager
 | 
				
			||||||
 | 
					def _optional_parallelize(parallels: int):
 | 
				
			||||||
 | 
					    """A bit of cheat, really
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    A context manager that exposes a common interface for the caller that optionally
 | 
				
			||||||
 | 
					    enables/disables the usage of the parallel thread pooler depending on the value of
 | 
				
			||||||
 | 
					    the ``parallels`` parameter.
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					    if parallels > 0:
 | 
				
			||||||
 | 
					        with concurrent.futures.ThreadPoolExecutor(max_workers=parallels) as executor:
 | 
				
			||||||
 | 
					            yield executor.submit
 | 
				
			||||||
 | 
					    else:
 | 
				
			||||||
 | 
					        yield lambda func, arg: func(arg)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def install_package(
 | 
					def install_package(
 | 
				
			||||||
    poetry: "_poetry.Poetry",
 | 
					    poetry: "_poetry.Poetry",
 | 
				
			||||||
    venv: ToxVirtualEnv,
 | 
					    venv: ToxVirtualEnv,
 | 
				
			||||||
@@ -280,23 +295,7 @@ def install_package(
 | 
				
			|||||||
        end = datetime.now()
 | 
					        end = datetime.now()
 | 
				
			||||||
        logger.debug(f"Finished installing {dependency} in {end - start}")
 | 
					        logger.debug(f"Finished installing {dependency} in {end - start}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @contextlib.contextmanager
 | 
					    with _optional_parallelize(parallels) as executor:
 | 
				
			||||||
    def _optional_parallelize():
 | 
					 | 
				
			||||||
        """A bit of cheat, really
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        A context manager that exposes a common interface for the caller that optionally
 | 
					 | 
				
			||||||
        enables/disables the usage of the parallel thread pooler depending on the value of
 | 
					 | 
				
			||||||
        the ``parallels`` parameter.
 | 
					 | 
				
			||||||
        """
 | 
					 | 
				
			||||||
        if parallels > 0:
 | 
					 | 
				
			||||||
            with concurrent.futures.ThreadPoolExecutor(
 | 
					 | 
				
			||||||
                max_workers=parallels
 | 
					 | 
				
			||||||
            ) as executor:
 | 
					 | 
				
			||||||
                yield executor.submit
 | 
					 | 
				
			||||||
        else:
 | 
					 | 
				
			||||||
            yield lambda func, arg: func(arg)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    with _optional_parallelize() as executor:
 | 
					 | 
				
			||||||
        futures = []
 | 
					        futures = []
 | 
				
			||||||
        for dependency in packages:
 | 
					        for dependency in packages:
 | 
				
			||||||
            if dependency not in installed:
 | 
					            if dependency not in installed:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user