Skip to content

Commit 028a11a

Browse files
committed
build: added logic to publish to PyPI
1 parent d331fb2 commit 028a11a

File tree

5 files changed

+168
-22
lines changed

5 files changed

+168
-22
lines changed

.github/workflows/publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
push:
7+
branches: ["main"]
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
id-token: write # REQUIRED: for trusted publishing
14+
contents: read # REQUIRED: to checkout the repository
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: "3.11"
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build twine
28+
29+
- name: Build package
30+
run: python -m build
31+
32+
- name: Publish to PyPI
33+
uses: pypa/gh-action-pypi-publish@release/v1
34+
# No need for user/password with trusted publishing
35+
# The action will use OIDC tokens automatically

.github/workflows/python-package.yml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,35 @@ name: Python package
55

66
on:
77
push:
8-
branches: [ "main" ]
8+
branches: ["main"]
99
pull_request:
10-
branches: [ "main" ]
10+
branches: ["main"]
1111

1212
jobs:
1313
build:
14-
1514
runs-on: ubuntu-latest
1615
strategy:
1716
fail-fast: false
1817
matrix:
1918
python-version: ["3.9", "3.10", "3.11"]
2019

2120
steps:
22-
- uses: actions/checkout@v4
23-
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v3
25-
with:
26-
python-version: ${{ matrix.python-version }}
27-
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip
30-
python -m pip install flake8 pytest
31-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
32-
- name: Lint with flake8
33-
run: |
34-
# stop the build if there are Python syntax errors or undefined names
35-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38-
- name: Test with pytest
39-
run: |
40-
pytest
21+
- uses: actions/checkout@v4
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install flake8 pytest
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
- name: Lint with flake8
32+
run: |
33+
# stop the build if there are Python syntax errors or undefined names
34+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37+
- name: Test with pytest
38+
run: |
39+
pytest

MANIFEST.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
include README.md
2+
include CHANGELOG.md
3+
include LICENSE
4+
include requirements.txt
5+
recursive-include plex2mix *.py
6+
recursive-exclude * __pycache__
7+
recursive-exclude * *.py[co]

plex2mix/init.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""
2+
Plex2Mix - Plex music downloader for DJs
3+
4+
🎵 Download playlists locally with deduplication, export to M3U8/JSON/iTunes
5+
formats, and manage your music library efficiently.
6+
7+
Copyright (C) 2025 anatosun
8+
9+
This program is free software: you can redistribute it and/or modify
10+
it under the terms of the GNU General Public License as published by
11+
the Free Software Foundation, either version 3 of the License, or
12+
(at your option) any later version.
13+
14+
This program is distributed in the hope that it will be useful,
15+
but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
GNU General Public License for more details.
18+
19+
You should have received a copy of the GNU General Public License
20+
along with this program. If not, see <https://www.gnu.org/licenses/>.
21+
"""
22+
23+
try:
24+
from ._version import version as __version__
25+
except ImportError:
26+
__version__ = "unknown"
27+
28+
__author__ = "anatosun"
29+
__email__ = "z4jyol8l@duck.com"
30+
__description__ = "Plex music downloader for DJs"
31+
__license__ = "GPL-3.0-or-later"
32+
33+
# Make main CLI function available at package level
34+
from .main import cli
35+
36+
__all__ = ["cli", "__version__"]

pyproject.toml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[build-system]
2+
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "plex2mix"
7+
authors = [
8+
{name = "anatosun", email = "z4jyol8l@duck.com"},
9+
]
10+
description = "🎵 Plex2Mix - A powerful Plex music downloader designed for DJs and music enthusiasts. Download playlists locally with track deduplication, export to multiple formats (M3U8, JSON, iTunes XML), and manage your music library with an intuitive interactive CLI. Perfect for importing into Rekordbox, Traktor, Mixxx, or iTunes. "
11+
readme = "README.md"
12+
license = {text = "GPL-3.0-or-later"}
13+
requires-python = ">=3.8"
14+
classifiers = [
15+
"Development Status :: 4 - Beta",
16+
"Intended Audience :: End Users/Desktop",
17+
"License :: OSI Approved :: MIT License",
18+
"Operating System :: OS Independent",
19+
"Programming Language :: Python :: 3",
20+
"Programming Language :: Python :: 3.8",
21+
"Programming Language :: Python :: 3.9",
22+
"Programming Language :: Python :: 3.10",
23+
"Programming Language :: Python :: 3.11",
24+
"Programming Language :: Python :: 3.12",
25+
"Topic :: Multimedia :: Sound/Audio",
26+
"Topic :: System :: Archiving",
27+
]
28+
keywords = ["plex", "music", "dj", "downloader", "playlist", "m3u8", "itunes"]
29+
dependencies = [
30+
"click>=8.0",
31+
"plexapi>=4.9",
32+
"pyyaml>=6.0",
33+
]
34+
dynamic = ["version"]
35+
36+
[project.optional-dependencies]
37+
dev = [
38+
"pytest>=7.0",
39+
"pytest-cov>=4.0",
40+
"black>=22.0",
41+
"flake8>=5.0",
42+
"mypy>=1.0",
43+
"build>=0.8",
44+
"twine>=4.0",
45+
]
46+
47+
[project.urls]
48+
Homepage = "https://github.com/anatosun/plex2mix"
49+
Repository = "https://github.com/anatosun/plex2mix"
50+
Documentation = "https://github.com/anatosun/plex2mix#readme"
51+
"Bug Reports" = "https://github.com/anatosun/plex2mix/issues"
52+
53+
[project.scripts]
54+
plex2mix = "plex2mix.main:cli"
55+
56+
[tool.setuptools]
57+
packages = ["plex2mix"]
58+
59+
[tool.setuptools_scm]
60+
write_to = "plex2mix/_version.py"
61+
62+
[tool.black]
63+
line-length = 88
64+
target-version = ['py38']
65+
66+
[tool.mypy]
67+
python_version = "3.8"
68+
warn_return_any = true
69+
warn_unused_configs = true

0 commit comments

Comments
 (0)