From fc6566d8829e1180c9054d390fc910b6275f0a80 Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Tue, 20 Jun 2023 13:29:51 +0200 Subject: [PATCH] Use relative path --- bump_pydantic/main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bump_pydantic/main.py b/bump_pydantic/main.py index 3834e18..8a20145 100644 --- a/bump_pydantic/main.py +++ b/bump_pydantic/main.py @@ -36,12 +36,11 @@ def main( diff: bool = Option(False, help="Show diff instead of applying changes."), version: bool = Option(None, "--version", callback=version_callback, is_eager=True), ): - cwd = os.getcwd() - files_str = [path.absolute() for path in package.glob("**/*.py")] - files = [str(file.relative_to(cwd)) for file in files_str] + files_str = list(package.glob("**/*.py")) + files = [str(file.relative_to(".")) for file in files_str] providers = {ScopeProvider, PositionProvider, FullyQualifiedNameProvider} - metadata_manager = FullRepoManager(cwd, files, providers=providers) # type: ignore[arg-type] + metadata_manager = FullRepoManager(".", files, providers=providers) # type: ignore[arg-type] metadata_manager.resolve_cache() scratch: Dict[str, Any] = {}