diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e94e7a..7f09cba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["pypy3.10", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["pypy3.10", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] os: [ubuntu-latest] steps: @@ -24,7 +24,6 @@ jobs: allow-prereleases: true cache: pip - - name: Install dependencies run: | python -m pip install -U pip diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5caa25a..028e611 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,6 +46,13 @@ repos: hooks: - id: tox-ini-fmt + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + hooks: + - id: prettier + args: [--prose-wrap=always, --print-width=88] + exclude: .github/(ISSUE_TEMPLATE|PULL_REQUEST_TEMPLATE).md + - repo: meta hooks: - id: check-hooks-apply diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 43dbfa3..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,9 +0,0 @@ -checks: - python: - code_rating: true - duplicate_code: true -filter: - excluded_paths: - - '*/test/*' -tools: - external_code_coverage: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 2518770..d424974 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,117 +12,125 @@ See GitHub Releases: ## Changed -* Fix unsafe creation of temp file for caching, and improve exception raising (#356) @kvanzuijlen -* [pre-commit.ci] pre-commit autoupdate (#362) @pre-commit-ci - +- Fix unsafe creation of temp file for caching, and improve exception raising (#356) + @kvanzuijlen +- [pre-commit.ci] pre-commit autoupdate (#362) @pre-commit-ci ## [4.1.0] - 2021-01-04 + ## Added -* Add support for streaming (#336) @kvanzuijlen -* Add Python 3.9 final to Travis CI (#350) @sheetalsingala +- Add support for streaming (#336) @kvanzuijlen +- Add Python 3.9 final to Travis CI (#350) @sheetalsingala ## Changed -* Update copyright year (#360) @hugovk -* Replace Travis CI with GitHub Actions (#352) @hugovk -* [pre-commit.ci] pre-commit autoupdate (#359) @pre-commit-ci +- Update copyright year (#360) @hugovk +- Replace Travis CI with GitHub Actions (#352) @hugovk +- [pre-commit.ci] pre-commit autoupdate (#359) @pre-commit-ci ## Fixed -* Set limit to 50 by default, not 1 (#355) @hugovk - +- Set limit to 50 by default, not 1 (#355) @hugovk ## [4.0.0] - 2020-10-07 + ## Added -* Add support for Python 3.9 (#347) @hugovk +- Add support for Python 3.9 (#347) @hugovk ## Removed -* Remove deprecated `Artist.get_cover_image`, `User.get_artist_tracks` and `STATUS_TOKEN_ERROR` (#348) @hugovk -* Drop support for EOL Python 3.5 (#346) @hugovk - +- Remove deprecated `Artist.get_cover_image`, `User.get_artist_tracks` and + `STATUS_TOKEN_ERROR` (#348) @hugovk +- Drop support for EOL Python 3.5 (#346) @hugovk ## [3.3.0] - 2020-06-25 + ### Added -* `User.get_now_playing`: Add album and cover image to info (#330) @hugovk +- `User.get_now_playing`: Add album and cover image to info (#330) @hugovk ### Changed -* Improve handling of error responses from the API (#327) @spiritualized +- Improve handling of error responses from the API (#327) @spiritualized ### Deprecated -* Deprecate `Artist.get_cover_image`, they're no longer available from Last.fm (#332) @hugovk +- Deprecate `Artist.get_cover_image`, they're no longer available from Last.fm (#332) + @hugovk ### Fixed -* Fix `artist.get_bio_content()` to return `None` if bio is empty (#326) @hugovk - +- Fix `artist.get_bio_content()` to return `None` if bio is empty (#326) @hugovk ## [3.2.1] - 2020-03-05 + ### Fixed -* Only Python 3 is supported: don't create universal wheel (#318) @hugovk -* Fix regression calling `get_recent_tracks` with `limit=None` (#320) @hugovk -* Fix `DeprecationWarning`: Please use `assertRegex` instead (#323) @hugovk +- Only Python 3 is supported: don't create universal wheel (#318) @hugovk +- Fix regression calling `get_recent_tracks` with `limit=None` (#320) @hugovk +- Fix `DeprecationWarning`: Please use `assertRegex` instead (#323) @hugovk ## [3.2.0] - 2020-01-03 + ### Added -* Support for Python 3.8 -* Store album art URLs when you call `GetTopAlbums` ([#307]) -* Retry paging through results on exception ([#297]) -* More error status codes from https://last.fm/api/errorcodes ([#297]) +- Support for Python 3.8 +- Store album art URLs when you call `GetTopAlbums` ([#307]) +- Retry paging through results on exception ([#297]) +- More error status codes from https://last.fm/api/errorcodes ([#297]) ### Changed -* Respect `get_recent_tracks`' limit when there's a now playing track ([#310]) -* Move installable code to `src/` ([#301]) -* Update `get_weekly_artist_charts` docstring: only for `User` ([#311]) -* Remove Python 2 warnings, `python_requires` should be enough ([#312]) -* Use setuptools_scm to simplify versioning during release ([#316]) -* Various lint and test updates +- Respect `get_recent_tracks`' limit when there's a now playing track ([#310]) +- Move installable code to `src/` ([#301]) +- Update `get_weekly_artist_charts` docstring: only for `User` ([#311]) +- Remove Python 2 warnings, `python_requires` should be enough ([#312]) +- Use setuptools_scm to simplify versioning during release ([#316]) +- Various lint and test updates ### Deprecated -* Last.fm's `user.getArtistTracks` has now been deprecated by Last.fm and is no longer +- Last.fm's `user.getArtistTracks` has now been deprecated by Last.fm and is no longer available. Last.fm returns a "Deprecated - This type of request is no longer supported" error when calling it. A future version of pylast will remove its `User.get_artist_tracks` altogether. ([#305]) -* `STATUS_TOKEN_ERROR` is deprecated and will be removed in a future version. - Use `STATUS_OPERATION_FAILED` instead. +- `STATUS_TOKEN_ERROR` is deprecated and will be removed in a future version. Use + `STATUS_OPERATION_FAILED` instead. ## [3.1.0] - 2019-03-07 + ### Added -* Extract username from session via new +- Extract username from session via new `SessionKeyGenerator.get_web_auth_session_key_username` ([#290]) -* `User.get_track_scrobbles` ([#298]) +- `User.get_track_scrobbles` ([#298]) ### Deprecated -* `User.get_artist_tracks`. Use `User.get_track_scrobbles` as a partial replacement. - ([#298]) +- `User.get_artist_tracks`. Use `User.get_track_scrobbles` as a partial replacement. + ([#298]) ## [3.0.0] - 2019-01-01 + ### Added -* This changelog file ([#273]) + +- This changelog file ([#273]) ### Removed -* Support for Python 2.7 ([#265]) +- Support for Python 2.7 ([#265]) -* Constants `COVER_SMALL`, `COVER_MEDIUM`, `COVER_LARGE`, `COVER_EXTRA_LARGE` - and `COVER_MEGA`. Use `SIZE_SMALL` etc. instead. ([#282]) +- Constants `COVER_SMALL`, `COVER_MEDIUM`, `COVER_LARGE`, `COVER_EXTRA_LARGE` and + `COVER_MEGA`. Use `SIZE_SMALL` etc. instead. ([#282]) ## [2.4.0] - 2018-08-08 + ### Deprecated -* Support for Python 2.7 ([#265]) +- Support for Python 2.7 ([#265]) [4.2.0]: https://github.com/pylast/pylast/compare/4.1.0...4.2.0 [4.1.0]: https://github.com/pylast/pylast/compare/4.0.0...4.1.0 diff --git a/README.md b/README.md index 3d9e882..93bd9b6 100644 --- a/README.md +++ b/README.md @@ -35,30 +35,30 @@ Or from requirements.txt: Note: -* pyLast 5.2+ supports Python 3.8-3.12. -* pyLast 5.1 supports Python 3.7-3.11. -* pyLast 5.0 supports Python 3.7-3.10. -* pyLast 4.3 - 4.5 supports Python 3.6-3.10. -* pyLast 4.0 - 4.2 supports Python 3.6-3.9. -* pyLast 3.2 - 3.3 supports Python 3.5-3.8. -* pyLast 3.0 - 3.1 supports Python 3.5-3.7. -* pyLast 2.2 - 2.4 supports Python 2.7.10+, 3.4-3.7. -* pyLast 2.0 - 2.1 supports Python 2.7.10+, 3.4-3.6. -* pyLast 1.7 - 1.9 supports Python 2.7, 3.3-3.6. -* pyLast 1.0 - 1.6 supports Python 2.7, 3.3-3.4. -* pyLast 0.5 supports Python 2, 3. -* pyLast < 0.5 supports Python 2. +- pyLast 5.3+ supports Python 3.8-3.13. +- pyLast 5.2+ supports Python 3.8-3.12. +- pyLast 5.1 supports Python 3.7-3.11. +- pyLast 5.0 supports Python 3.7-3.10. +- pyLast 4.3 - 4.5 supports Python 3.6-3.10. +- pyLast 4.0 - 4.2 supports Python 3.6-3.9. +- pyLast 3.2 - 3.3 supports Python 3.5-3.8. +- pyLast 3.0 - 3.1 supports Python 3.5-3.7. +- pyLast 2.2 - 2.4 supports Python 2.7.10+, 3.4-3.7. +- pyLast 2.0 - 2.1 supports Python 2.7.10+, 3.4-3.6. +- pyLast 1.7 - 1.9 supports Python 2.7, 3.3-3.6. +- pyLast 1.0 - 1.6 supports Python 2.7, 3.3-3.4. +- pyLast 0.5 supports Python 2, 3. +- pyLast < 0.5 supports Python 2. ## Features - * Simple public interface. - * Access to all the data exposed by the Last.fm web services. - * Scrobbling support. - * Full object-oriented design. - * Proxy support. - * Internal caching support for some web services calls (disabled by default). - * Support for other API-compatible networks like Libre.fm. - +- Simple public interface. +- Access to all the data exposed by the Last.fm web services. +- Scrobbling support. +- Full object-oriented design. +- Proxy support. +- Internal caching support for some web services calls (disabled by default). +- Support for other API-compatible networks like Libre.fm. ## Getting started @@ -87,8 +87,8 @@ network = pylast.LastFMNetwork( ) ``` -Alternatively, instead of creating `network` with a username and password, -you can authenticate with a session key: +Alternatively, instead of creating `network` with a username and password, you can +authenticate with a session key: ```python import pylast @@ -131,7 +131,6 @@ track.add_tags(("awesome", "favorite")) # to get more help about anything and see examples of how it works ``` - More examples in hugovk/lastfm-tools and [tests/](https://github.com/pylast/pylast/tree/main/tests). diff --git a/RELEASING.md b/RELEASING.md index 9a4d1bc..9b2e38a 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,8 +1,8 @@ # Release Checklist - [ ] Get `main` to the appropriate code release state. - [GitHub Actions](https://github.com/pylast/pylast/actions) should be running cleanly for - all merges to `main`. + [GitHub Actions](https://github.com/pylast/pylast/actions) should be running + cleanly for all merges to `main`. [![Test](https://github.com/pylast/pylast/workflows/Test/badge.svg)](https://github.com/pylast/pylast/actions) - [ ] Edit release draft, adjust text if needed: @@ -12,7 +12,8 @@ - [ ] Publish release -- [ ] Check the tagged [GitHub Actions build](https://github.com/pylast/pylast/actions/workflows/deploy.yml) +- [ ] Check the tagged + [GitHub Actions build](https://github.com/pylast/pylast/actions/workflows/deploy.yml) has deployed to [PyPI](https://pypi.org/project/pylast/#history) - [ ] Check installation: diff --git a/example_test_pylast.yaml b/example_test_pylast.yaml index a8fa045..00b09f1 100644 --- a/example_test_pylast.yaml +++ b/example_test_pylast.yaml @@ -1,4 +1,4 @@ -username: TODO_ENTER_YOURS_HERE -password_hash: TODO_ENTER_YOURS_HERE -api_key: TODO_ENTER_YOURS_HERE -api_secret: TODO_ENTER_YOURS_HERE +username: TODO_ENTER_YOURS_HERE +password_hash: TODO_ENTER_YOURS_HERE +api_key: TODO_ENTER_YOURS_HERE +api_secret: TODO_ENTER_YOURS_HERE diff --git a/pyproject.toml b/pyproject.toml index 3413855..6857849 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet", diff --git a/tox.ini b/tox.ini index e3972c0..3ead5fc 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ requires = tox>=4.2 env_list = lint - py{py3, 312, 311, 310, 39, 38} + py{py3, 313, 312, 311, 310, 39, 38} [testenv] extras =