mirror of
				https://github.com/enpaul/tox-poetry-installer.git
				synced 2025-11-04 07:46:06 +00:00 
			
		
		
		
	@@ -268,21 +268,16 @@ def tox_testenv_install_deps(venv: ToxVirtualEnv, action: ToxAction):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        poetry = PoetryFactory().create_poetry(venv.envconfig.config.toxinidir)
 | 
					        poetry = PoetryFactory().create_poetry(venv.envconfig.config.toxinidir)
 | 
				
			||||||
    except RuntimeError as err:
 | 
					    except RuntimeError:
 | 
				
			||||||
        # Support running the plugin when the current tox project does not use Poetry for its
 | 
					        # Support running the plugin when the current tox project does not use Poetry for its
 | 
				
			||||||
        # environment/dependency management.
 | 
					        # environment/dependency management.
 | 
				
			||||||
        #
 | 
					        #
 | 
				
			||||||
        # ``RuntimeError`` is dangerous to blindly catch because it can be (and in Poetry's case,
 | 
					        # ``RuntimeError`` is dangerous to blindly catch because it can be (and in Poetry's case,
 | 
				
			||||||
        # is) raised in many different places for different purposes. This check of the error
 | 
					        # is) raised in many different places for different purposes.
 | 
				
			||||||
        # content, while crude and potentially fragile, will hopefully prevent ``RuntimeError``s
 | 
					 | 
				
			||||||
        # not caused by this specific condition to be re-raised as genuine errors. This may need
 | 
					 | 
				
			||||||
        # tuning in the future.
 | 
					 | 
				
			||||||
        if "[tool.poetry] section not found" in str(err):
 | 
					 | 
				
			||||||
        reporter.verbosity1(
 | 
					        reporter.verbosity1(
 | 
				
			||||||
            f"{_REPORTER_PREFIX} project does not use Poetry for env management, skipping installation of locked dependencies"
 | 
					            f"{_REPORTER_PREFIX} project does not use Poetry for env management, skipping installation of locked dependencies"
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
        raise err
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    reporter.verbosity1(
 | 
					    reporter.verbosity1(
 | 
				
			||||||
        f"{_REPORTER_PREFIX} loaded project pyproject.toml from {poetry.file}"
 | 
					        f"{_REPORTER_PREFIX} loaded project pyproject.toml from {poetry.file}"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user