From 4538857ce38ea6d0db21720097c1ef98c69165d3 Mon Sep 17 00:00:00 2001 From: Jarian Cottingham Date: Sun, 5 Jul 2026 06:47:32 +0000 Subject: [PATCH] feat: prepare package for PyPI publishing - Fix author metadata (name, email, URLs) - Add LICENSE file (MIT) - Add MANIFEST.in for proper sdist packaging - Add PyPI publish workflow (.gitea/workflows/publish.yml) - Add keywords for discoverability - Align python_requires to >=3.10 across setup.py and pyproject.toml --- .gitea/workflows/publish.yml | 38 ++++++++++++++++++++++++++++++++++++ LICENSE | 21 ++++++++++++++++++++ MANIFEST.in | 10 ++++++++++ pyproject.toml | 8 +++++--- setup.py | 17 +++++++++------- 5 files changed, 84 insertions(+), 10 deletions(-) create mode 100644 .gitea/workflows/publish.yml create mode 100644 LICENSE create mode 100644 MANIFEST.in diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml new file mode 100644 index 0000000..ee4b588 --- /dev/null +++ b/.gitea/workflows/publish.yml @@ -0,0 +1,38 @@ +name: Publish to PyPI + +on: + release: + types: [published] + workflow_dispatch: + +env: + GITEA_URL: https://git.example.com + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Clone repo + run: | + rm -rf $GITHUB_WORKSPACE/* + git clone --depth 1 $GITEA_URL/$GITHUB_REPOSITORY $GITHUB_WORKSPACE + git -C $GITHUB_WORKSPACE checkout $GITHUB_SHA 2>/dev/null || true + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install build tools + run: | + python -m pip install --upgrade pip + pip install build twine + + - name: Build package + run: python -m build + + - name: Publish to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: twine upload dist/* diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7c6c6d6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 jarianc + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..f808f5d --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,10 @@ +include README.md +include LICENSE +include pyproject.toml +include requirements.txt +recursive-include youtube_cli *.py +recursive-include youtube_tui *.py +recursive-include tests *.py +global-exclude __pycache__ +global-exclude *.py[cod] +global-exclude .venv diff --git a/pyproject.toml b/pyproject.toml index b5c3506..1576330 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ description = "A command-line interface for browsing and downloading YouTube vid readme = "README.md" requires-python = ">=3.10" authors = [ - {name = "Your Name", email = "your.email@example.com"}, + {name = "jarianc", email = "user@example.com"}, ] license = {text = "MIT"} classifiers = [ @@ -43,8 +43,10 @@ youtube-cli = "youtube_cli.main:main" youtube-tui = "youtube_tui.__main__:main" [project.urls] -Homepage = "https://github.com/yourusername/youtube-cli" -Issues = "https://github.com/yourusername/youtube-cli/issues" +Homepage = "https://git.example.com/jarianc/youtube-cli" +Issues = "https://git.example.com/jarianc/youtube-cli/issues" +Documentation = "https://git.example.com/jarianc/youtube-cli" +Source = "https://git.example.com/jarianc/youtube-cli" [project.optional-dependencies] dev = [ diff --git a/setup.py b/setup.py index 795d16d..d135ca3 100644 --- a/setup.py +++ b/setup.py @@ -6,12 +6,18 @@ with open("README.md", "r", encoding="utf-8") as fh: setup( name="youtube-cli", version="0.1.0", - author="Your Name", - author_email="your.email@example.com", + author="jarianc", + author_email="user@example.com", description="A command-line interface for browsing and downloading YouTube videos", + keywords="youtube, cli, download, video, yt-dlp, tui, terminal", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/yourusername/youtube-cli", + url="https://git.example.com/jarianc/youtube-cli", + project_urls={ + "Documentation": "https://git.example.com/jarianc/youtube-cli", + "Issue Tracker": "https://git.example.com/jarianc/youtube-cli/issues", + "Source": "https://git.example.com/jarianc/youtube-cli", + }, packages=find_packages(), classifiers=[ "Programming Language :: Python :: 3", @@ -26,16 +32,13 @@ setup( "Operating System :: MacOS", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Topic :: Multimedia :: Video", "Topic :: Utilities", ], - python_requires=">=3.7", + python_requires=">=3.10", install_requires=[ "yt-dlp", "rich>=13.0.0",