diff --git a/conftest.py b/conftest.py index 247e5eb92d538a..0b5daf574f0bc9 100644 --- a/conftest.py +++ b/conftest.py @@ -26,7 +26,7 @@ # allow having multiple repository checkouts and not needing to remember to rerun -# 'pip install -e .[dev]' when switching between checkouts and running tests. +# `pip install -e '.[dev]'` when switching between checkouts and running tests. git_repo_path = abspath(join(dirname(__file__), "src")) sys.path.insert(1, git_repo_path) diff --git a/examples/flax/conftest.py b/examples/flax/conftest.py index 131c6af92c44cc..4cf2e46ef07393 100644 --- a/examples/flax/conftest.py +++ b/examples/flax/conftest.py @@ -21,7 +21,7 @@ # allow having multiple repository checkouts and not needing to remember to rerun -# 'pip install -e .[dev]' when switching between checkouts and running tests. +# `pip install -e '.[dev]'` when switching between checkouts and running tests. git_repo_path = abspath(join(dirname(dirname(dirname(__file__))), "src")) sys.path.insert(1, git_repo_path) diff --git a/examples/pytorch/conftest.py b/examples/pytorch/conftest.py index e85e5afb0200bd..70b4d4c12bc488 100644 --- a/examples/pytorch/conftest.py +++ b/examples/pytorch/conftest.py @@ -21,7 +21,7 @@ # allow having multiple repository checkouts and not needing to remember to rerun -# 'pip install -e .[dev]' when switching between checkouts and running tests. +# `pip install -e '.[dev]'` when switching between checkouts and running tests. git_repo_path = abspath(join(dirname(dirname(dirname(__file__))), "src")) sys.path.insert(1, git_repo_path) diff --git a/src/transformers/utils/versions.py b/src/transformers/utils/versions.py index 945a3977ce62a9..85dabec8b65902 100644 --- a/src/transformers/utils/versions.py +++ b/src/transformers/utils/versions.py @@ -113,5 +113,5 @@ def require_version(requirement: str, hint: Optional[str] = None) -> None: def require_version_core(requirement): """require_version wrapper which emits a core-specific hint on failure""" - hint = "Try: pip install transformers -U or pip install -e '.[dev]' if you're working with git main" + hint = "Try: `pip install transformers -U` or `pip install -e '.[dev]'` if you're working with git main" return require_version(requirement, hint) diff --git a/tests/utils/test_versions_utils.py b/tests/utils/test_versions_utils.py index 14839400c2cdef..5192fd2d5cf9d0 100644 --- a/tests/utils/test_versions_utils.py +++ b/tests/utils/test_versions_utils.py @@ -68,7 +68,7 @@ def test_core(self): require_version_core(req) except importlib.metadata.PackageNotFoundError as e: self.assertIn(f"The '{req}' distribution was not found and is required by this application", str(e)) - self.assertIn("Try: pip install transformers -U", str(e)) + self.assertIn("Try: `pip install transformers -U`", str(e)) # bogus requirements formats: # 1. whole thing diff --git a/utils/check_repo.py b/utils/check_repo.py index ea47aea313b03f..aa448f32e62d8f 100644 --- a/utils/check_repo.py +++ b/utils/check_repo.py @@ -358,12 +358,12 @@ def check_missing_backends(): missing = ", ".join(missing_backends) if os.getenv("TRANSFORMERS_IS_CI", "").upper() in ENV_VARS_TRUE_VALUES: raise Exception( - "Full repo consistency checks require all backends to be installed (with `pip install -e .[dev]` in the " + "Full repo consistency checks require all backends to be installed (with `pip install -e '.[dev]'` in the " f"Transformers repo, the following are missing: {missing}." ) else: warnings.warn( - "Full repo consistency checks require all backends to be installed (with `pip install -e .[dev]` in the " + "Full repo consistency checks require all backends to be installed (with `pip install -e '.[dev]'` in the " f"Transformers repo, the following are missing: {missing}. While it's probably fine as long as you " "didn't make any change in one of those backends modeling files, you should probably execute the " "command above to be on the safe side."