Skip to content

Commit

Permalink
Merge pull request #106 from dmunozv04/publish-pypi
Browse files Browse the repository at this point in the history
Publish on pypi
  • Loading branch information
dmunozv04 authored Nov 29, 2023
2 parents b1f1bd1 + 7a0a264 commit 8c7c2cc
Show file tree
Hide file tree
Showing 22 changed files with 87 additions and 61 deletions.
File renamed without changes.
37 changes: 37 additions & 0 deletions .github/workflows/release_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
jobs:
deploy:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@

FROM python:3.11-alpine

ENV PIP_NO_CACHE_DIR=off iSPBTV_docker=True TERM=xterm-256color COLORTERM=truecolor
ENV PIP_NO_CACHE_DIR=off iSPBTV_docker=True iSPBTV_data_dir=data TERM=xterm-256color COLORTERM=truecolor

COPY requirements.txt .

RUN pip install --upgrade pip wheel && \
pip install -r requirements.txt

COPY requirements.txt .

WORKDIR /app

COPY . .
RUN python -m compileall

COPY src .

ENTRYPOINT ["python3", "-u", "main.py"]
7 changes: 0 additions & 7 deletions main-macos.py

This file was deleted.

47 changes: 0 additions & 47 deletions main-macos.spec

This file was deleted.

30 changes: 30 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[project]
name = "iSponsorBlockTV"
version = "2.0.3"
authors = [
{"name" = "dmunozv04"}
]
description = "SponsorBlock client for all YouTube TV clients"
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Topic :: Home Automation"
]
dynamic = ["dependencies"]

[tool.hatch.metadata.hooks.requirements_txt]
files = ["requirements.txt"]

[project.urls]
"Homepage" = "https://github.com/dmunozv04/iSponsorBlockTV"
"Bug Tracker" = "https://github.com/dmunozv04/iSponsorBlockTV/issues"

[project.scripts]
"iSponsorBlockTV" = "iSponsorBlockTV.__main__:main"

[build-system]
requires = ["hatchling", "hatch-requirements-txt"]
build-backend = "hatchling.build"
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
aiohttp==3.9.0
appdirs==1.4.4
argparse==1.4.0
async-cache==1.1.1
pyytlounge==1.6.3
rich==13.6.0
ssdp==1.3.0
textual==0.40.0
textual-slider==0.1.1
xmltodict==0.13.0

xmltodict==0.13.0
File renamed without changes.
8 changes: 8 additions & 0 deletions src/iSponsorBlockTV/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from . import helpers

def main():
helpers.app_start()


if __name__ == "__main__":
main()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import sys
import time

from appdirs import user_data_dir

from . import config_setup, main, setup_wizard


Expand Down Expand Up @@ -102,8 +104,10 @@ def __eq__(self, other):


def app_start():
#If env has a data dir use that, otherwise use the default
default_data_dir = os.getenv("iSPBTV_data_dir") or user_data_dir("iSponsorBlockTV", "dmunozv04")
parser = argparse.ArgumentParser(description="iSponsorblockTV")
parser.add_argument("--data-dir", "-d", default="data", help="data directory")
parser.add_argument("--data-dir", "-d", default=default_data_dir, help="data directory")
parser.add_argument("--setup", "-s", action="store_true", help="setup the program graphically")
parser.add_argument("--setup-cli", "-sc", action="store_true", help="setup the program in the command line")
parser.add_argument("--debug", action="store_true", help="debug mode")
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion iSponsorBlockTV/main.py → src/iSponsorBlockTV/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,4 @@ def main(config, debug):
print("Keyboard interrupt detected, cancelling tasks and exiting...")
loop.run_until_complete(finish(devices))
finally:
loop.run_until_complete(web_session.close())
loop.run_until_complete(web_session.close())
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 8c7c2cc

Please sign in to comment.