Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect ManimGL version #102

Merged
merged 41 commits into from
Dec 26, 2024
Merged

Detect ManimGL version #102

merged 41 commits into from
Dec 26, 2024

Conversation

Splines
Copy link
Member

@Splines Splines commented Dec 19, 2024

Closes #97

We detect the ManimGL version that the user is using. While in theory this is just issuing the command manimgl --version, there is soo much more that we have to do to ensure a nice user-flow and to handle all kinds of errors and particular situations. See the code for more details. What matters for the caller is that we can now do this (don't forget the await ⚠):

if (!await hasUserMinimalManimVersion("1.7.2")) {
     return;
}

in order to require specific versions for some features, e.g. reloading or --autoreload.

This method also takes care of showing respective warning messages etc. As a bonus feature, we call the GitHub API and if it returns something valid back, we show the user what the latest release version of Manim is.

Users can also switch ManimGL versions without having to reload VSCode. You just have to use the command Redetect Manim version. I've also removed the check manim version command from the walkthrough and instead use that new Redetect Manim version command there.

Refactoring

Since we needed some terminal-related methods also in a new file, I moved those methods from the Manim Shell to a new Terminal utility class.

@Splines Splines self-assigned this Dec 19, 2024
@Splines
Copy link
Member Author

Splines commented Dec 19, 2024

@bhoov Feel free to already play a bit around with these changes and check if many different scenarios work for you (e.g. also clicking away from a pop-up and trying to outsmart the logic I've written).

With regards to the code, I might do some more refactoring (of my newly written code) before I turn the draft PR to a regular one that can be reviewed.

Base automatically changed from feature/reload-preview to main December 25, 2024 22:56
@Splines Splines marked this pull request as ready for review December 25, 2024 23:36
@Splines Splines requested a review from bhoov December 25, 2024 23:40
@Splines
Copy link
Member Author

Splines commented Dec 26, 2024

As I plan to refactor some code and lint it, I'm merging this now. Feel free to open issues if something is not working with it or if you don't like how I realized the version detection.

@Splines Splines merged commit 2279256 into main Dec 26, 2024
@Splines Splines deleted the feature/manimgl-version branch December 26, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detect Manim version
1 participant