From 523903cac58a8b78d454a2a024f2b0f414b2d7ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Garc=C3=ADa=20Amor?= Date: Mon, 7 Aug 2017 11:04:00 +0200 Subject: [PATCH] Improved setup script --- MANIFEST.in | 2 ++ setup.py | 65 ++++++++++++++++++++++--------------------- supysonic/__init__.py | 43 +++++++++++++++------------- 3 files changed, 58 insertions(+), 52 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index f19a717..238b63e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,5 @@ include cgi-bin/* include config.sample include README.md +recursive-include supysonic/templates * +recursive-include supysonic/static * diff --git a/setup.py b/setup.py index 54e86fa..e36ccca 100755 --- a/setup.py +++ b/setup.py @@ -1,36 +1,37 @@ -#!/usr/bin/python -# encoding: utf-8 +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# vim:fenc=utf-8 +# +# This file is part of Supysonic. +# Supysonic is a Python implementation of the Subsonic server API. +# +# Copyright (C) 2013-2017 Alban 'spl0k' Féron +# 2017 Óscar García Amor +# +# Distributed under terms of the GNU AGPLv3 license. -from distutils.core import setup +import supysonic as project -setup(name='supysonic', - description='Python implementation of the Subsonic server API.', - keywords='subsonic music', - version='0.1', - url='https://github.com/spl0k/supysonic', - license='AGPLv3', - author='Alban Féron', - author_email='alban.feron@gmail.com', - long_description=""" - Supysonic is a Python implementation of the Subsonic server API. +from setuptools import setup +from setuptools import find_packages +from pip.req import parse_requirements +from pip.download import PipSession - Current supported features are: - * browsing (by folders or tags) - * streaming of various audio file formats - * transcoding - * user or random playlists - * cover arts (cover.jpg files in the same folder as music files) - * starred tracks/albums and ratings - * Last.FM scrobbling - """, - packages=['supysonic', 'supysonic.api', 'supysonic.frontend', - 'supysonic.managers'], - scripts=['bin/supysonic-cli', 'bin/supysonic-watcher'], - package_data={'supysonic': [ - 'templates/*.html', - 'static/css/*', - 'static/fonts/*', - 'static/js/*' - ]} - ) +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(), + install_requires=[str(x.req) for x in + parse_requirements('requirements.txt', session=PipSession())], + scripts=['bin/supysonic-cli', 'bin/supysonic-watcher'], + zip_safe=False, + include_package_data=True + ) diff --git a/supysonic/__init__.py b/supysonic/__init__.py index b10767a..a2bab46 100644 --- a/supysonic/__init__.py +++ b/supysonic/__init__.py @@ -1,25 +1,28 @@ -# coding: utf-8 - +# -*- coding: utf-8 -*- +# vim:fenc=utf-8 +# # This file is part of Supysonic. -# # Supysonic is a Python implementation of the Subsonic server API. -# Copyright (C) 2013-2017 Alban 'spl0k' Féron # -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# Copyright (C) 2013-2017 Alban 'spl0k' Féron +# 2017 Óscar García Amor # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - -import mimetypes - -def get_mime(ext): - return mimetypes.guess_type('dummy.' + ext, False)[0] or config.get('mimetypes', ext) or 'application/octet-stream' +# Distributed under terms of the GNU AGPLv3 license. +NAME = 'supysonic' +VERSION = '0.2' +DESCRIPTION = 'Python implementation of the Subsonic server API.' +KEYWORDS = 'subsonic music api' +AUTHOR_NAME = 'Alban Féron' +AUTHOR_EMAIL = 'alban.feron@gmail.com' +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 arts (cover.jpg files in the same folder as music files) +* starred tracks/albums and ratings +* Last.FM scrobbling'''