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

Add --version commandline flag #970

Merged
merged 8 commits into from Jan 28, 2021
Merged

Add --version commandline flag #970

merged 8 commits into from Jan 28, 2021

Conversation

WampyCakes
Copy link
Contributor

@WampyCakes WampyCakes commented Jan 27, 2021

Motivation

Aids helping Manim errors by providing version command. Will be needed for the Manim Showcase as well (#934). This command should be added before the next release as --version should be available in all Manim versions, but won't be because it is too late.

Overview / Explanation for Changes

Reads the version from metadata from pyproject.toml (explained here). Adds a --version command to print the version. Adds it to --help and the list of CLI flags in the documentation. Added a test to confirm the command continues to provide the correct version.

Oneline Summary of Changes

- Added a --version CLI flag (:pr:`PR NUMBER HERE`)

Additional Comments

In the future, commit hashes or some other such thing should be included as well (#541)

Acknowledgements

Reviewer Checklist

  • Newly added functions/classes are either private or have a docstring
  • Newly added functions/classes have tests added and (optional) examples in the docs
  • Newly added documentation builds, looks correctly formatted, and adds no additional build warnings
  • The oneline summary has been included in the wiki

Copy link
Contributor

@leotrs leotrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Can you please take care of the tests?

manim/_config/main_utils.py Outdated Show resolved Hide resolved
Copy link
Member

@behackl behackl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me, have not tried it locally yet. I just have one minor suggestion.

Thanks for picking is up, adding a version command was overdue. :-)

manim/_config/main_utils.py Outdated Show resolved Hide resolved
WampyCakes and others added 2 commits January 27, 2021 14:42
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
@WampyCakes
Copy link
Contributor Author

WampyCakes commented Jan 27, 2021

Can you please take care of the tests?

@leotrs How can I fix the dependency errors in the checks?

@behackl
Copy link
Member

behackl commented Jan 27, 2021

Can you please take care of the tests?

@leotrs How can I fix the dependency errors in the checks?

You'll need to run poetry lock, I think.

@jsonvillanueva
Copy link
Member

Can you please take care of the tests?

@leotrs How can I fix the dependency errors in the checks?

You'll need to run poetry lock, I think.

I believe you need to run poetry update as the error logs are saying:
Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.

@behackl
Copy link
Member

behackl commented Jan 27, 2021

Hmm, this is weird:

(manim-jRHFv4qq-py3.7) behackl@home:~/code/manim$ manim --version
Manim Community Edition v0.1.1

I am running this from the current version of this branch, the version should be v0.2.0. Any idea what is happening here?

@WampyCakes
Copy link
Contributor Author

@behackl No, that's rather odd. It shows 0.2.0 for me.

Copy link
Member

@jsonvillanueva jsonvillanueva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this is weird:

(manim-jRHFv4qq-py3.7) behackl@home:~/code/manim$ manim --version
Manim Community Edition v0.1.1

I am running this from the current version of this branch, the version should be v0.2.0. Any idea what is happening here?

(manim) C:\Users\a\Documents\repos\ManimCommunity\manim\example_scenes>manim --version
Manim Community Edition v0.2.0

Works fine for me. You might have multiple conflicting installs?

@behackl
Copy link
Member

behackl commented Jan 27, 2021

$ python
Python 3.7.5 (default, Nov  7 2019, 10:50:52) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import manim
>>> manim.__version__
'0.1.1'

This is within the virtual environment provided by poetry, there are no other installations of manim present in there.

@jsonvillanueva
Copy link
Member

$ python
Python 3.7.5 (default, Nov  7 2019, 10:50:52) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import manim
>>> manim.__version__
'0.1.1'

This is within the virtual environment provided by poetry, there are no other installations of manim present in there.

I feel like this has to do with you using poetry lock earlier, but I'm unsure. We can continue debugging on discord since that's quicker, but this looks good to me atm.

Running black locally didn't catch this for some reason..
@WampyCakes
Copy link
Contributor Author

Update for records sake: The issue described above was a local issue. The command works. Added a test_version pytest, all checks passed. Good to merge?

manim/_config/main_utils.py Outdated Show resolved Hide resolved
docs/source/tutorials/configuration.rst Outdated Show resolved Hide resolved
@behackl behackl merged commit 8fce5a7 into ManimCommunity:master Jan 28, 2021
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.

None yet

5 participants