From 8ab9f444b7daafc4cd8cc699dbf1ea32371f0236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alban=20F=C3=A9ron?= Date: Sun, 14 Nov 2021 18:08:22 +0100 Subject: [PATCH] Rationalizing/modernizing building stuff Metadata in `setup.cfg` rather than `pyproject.toml` as I'm a bit confused about `setuptools` support for PEP-621. Test stuff still in `setup.py`, this needs updating and I'm not satisfied with the way they are loaded/discovered. --- docs/conf.py | 12 ++++--- pyproject.toml | 3 ++ setup.cfg | 74 +++++++++++++++++++++++++++++++++++++++++++ setup.py | 61 ++++------------------------------- supysonic/__init__.py | 20 +++--------- 5 files changed, 95 insertions(+), 75 deletions(-) create mode 100644 pyproject.toml create mode 100644 setup.cfg diff --git a/docs/conf.py b/docs/conf.py index 36452cc..a28cadb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,11 +1,13 @@ +import supysonic + # -- Project information ----------------------------------------------------- -project = "Supysonic" -author = "Alban Féron" +project = supysonic.NAME +author = supysonic.AUTHOR copyright = "2013-2021, " + author -version = "0.6.3" -release = "0.6.3" +version = supysonic.VERSION +release = supysonic.VERSION # -- General configuration --------------------------------------------------- @@ -26,7 +28,7 @@ language = None html_theme = "alabaster" html_theme_options = { - "description": "A Python implementation of the Subsonic server API", + "description": supysonic.DESCRIPTION, "github_user": "spl0k", "github_repo": "supysonic", } diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3607e0f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=51.0.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..e028f07 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,74 @@ +[metadata] +name = Supysonic +version = attr: supysonic.VERSION +url = https://supysonic.readthedocs.io +download_url = https://github.com/spl0k/supysonic +author = Alban Féron +author_email = alban.feron@gmail.com +license = GNU AGPLv3 +license_files = LICENSE + +description = Python implementation of the Subsonic server API +long_description = + Supysonic is a Python implementation of the [Subsonic][] server API. + + Current supported features are: + * browsing (by folders or tags) + * streaming of various audio file formats + * transcoding + * user or random playlists + * cover art + * starred tracks/albums and ratings + * [Last.FM][lastfm] scrobbling + * Jukebox mode + + Supysonic currently targets the version 1.10.2 of the Subsonic API. For more + details, go check the [API implementation status][docs-api]. + + [subsonic]: http://www.subsonic.org/ + [lastfm]: https://www.last.fm/ + [docs-api]: https://supysonic.readthedocs.io/en/latest/api.html + +long_description_content_type = text/markdown +keywords = subsonic, music, server + +classifiers = + Development Status :: 3 - Alpha + Environment :: Console + Environment :: Web Environment + Framework :: Flask + Intended Audience :: End Users/Desktop + Intended Audience :: System Administrators + License :: OSI Approved :: GNU Affero General Public License v3 + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Topic :: Multimedia :: Sound/Audio + +[options] +python_requires = >=3.5,<3.10 +install_requires = + click + flask >=0.11 + pony >=0.7.6 + Pillow + requests >=1.0.0 + mediafile + watchdog >=0.8.0 + zipstream-ng >=1.1.0, <2.0.0 + +packages = find: +include_package_data = true +zip_safe = false + +[options.packages.find] +include = supysonic* + +[options.entry_points] +console_scripts = + supysonic-cli = supysonic.cli:main + supysonic-daemon = supysonic.daemon:main + supysonic-server = supysonic.server:mai diff --git a/setup.py b/setup.py index 2bec624..c043717 100644 --- a/setup.py +++ b/setup.py @@ -1,64 +1,15 @@ # This file is part of Supysonic. # Supysonic is a Python implementation of the Subsonic server API. # -# Copyright (C) 2013-2019 Alban 'spl0k' Féron +# Copyright (C) 2013-2021 Alban 'spl0k' Féron # 2017 Óscar García Amor # # Distributed under terms of the GNU AGPLv3 license. -import supysonic as project - from setuptools import setup -from setuptools import find_packages -reqs = [ - "click", - "flask>=0.11", - "pony>=0.7.6", - "Pillow", - "requests>=1.0.0", - "mediafile", - "watchdog>=0.8.0", - "zipstream-ng>=1.1.0,<2.0.0", -] - -setup( - name=project.NAME, - version=project.VERSION, - description=project.DESCRIPTION, - keywords=project.KEYWORDS, - long_description=project.LONG_DESCRIPTION, - author=project.AUTHOR_NAME, - author_email=project.AUTHOR_EMAIL, - url=project.URL, - license=project.LICENSE, - packages=find_packages(exclude=["tests*"]), - install_requires=reqs, - entry_points={ - "console_scripts": [ - "supysonic-cli=supysonic.cli:main", - "supysonic-daemon=supysonic.daemon:main", - "supysonic-server=supysonic.server:main" - ] - }, - zip_safe=False, - include_package_data=True, - test_suite="tests.suite", - tests_require=["lxml"], - classifiers=[ - "Development Status :: 3 - Alpha", - "Environment :: Console", - "Environment :: Web Environment", - "Framework :: Flask", - "Intended Audience :: End Users/Desktop", - "Intended Audience :: System Administrators", - "License :: OSI Approved :: GNU Affero General Public License v3", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Topic :: Multimedia :: Sound/Audio", - ], -) +if __name__ == "__main__": + setup( + test_suite="tests.suite", + tests_require=["lxml"], + ) diff --git a/supysonic/__init__.py b/supysonic/__init__.py index 6904647..01e32d5 100644 --- a/supysonic/__init__.py +++ b/supysonic/__init__.py @@ -6,21 +6,11 @@ # # Distributed under terms of the GNU AGPLv3 license. -NAME = "supysonic" +NAME = "Supysonic" VERSION = "0.6.3" -DESCRIPTION = "Python implementation of the Subsonic server API." -KEYWORDS = "subsonic music api" -AUTHOR_NAME = "Alban Féron" +DESCRIPTION = "Python implementation of the Subsonic server API" +AUTHOR = "Alban Féron" AUTHOR_EMAIL = "alban.feron@gmail.com" -URL = "https://github.com/spl0k/supysonic" +URL = "https://supysonic.readthedocs.io/" +DOWNLOAD_URL = "https://github.com/spl0k/supysonic" LICENSE = "GNU AGPLv3" -LONG_DESCRIPTION = """Supysonic is a Python implementation of the Subsonic server API. -Current supported features are: -* browsing (by folders or tags) -* streaming of various audio file formats -* transcoding -* user or random playlists -* cover art (cover.jpg files in the same folder as music files) -* starred tracks/albums and ratings -* Last.FM scrobbling -* Jukebox mode"""