-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve notebook version check script and added what_are_recipes_and_…
…how_to_use to the list of checked notebooks
- Loading branch information
Showing
5 changed files
with
965 additions
and
1,282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2,183 changes: 908 additions & 1,275 deletions
2,183
notebooks/what_are_recipes_and_how_to_use.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import unittest | ||
|
||
from tests.verify_notebook_version import try_extract_super_gradients_version_from_pip_install_command | ||
|
||
|
||
class TestVersionCheck(unittest.TestCase): | ||
def test_pip_install_no_version(self): | ||
self.assertIsNone(try_extract_super_gradients_version_from_pip_install_command("!pip install super-gradients")) | ||
|
||
def test_pip_install_major_only(self): | ||
self.assertEquals(try_extract_super_gradients_version_from_pip_install_command("!pip install super-gradients==3"), "3") | ||
|
||
def test_pip_install_major_minor(self): | ||
self.assertEquals(try_extract_super_gradients_version_from_pip_install_command("!pip install super-gradients==3.0"), "3.0") | ||
|
||
def test_pip_install_major_patch(self): | ||
self.assertEquals(try_extract_super_gradients_version_from_pip_install_command("!pip install super-gradients==3.3.1"), "3.3.1") | ||
|
||
def test_pip_install_with_extra_args(self): | ||
self.assertEquals(try_extract_super_gradients_version_from_pip_install_command("!pip install -q super-gradients==3.3.1"), "3.3.1") | ||
self.assertEquals(try_extract_super_gradients_version_from_pip_install_command("!pip install super-gradients==3.3.1 --extra-index-url=foobar"), "3.3.1") | ||
|
||
def test_pip_install_with_space(self): | ||
self.assertEquals(try_extract_super_gradients_version_from_pip_install_command("! pip install -q super-gradients==3.3.1"), "3.3.1") | ||
|
||
def test_pip_install_with_stdout_redirect(self): | ||
self.assertEquals(try_extract_super_gradients_version_from_pip_install_command("! pip install -q super-gradients==3.3.1 &> /dev/null"), "3.3.1") | ||
|
||
def test_pip_install_with_extra_packages(self): | ||
self.assertEquals(try_extract_super_gradients_version_from_pip_install_command("! pip install super-gradients==3.3.1 torch==2.0 numpy>2"), "3.3.1") | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters