Repository: ManimCommunity/manim
File: manim/cli/render/commands.py (Python)

Code before:
        except ModuleNotFoundError:
            console.print(
                "Dependencies for the WebGL render are missing. Run "
                "pip install manim[webgl_renderer] to install them."
            )
            console.print_exception()
    else:
        for SceneClass in scene_classes_from_file(file):
            try:
                scene = SceneClass()
                scene.render()
            except Exception:
                console.print_exception()

    if nov or args["notify_outdated_version"]:
        manim = requests.get("https://pypi.org/pypi/manim/json")
        releases = manim.json()["releases"].keys()
        latest = max(releases)

        if latest != __version__:
            console.print(
                "[yellow]WARNING: You are running on an outdated version of manim[/yellow]"
            )
            console.print(f"Installed version: [red]v{__version__}[/red]")
            console.print(f"Latest version: [green]v{latest}[/green]")
            console.print(
                "[yellow]To disable this warning, go to config and set [red]notify_outdated_version[/red] to [/yellow]False"
            )
            console.print(
                "https://docs.manim.community/en/latest/tutorials/configuration.html"
            )

    return args


Review comment (suggestion):
I think that this is a good feature until right here. This print (along with the one below it with the link) are longer and more obtrusive than just always displaying if manim is outdated. If it were me receiving the warning, I'd probably keep it around just so that I don't forget I'm not on the most recent version, but because of the long message, I'd probably turn it off.

Code after:
            console.print(
                "Dependencies for the WebGL render are missing. Run "
                "pip install manim[webgl_renderer] to install them."
            )
            console.print_exception()
    else:
        for SceneClass in scene_classes_from_file(file):
            try:
                scene = SceneClass()
                scene.render()
            except Exception:
                console.print_exception()

    if config.notify_outdated_version:
        manim_info_url = "https://pypi.org/pypi/manim/json"
        warn_prompt = "Cannot check if latest release of manim is installed"
        req_info = {}

        try:
            req_info = requests.get(manim_info_url)
            req_info.raise_for_status()
        except requests.exceptions.HTTPError:
            logger.debug(f"HTTP Error: {warn_prompt}")
        except requests.exceptions.ConnectionError:
            logger.debug(f"Connection Error: {warn_prompt}")
        except requests.exceptions.Timeout:
            logger.debug(f"Timed Out: {warn_prompt}")
        except Exception:
            logger.debug(f"Something went wrong: {warn_prompt}")

        try:
            stable = req_info.json()["info"]["version"]

            if stable != __version__:
                console.print(
                    f"You are using manim version [red]v{__version__}[/red], but version [green]v{stable}[/green] is available."
                )
                console.print(
                    "You should consider upgrading via [yellow]pip install -U manim[/yellow]"
                )
        except json.JSONDecodeError:
            logger.debug(warn_prompt)
            logger.debug(f"Error decoding JSON from {manim_info_url}")

    return args