chano 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
chano-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,15 @@
1
+ Metadata-Version: 2.4
2
+ Name: chano
3
+ Version: 0.1.0
4
+ Summary: A tiny Python library that never gives you up.
5
+ Author: Scott Trinh
6
+ Project-URL: Repository, https://github.com/scotttrinh/chano
7
+ Project-URL: Issues, https://github.com/scotttrinh/chano/issues
8
+ Keywords: rickroll,youtube,fun
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3 :: Only
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown
14
+
15
+ ![Rickroll GIF](https://raw.githubusercontent.com/scotttrinh/chano/main/assets/rickroll.gif)
chano-0.1.0/README.md ADDED
@@ -0,0 +1 @@
1
+ ![Rickroll GIF](https://raw.githubusercontent.com/scotttrinh/chano/main/assets/rickroll.gif)
@@ -0,0 +1,33 @@
1
+ [build-system]
2
+ requires = ["setuptools>=69"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "chano"
7
+ version = "0.1.0"
8
+ description = "A tiny Python library that never gives you up."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ authors = [
12
+ { name = "Scott Trinh" },
13
+ ]
14
+ keywords = ["rickroll", "youtube", "fun"]
15
+ classifiers = [
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3 :: Only",
18
+ "Operating System :: OS Independent",
19
+ ]
20
+ license-files = []
21
+
22
+ [project.urls]
23
+ Repository = "https://github.com/scotttrinh/chano"
24
+ Issues = "https://github.com/scotttrinh/chano/issues"
25
+
26
+ [project.scripts]
27
+ chano = "chano:main"
28
+
29
+ [tool.setuptools]
30
+ package-dir = { "" = "src" }
31
+
32
+ [tool.setuptools.packages.find]
33
+ where = ["src"]
chano-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,34 @@
1
+ """Open the canonical Rick Astley video in a browser."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import sys
6
+ import webbrowser
7
+ from types import ModuleType
8
+
9
+ VIDEO_URL = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
10
+
11
+
12
+ def play() -> bool:
13
+ """Open the video in the user's default browser."""
14
+ return webbrowser.open(VIDEO_URL, new=2, autoraise=True)
15
+
16
+
17
+ def chano() -> bool:
18
+ """Alias for :func:`play`."""
19
+ return play()
20
+
21
+
22
+ def main() -> int:
23
+ """CLI entry point."""
24
+ return 0 if chano() else 1
25
+
26
+
27
+ class _CallableModule(ModuleType):
28
+ def __call__(self) -> bool:
29
+ return chano()
30
+
31
+
32
+ sys.modules[__name__].__class__ = _CallableModule
33
+
34
+ __all__ = ["VIDEO_URL", "chano", "main", "play"]
@@ -0,0 +1,8 @@
1
+ """Run chano as a module."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from . import main
6
+
7
+
8
+ raise SystemExit(main())
@@ -0,0 +1,15 @@
1
+ Metadata-Version: 2.4
2
+ Name: chano
3
+ Version: 0.1.0
4
+ Summary: A tiny Python library that never gives you up.
5
+ Author: Scott Trinh
6
+ Project-URL: Repository, https://github.com/scotttrinh/chano
7
+ Project-URL: Issues, https://github.com/scotttrinh/chano/issues
8
+ Keywords: rickroll,youtube,fun
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3 :: Only
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown
14
+
15
+ ![Rickroll GIF](https://raw.githubusercontent.com/scotttrinh/chano/main/assets/rickroll.gif)
@@ -0,0 +1,10 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/chano/__init__.py
4
+ src/chano/__main__.py
5
+ src/chano.egg-info/PKG-INFO
6
+ src/chano.egg-info/SOURCES.txt
7
+ src/chano.egg-info/dependency_links.txt
8
+ src/chano.egg-info/entry_points.txt
9
+ src/chano.egg-info/top_level.txt
10
+ tests/test_chano.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ chano = chano:main
@@ -0,0 +1 @@
1
+ chano
@@ -0,0 +1,37 @@
1
+ from __future__ import annotations
2
+
3
+ import importlib
4
+ import unittest
5
+ from unittest.mock import patch
6
+
7
+
8
+ class ChanoTests(unittest.TestCase):
9
+ def test_function_opens_expected_video(self) -> None:
10
+ with patch("webbrowser.open", return_value=True) as open_mock:
11
+ from chano import VIDEO_URL, chano
12
+
13
+ result = chano()
14
+
15
+ self.assertTrue(result)
16
+ open_mock.assert_called_once_with(VIDEO_URL, new=2, autoraise=True)
17
+
18
+ def test_main_returns_zero_on_success(self) -> None:
19
+ with patch("webbrowser.open", return_value=True):
20
+ from chano import main
21
+
22
+ result = main()
23
+
24
+ self.assertEqual(result, 0)
25
+
26
+ def test_module_is_callable(self) -> None:
27
+ with patch("webbrowser.open", return_value=True) as open_mock:
28
+ module = importlib.import_module("chano")
29
+
30
+ result = module()
31
+
32
+ self.assertTrue(result)
33
+ open_mock.assert_called_once()
34
+
35
+
36
+ if __name__ == "__main__":
37
+ unittest.main()