git: 46f3874290cc - main - audio/py-pylast: Update to 5.1.0

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Fri, 30 Dec 2022 09:09:43 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=46f3874290cc5131f30a421de058cd860af25010

commit 46f3874290cc5131f30a421de058cd860af25010
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-12-30 08:41:46 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-12-30 09:04:25 +0000

    audio/py-pylast: Update to 5.1.0
    
    - Convert to USE_PYTHON=pytest
    
    Changes:        https://github.com/pylast/pylast/releases
---
 audio/py-pylast/Makefile       | 13 +++++++++---
 audio/py-pylast/distinfo       |  6 +++---
 audio/py-pylast/files/setup.py | 46 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+), 6 deletions(-)

diff --git a/audio/py-pylast/Makefile b/audio/py-pylast/Makefile
index 7cf00ab9e3e8..6b04f10457e9 100644
--- a/audio/py-pylast/Makefile
+++ b/audio/py-pylast/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	pylast
-PORTVERSION=	5.0.0
+PORTVERSION=	5.1.0
 CATEGORIES=	audio python
 MASTER_SITES=	CHEESESHOP
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -11,13 +11,17 @@ WWW=		https://github.com/pylast/pylast
 LICENSE=	APACHE20
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools_scm>=0:devel/py-setuptools_scm@${PY_FLAVOR}
 RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}httpx>=0:www/py-httpx@${PY_FLAVOR}
+TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}flaky>=0:devel/py-flaky@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pytest-cov>=0:devel/py-pytest-cov@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pytest-random-order>=0:devel/py-pytest-random-order@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}yaml>=0:devel/py-yaml@${PY_FLAVOR}
 
 USES=		python:3.7+
-USE_PYTHON=	autoplist concurrent distutils
+USE_PYTHON=	autoplist concurrent distutils pytest
 
 NO_ARCH=	yes
+TEST_ENV=	PYTHONPATH=${STAGEDIR}${PYTHON_SITELIBDIR}
 
 .include <bsd.port.pre.mk>
 
@@ -25,4 +29,7 @@ NO_ARCH=	yes
 RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}importlib-metadata>=0:devel/py-importlib-metadata@${PY_FLAVOR}
 .endif
 
+post-patch:
+	@${SED} -e 's|%%PORTVERSION%%|${PORTVERSION}|' ${FILESDIR}/setup.py > ${WRKSRC}/setup.py
+
 .include <bsd.port.post.mk>
