Add Prettier to pre-commit

This commit is contained in:
Hugo van Kemenade 2024-02-05 21:24:25 +02:00
parent a14a50a333
commit f4547a5821
5 changed files with 90 additions and 76 deletions

View file

@ -46,6 +46,13 @@ repos:
hooks: hooks:
- id: tox-ini-fmt - 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 - repo: meta
hooks: hooks:
- id: check-hooks-apply - id: check-hooks-apply

View file

@ -12,117 +12,125 @@ See GitHub Releases:
## Changed ## Changed
* Fix unsafe creation of temp file for caching, and improve exception raising (#356) @kvanzuijlen - Fix unsafe creation of temp file for caching, and improve exception raising (#356)
* [pre-commit.ci] pre-commit autoupdate (#362) @pre-commit-ci @kvanzuijlen
- [pre-commit.ci] pre-commit autoupdate (#362) @pre-commit-ci
## [4.1.0] - 2021-01-04 ## [4.1.0] - 2021-01-04
## Added ## Added
* Add support for streaming (#336) @kvanzuijlen - Add support for streaming (#336) @kvanzuijlen
* Add Python 3.9 final to Travis CI (#350) @sheetalsingala - Add Python 3.9 final to Travis CI (#350) @sheetalsingala
## Changed ## Changed
* Update copyright year (#360) @hugovk - Update copyright year (#360) @hugovk
* Replace Travis CI with GitHub Actions (#352) @hugovk - Replace Travis CI with GitHub Actions (#352) @hugovk
* [pre-commit.ci] pre-commit autoupdate (#359) @pre-commit-ci - [pre-commit.ci] pre-commit autoupdate (#359) @pre-commit-ci
## Fixed ## 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 ## [4.0.0] - 2020-10-07
## Added ## Added
* Add support for Python 3.9 (#347) @hugovk - Add support for Python 3.9 (#347) @hugovk
## Removed ## Removed
* Remove deprecated `Artist.get_cover_image`, `User.get_artist_tracks` and `STATUS_TOKEN_ERROR` (#348) @hugovk - Remove deprecated `Artist.get_cover_image`, `User.get_artist_tracks` and
* Drop support for EOL Python 3.5 (#346) @hugovk `STATUS_TOKEN_ERROR` (#348) @hugovk
- Drop support for EOL Python 3.5 (#346) @hugovk
## [3.3.0] - 2020-06-25 ## [3.3.0] - 2020-06-25
### Added ### 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 ### Changed
* Improve handling of error responses from the API (#327) @spiritualized - Improve handling of error responses from the API (#327) @spiritualized
### Deprecated ### 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 ### 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 ## [3.2.1] - 2020-03-05
### Fixed ### Fixed
* Only Python 3 is supported: don't create universal wheel (#318) @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 regression calling `get_recent_tracks` with `limit=None` (#320) @hugovk
* Fix `DeprecationWarning`: Please use `assertRegex` instead (#323) @hugovk - Fix `DeprecationWarning`: Please use `assertRegex` instead (#323) @hugovk
## [3.2.0] - 2020-01-03 ## [3.2.0] - 2020-01-03
### Added ### Added
* Support for Python 3.8 - Support for Python 3.8
* Store album art URLs when you call `GetTopAlbums` ([#307]) - Store album art URLs when you call `GetTopAlbums` ([#307])
* Retry paging through results on exception ([#297]) - Retry paging through results on exception ([#297])
* More error status codes from https://last.fm/api/errorcodes ([#297]) - More error status codes from https://last.fm/api/errorcodes ([#297])
### Changed ### Changed
* Respect `get_recent_tracks`' limit when there's a now playing track ([#310]) - Respect `get_recent_tracks`' limit when there's a now playing track ([#310])
* Move installable code to `src/` ([#301]) - Move installable code to `src/` ([#301])
* Update `get_weekly_artist_charts` docstring: only for `User` ([#311]) - Update `get_weekly_artist_charts` docstring: only for `User` ([#311])
* Remove Python 2 warnings, `python_requires` should be enough ([#312]) - Remove Python 2 warnings, `python_requires` should be enough ([#312])
* Use setuptools_scm to simplify versioning during release ([#316]) - Use setuptools_scm to simplify versioning during release ([#316])
* Various lint and test updates - Various lint and test updates
### Deprecated ### 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 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 supported" error when calling it. A future version of pylast will remove its
`User.get_artist_tracks` altogether. ([#305]) `User.get_artist_tracks` altogether. ([#305])
* `STATUS_TOKEN_ERROR` is deprecated and will be removed in a future version. - `STATUS_TOKEN_ERROR` is deprecated and will be removed in a future version. Use
Use `STATUS_OPERATION_FAILED` instead. `STATUS_OPERATION_FAILED` instead.
## [3.1.0] - 2019-03-07 ## [3.1.0] - 2019-03-07
### Added ### Added
* Extract username from session via new - Extract username from session via new
`SessionKeyGenerator.get_web_auth_session_key_username` ([#290]) `SessionKeyGenerator.get_web_auth_session_key_username` ([#290])
* `User.get_track_scrobbles` ([#298]) - `User.get_track_scrobbles` ([#298])
### Deprecated ### Deprecated
* `User.get_artist_tracks`. Use `User.get_track_scrobbles` as a partial replacement. - `User.get_artist_tracks`. Use `User.get_track_scrobbles` as a partial replacement.
([#298]) ([#298])
## [3.0.0] - 2019-01-01 ## [3.0.0] - 2019-01-01
### Added ### Added
* This changelog file ([#273])
- This changelog file ([#273])
### Removed ### Removed
* Support for Python 2.7 ([#265]) - Support for Python 2.7 ([#265])
* Constants `COVER_SMALL`, `COVER_MEDIUM`, `COVER_LARGE`, `COVER_EXTRA_LARGE` - Constants `COVER_SMALL`, `COVER_MEDIUM`, `COVER_LARGE`, `COVER_EXTRA_LARGE` and
and `COVER_MEGA`. Use `SIZE_SMALL` etc. instead. ([#282]) `COVER_MEGA`. Use `SIZE_SMALL` etc. instead. ([#282])
## [2.4.0] - 2018-08-08 ## [2.4.0] - 2018-08-08
### Deprecated ### 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.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 [4.1.0]: https://github.com/pylast/pylast/compare/4.0.0...4.1.0

View file

@ -35,31 +35,30 @@ Or from requirements.txt:
Note: Note:
* pyLast 5.3+ supports Python 3.8-3.13. - pyLast 5.3+ supports Python 3.8-3.13.
* pyLast 5.2+ supports Python 3.8-3.12. - pyLast 5.2+ supports Python 3.8-3.12.
* pyLast 5.1 supports Python 3.7-3.11. - pyLast 5.1 supports Python 3.7-3.11.
* pyLast 5.0 supports Python 3.7-3.10. - pyLast 5.0 supports Python 3.7-3.10.
* pyLast 4.3 - 4.5 supports Python 3.6-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 4.0 - 4.2 supports Python 3.6-3.9.
* pyLast 3.2 - 3.3 supports Python 3.5-3.8. - pyLast 3.2 - 3.3 supports Python 3.5-3.8.
* pyLast 3.0 - 3.1 supports Python 3.5-3.7. - 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.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 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.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 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, 3.
* pyLast < 0.5 supports Python 2. - pyLast < 0.5 supports Python 2.
## Features ## Features
* Simple public interface. - Simple public interface.
* Access to all the data exposed by the Last.fm web services. - Access to all the data exposed by the Last.fm web services.
* Scrobbling support. - Scrobbling support.
* Full object-oriented design. - Full object-oriented design.
* Proxy support. - Proxy support.
* Internal caching support for some web services calls (disabled by default). - Internal caching support for some web services calls (disabled by default).
* Support for other API-compatible networks like Libre.fm. - Support for other API-compatible networks like Libre.fm.
## Getting started ## Getting started
@ -88,8 +87,8 @@ network = pylast.LastFMNetwork(
) )
``` ```
Alternatively, instead of creating `network` with a username and password, Alternatively, instead of creating `network` with a username and password, you can
you can authenticate with a session key: authenticate with a session key:
```python ```python
import pylast import pylast
@ -132,7 +131,6 @@ track.add_tags(("awesome", "favorite"))
# to get more help about anything and see examples of how it works # to get more help about anything and see examples of how it works
``` ```
More examples in More examples in
<a href="https://github.com/hugovk/lastfm-tools">hugovk/lastfm-tools</a> and <a href="https://github.com/hugovk/lastfm-tools">hugovk/lastfm-tools</a> and
[tests/](https://github.com/pylast/pylast/tree/main/tests). [tests/](https://github.com/pylast/pylast/tree/main/tests).

View file

@ -1,8 +1,8 @@
# Release Checklist # Release Checklist
- [ ] Get `main` to the appropriate code release state. - [ ] Get `main` to the appropriate code release state.
[GitHub Actions](https://github.com/pylast/pylast/actions) should be running cleanly for [GitHub Actions](https://github.com/pylast/pylast/actions) should be running
all merges to `main`. cleanly for all merges to `main`.
[![Test](https://github.com/pylast/pylast/workflows/Test/badge.svg)](https://github.com/pylast/pylast/actions) [![Test](https://github.com/pylast/pylast/workflows/Test/badge.svg)](https://github.com/pylast/pylast/actions)
- [ ] Edit release draft, adjust text if needed: - [ ] Edit release draft, adjust text if needed:
@ -12,7 +12,8 @@
- [ ] Publish release - [ ] 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) has deployed to [PyPI](https://pypi.org/project/pylast/#history)
- [ ] Check installation: - [ ] Check installation:

View file

@ -1,4 +1,4 @@
username: TODO_ENTER_YOURS_HERE username: TODO_ENTER_YOURS_HERE
password_hash: TODO_ENTER_YOURS_HERE password_hash: TODO_ENTER_YOURS_HERE
api_key: TODO_ENTER_YOURS_HERE api_key: TODO_ENTER_YOURS_HERE
api_secret: TODO_ENTER_YOURS_HERE api_secret: TODO_ENTER_YOURS_HERE