From baa5c9949952fbd99565737a4e99941a9df47437 Mon Sep 17 00:00:00 2001 From: Janne Snabb Date: Mon, 20 Apr 2026 00:13:40 +0300 Subject: [PATCH 1/3] Add pyproject.toml --- pyproject.toml | 33 +++++++++++++++++++++++++++++++++ requirements.txt | 1 - 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..82f7c65 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,33 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "ccastplayer" +version = "1.0.0" +dependencies = ["PyChromecast"] +requires-python = ">=3.9" +authors = [ + {name = "Janne Snabb"}, +] +description = "CLI tool for streaming video file to Chromecast" +readme = "README.md" +license = "MIT" +license-files = ["LICENSE"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python :: 3", + "Environment :: Console", + "Topic :: Multimedia :: Video :: Display" +] + +[project.urls] +Homepage = "https://github.com/snabb/ccastplayer/" +Repository = "https://github.com/snabb/ccastplayer.git" + +[project.scripts] +ccastplayer = "ccastplayer:main" + +[tool.hatch.build.targets.wheel] +sources = ["."] +include = ["ccastplayer.py"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index b7a0fa1..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -PyChromecast From 3b73e33753d09b36b5b52c06e76b5061881db748 Mon Sep 17 00:00:00 2001 From: Janne Snabb Date: Mon, 20 Apr 2026 00:33:32 +0300 Subject: [PATCH 2/3] Update README install instructions --- README.md | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 360017a..03ad846 100644 --- a/README.md +++ b/README.md @@ -22,37 +22,54 @@ Subtitles can be supplied using a separate VTT file. By default the first Chromecast device discovered on the local network is used. -## Setup +## Installation -Install the dependency with: +Install from PyPI with `pip`: +```sh +pip install ccastplayer ``` -pip install -r requirements.txt + +Install from PyPI with `pipx`: +```sh +pipx install ccastplayer ``` -Example usage with a local video file: +Install from PyPI with `uv`: +```sh +uv tool install ccastplayer ``` -ccastplayer.py myvideo.mp4 + +Install directly from the GitHub repository: +```sh +pip install "ccastplayer @ git+https://github.com/snabb/ccastplayer.git" +pipx install git+https://github.com/snabb/ccastplayer.git +uv tool install git+https://github.com/snabb/ccastplayer.git ``` -Example usage with a local video and subtitles file: +Example usage with a local video file: +```sh +ccastplayer myvideo.mp4 ``` -ccastplayer.py myvideo.mp4 --subs mysubs.vtt + +Example usage with a local video and subtitles file: +```sh +ccastplayer myvideo.mp4 --subs mysubs.vtt ``` Example usage with a remote video file: -``` -ccastplayer.py http://example.org/videos/myvideo.mp4 +```sh +ccastplayer http://example.org/videos/myvideo.mp4 ``` If the script is unable to auto-discover the device in your local network, you can supply the IP address with the `--chromecast-ip` option: -``` -ccastplayer.py --chromecast-ip 192.0.2.123 example.mkv +```sh +ccastplayer --chromecast-ip 192.0.2.123 example.mkv ``` More help on command line options: -``` -ccastplayer.py --help +```sh +ccastplayer --help ``` Run the test suite with: From cac5064913b680fcb988378ff707492819ce5e54 Mon Sep 17 00:00:00 2001 From: Janne Snabb Date: Mon, 20 Apr 2026 00:37:34 +0300 Subject: [PATCH 3/3] Add GitHub workflow for tests --- .github/workflows/ci.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..20fa474 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: + - "3.9" + - "3.10" + - "3.11" + - "3.12" + - "3.13" + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install package + run: python -m pip install . + + - name: Run unit tests + run: python -m unittest discover -s tests -v + + - name: Smoke test console entry point + run: ccastplayer --help