diff --git a/audio/py-pylast/distinfo b/audio/py-pylast/distinfo
index b8cda871d2aa..b3fd4ca76635 100644
--- a/audio/py-pylast/distinfo
+++ b/audio/py-pylast/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1650228744
-SHA256 (pylast-5.0.0.tar.gz) = 5018b66c2b4632d71abd8103b73e66e4dd14c6609a8f7ba7e5aa26c736df2df8
-SIZE (pylast-5.0.0.tar.gz) = 43871
+TIMESTAMP = 1669057653
+SHA256 (pylast-5.1.0.tar.gz) = 89300fdcdf423d7be0606bdc44da27c3b48c4d73aa1d4cb12672cc006c979bdc
+SIZE (pylast-5.1.0.tar.gz) = 40517
diff --git a/audio/py-pylast/files/setup.py b/audio/py-pylast/files/setup.py
new file mode 100644
index 000000000000..a7a5b7058c08
--- /dev/null
+++ b/audio/py-pylast/files/setup.py
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+from setuptools import setup
+
+setup(
+    name='pylast',
+    version='%%PORTVERSION',
+    description='A Python interface to Last.fm and Libre.fm',
+    long_description='# pyLast\n\n[![PyPI version](https://img.shields.io/pypi/v/pylast.svg)](https://pypi.org/project/pylast/)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/pylast.svg)](https://pypi.org/project/pylast/)\n[![PyPI downloads](https://img.shields.io/pypi/dm/pylast.svg)](https://pypistats.org/packages/pylast)\n[![Test](https://github.com/pylast/pylast/workflows/Test/badge.svg)](https://github.com/pylast/pylast/actions)\n[![Coverage (Codecov)](https://codecov.io/gh/pylast/pylast/branch/main/graph/badge.svg)](https://codecov.io/gh/pylast/pylast)\n[![Code style: Black](https://img.shields.io/badge/code%20style-Black-000000.svg)](https://github.com/psf/black)\n[![DOI](https://zenodo.org/badge/7803088.svg)](https://zenodo.org/badge/latestdoi/7803088)\n\nA Python interface to [Last.fm](https://www.last.fm/) and other API-compatible websites\nsuch as [Libre.fm](https://libre.fm/).\n\nUse the pydoc utility for help on usage or see [tests/](tests/) for ex
 amples.\n\n## Installation\n\nInstall via pip:\n\n```sh\npython3 -m pip install pylast\n```\n\nInstall latest development version:\n\n```sh\npython3 -m pip install -U git+https://github.com/pylast/pylast\n```\n\nOr from requirements.txt:\n\n```txt\n-e https://github.com/pylast/pylast.git#egg=pylast\n```\n\nNote:\n\n* pyLast 5.1+ supports Python 3.7-3.11.\n* pyLast 5.0+ supports Python 3.7-3.10.\n* pyLast 4.3+ supports Python 3.6-3.10.\n* pyLast 4.0 - 4.2 supports Python 3.6-3.9.\n* pyLast 3.2 - 3.3 supports Python 3.5-3.8.\n* pyLast 3.0 - 3.1 supports Python 3.5-3.7.\n* pyLast 2.2 - 2.4 supports Python 2.7.10+, 3.4-3.7.\n* pyLast 2.0 - 2.1 supports Python 2.7.10+, 3.4-3.6.\n* pyLast 1.7 - 1.9 supports Python 2.7, 3.3-3.6.\n* pyLast 1.0 - 1.6 supports Python 2.7, 3.3-3.4.\n* pyLast 0.5 supports Python 2, 3.\n* pyLast < 0.5 supports Python 2.\n\n## Features\n\n * Simple public interface.\n * Access to all the data exposed by the Last.fm web services.\n * Scrobbling support.\n * Full o
 bject-oriented design.\n * Proxy support.\n !
 * Internal caching support for some web services calls (disabled by default).\n * Support for other API-compatible networks like Libre.fm.\n\n\n## Getting started\n\nHere\'s some simple code example to get you started. In order to create any object from\npyLast, you need a `Network` object which represents a social music network that is\nLast.fm or any other API-compatible one. You can obtain a pre-configured one for Last.fm\nand use it as follows:\n\n```python\nimport pylast\n\n# You have to have your own unique two values for API_KEY and API_SECRET\n# Obtain yours from https://www.last.fm/api/account/create for Last.fm\nAPI_KEY = "b25b959554ed76058ac220b7b2e0a026"  # this is a sample key\nAPI_SECRET = "425b55975eed76058ac220b7b4e8a054"\n\n# In order to perform a write operation you need to authenticate yourself\nusername = "your_user_name"\npassword_hash = pylast.md5("your_password")\n\nnetwork = pylast.LastFMNetwork(\n    api_key=API_KEY,\n    api_secret=API_SECRET,\n    username
 =username,\n    password_hash=password_hash,\n)\n\n# Now you can use that object everywhere\ntrack = network.get_track("Iron Maiden", "The Nomad")\ntrack.love()\ntrack.add_tags(("awesome", "favorite"))\n\n# Type help(pylast.LastFMNetwork) or help(pylast) in a Python interpreter\n# to get more help about anything and see examples of how it works\n```\n\nMore examples in\n<a href="https://github.com/hugovk/lastfm-tools">hugovk/lastfm-tools</a> and\n[tests/](https://github.com/pylast/pylast/tree/main/tests).\n\n## Testing\n\nThe [tests/](https://github.com/pylast/pylast/tree/main/tests) directory contains\nintegration and unit tests with Last.fm, and plenty of code examples.\n\nFor integration tests you need a test account at Last.fm that will become cluttered with\ntest data, and an API key and secret. Either copy\n[example_test_pylast.yaml](example_test_pylast.yaml) to test_pylast.yaml and fill out\nthe credentials, or set them as environment variables like:\n\n```sh\nexport PYLAST_U
 SERNAME=TODO_ENTER_YOURS_HERE\nexport PYLAST!
 _PASSWORD!
 _HASH=TODO_ENTER_YOURS_HERE\nexport PYLAST_API_KEY=TODO_ENTER_YOURS_HERE\nexport PYLAST_API_SECRET=TODO_ENTER_YOURS_HERE\n```\n\nTo run all unit and integration tests:\n\n```sh\npython3 -m pip install -e ".[tests]"\npytest\n```\n\nOr run just one test case:\n\n```sh\npytest -k test_scrobble\n```\n\nTo run with coverage:\n\n```sh\npytest -v --cov pylast --cov-report term-missing\ncoverage report # for command-line report\ncoverage html   # for HTML report\nopen htmlcov/index.html\n```\n\n## Logging\n\nTo enable from your own code:\n\n```python\nimport logging\nimport pylast\n\nlogging.basicConfig(level=logging.INFO)\n\n\nnetwork = pylast.LastFMNetwork(...)\n```\n\nTo enable from pytest:\n\n```sh\npytest --log-cli-level info -k test_album_search_images\n```\n\nTo also see data returned from the API, use `level=logging.DEBUG` or\n`--log-cli-level debug` instead.\n',
+    author_email='"Amr Hassan <amr.hassan@gmail.com> and Contributors" <amr.hassan@gmail.com>',
+    maintainer='Hugo van Kemenade',
+    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.7',
+        'Programming Language :: Python :: 3.8',
+        'Programming Language :: Python :: 3.9',
+        'Programming Language :: Python :: 3.10',
+        'Programming Language :: Python :: 3.11',
+        'Programming Language :: Python :: Implementation :: CPython',
+        'Programming Language :: Python :: Implementation :: PyPy',
+        'Topic :: Internet',
+        'Topic :: Multimedia :: Sound/Audio',
+        'Topic :: Software Development :: Libraries :: Python Modules',
+    ],
+    install_requires=[
+        'httpx',
+        'importlib-metadata; python_version < "3.8"',
+    ],
+    extras_require={
+        'tests': [
+            'flaky',
+            'pytest',
+            'pytest-cov',
+            'pytest-random-order',
+            'pyyaml',
+        ],
+    },
+    packages=[
+        'pylast',
+    ],
+    package_dir={
+        '': 'src',
+    },
+)