diff --git a/pyproject.toml b/pyproject.toml index 6e995a85d..1b47bb366 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,7 +93,7 @@ build-backend = "poetry.core.masonry.api" [tool.ruff] target-version = "py39" lint.isort.split-on-trailing-comma = false -lint.select = ["B", "D", "E", "F", "I", "SIM", "W", "RUF"] +lint.select = ["B", "D", "E", "F", "I", "SIM", "W", "RUF", "FURB"] lint.ignore = ["B008", "D205", "E501", "F403", "SIM115", "RUF006", "RUF012"] lint.pydocstyle.convention = "google" diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 88260fe45..a83843eeb 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -495,7 +495,7 @@ def initialize_requirements_txt(): try: other_requirements_exist = False with open(fp, "r", encoding=encoding) as f: - for req in f.readlines(): + for req in f: # Check if we have a package name that is reflex if re.match(r"^reflex[^a-zA-Z0-9]", req): console.debug(f"{fp} already has reflex as dependency.") diff --git a/reflex/utils/pyi_generator.py b/reflex/utils/pyi_generator.py index 9b2cbe722..5e73e4dce 100644 --- a/reflex/utils/pyi_generator.py +++ b/reflex/utils/pyi_generator.py @@ -24,7 +24,7 @@ from reflex.vars.base import Var logger = logging.getLogger("pyi_generator") -PWD = Path(".").resolve() +PWD = Path.cwd() EXCLUDED_FILES = [ "app.py", diff --git a/tests/units/conftest.py b/tests/units/conftest.py index 2f619a941..fb6229aca 100644 --- a/tests/units/conftest.py +++ b/tests/units/conftest.py @@ -206,7 +206,7 @@ class chdir(contextlib.AbstractContextManager): def __enter__(self): """Save current directory and perform chdir.""" - self._old_cwd.append(Path(".").resolve()) + self._old_cwd.append(Path.cwd()) os.chdir(self.path) def __exit__(self, *excinfo): diff --git a/tests/units/utils/test_utils.py b/tests/units/utils/test_utils.py index dd1a3b3ef..20bad4146 100644 --- a/tests/units/utils/test_utils.py +++ b/tests/units/utils/test_utils.py @@ -298,7 +298,7 @@ def tmp_working_dir(tmp_path): Yields: subdirectory of tmp_path which is now the current working directory. """ - old_pwd = Path(".").resolve() + old_pwd = Path.cwd() working_dir = tmp_path / "working_dir" working_dir.mkdir() os.chdir(working_dir)