From b3fb55586c20cba223f4814eb3c5b30baa40aebc Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sun, 21 Nov 2021 16:42:04 +0200 Subject: [PATCH] Convert setup.py to static setup.cfg and format with setup-cfg-fmt --- .pre-commit-config.yaml | 17 +++++++++----- setup.cfg | 49 +++++++++++++++++++++++++++++++++++++++++ setup.py | 39 ++------------------------------ 3 files changed, 62 insertions(+), 43 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a720261..2bf62a8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,12 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.29.0 + rev: v2.29.1 hooks: - id: pyupgrade args: ["--py36-plus"] - repo: https://github.com/psf/black - rev: 21.9b0 + rev: 21.11b1 hooks: - id: black args: ["--target-version", "py36"] @@ -15,19 +15,19 @@ repos: types: [] - repo: https://github.com/asottile/blacken-docs - rev: v1.11.0 + rev: v1.12.0 hooks: - id: blacken-docs args: ["--target-version", "py36"] - additional_dependencies: [black==20.8b1] + additional_dependencies: [black==21.11b1] - repo: https://github.com/PyCQA/isort - rev: 5.9.3 + rev: 5.10.1 hooks: - id: isort - repo: https://github.com/PyCQA/flake8 - rev: 3.9.2 + rev: 4.0.1 hooks: - id: flake8 additional_dependencies: [flake8-2020, flake8-implicit-str-concat] @@ -43,6 +43,11 @@ repos: - id: check-merge-conflict - id: check-yaml + - repo: https://github.com/asottile/setup-cfg-fmt + rev: v1.20.0 + hooks: + - id: setup-cfg-fmt + - repo: https://github.com/tox-dev/tox-ini-fmt rev: 0.5.1 hooks: diff --git a/setup.cfg b/setup.cfg index 191fac9..dd25e90 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,52 @@ +[metadata] +name = pylast +description = A Python interface to Last.fm and Libre.fm +long_description = file: README.md +long_description_content_type = text/markdown +url = https://github.com/pylast/pylast +author = Amr Hassan and Contributors +author_email = amr.hassan@gmail.com +license = Apache-2.0 +license_file = LICENSE.txt +classifiers = + Development Status :: 5 - Production/Stable + License :: OSI Approved :: Apache Software License + Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: Implementation :: CPython + Programming Language :: Python :: Implementation :: PyPy + Topic :: Internet + Topic :: Multimedia :: Sound/Audio + Topic :: Software Development :: Libraries :: Python Modules +keywords = + Last.fm + music + scrobble + scrobbling + +[options] +packages = find: +python_requires = >=3.6 +package_dir = =src +setup_requires = + setuptools-scm + +[options.packages.find] +where = src + +[options.extras_require] +tests = + flaky + pytest + pytest-cov + pytest-random-order + pyyaml + [flake8] max_line_length = 88 diff --git a/setup.py b/setup.py index b49e655..668794a 100755 --- a/setup.py +++ b/setup.py @@ -1,47 +1,12 @@ -from setuptools import find_packages, setup - -with open("README.md") as f: - long_description = f.read() +from setuptools import setup -def local_scheme(version): +def local_scheme(version) -> str: """Skip the local version (eg. +xyz of 0.6.1.dev4+gdf99fe2) to be able to upload to Test PyPI""" return "" setup( - name="pylast", - description="A Python interface to Last.fm and Libre.fm", - long_description=long_description, - long_description_content_type="text/markdown", - author="Amr Hassan and Contributors", - author_email="amr.hassan@gmail.com", - url="https://github.com/pylast/pylast", - license="Apache2", - keywords=["Last.fm", "music", "scrobble", "scrobbling"], - packages=find_packages(where="src"), - package_dir={"": "src"}, use_scm_version={"local_scheme": local_scheme}, - setup_requires=["setuptools_scm"], - extras_require={ - "tests": ["flaky", "pytest", "pytest-cov", "pytest-random-order", "pyyaml"] - }, - python_requires=">=3.6", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "License :: OSI Approved :: Apache Software License", - "Topic :: Internet", - "Topic :: Multimedia :: Sound/Audio", - "Topic :: Software Development :: Libraries :: Python Modules", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - ], )