## Description
This is a very simple PR, just removing the (apparently unused) `beet`
executable from the repository and substituting `bin/env python` for
`bin/python3` where possible.
Fixes#4604.
This adds a step to the GitHub release so that it sends a toot on
Fosstodon, beets' Mastodon account, to publicise that and get some
engagement!
Not tested, but this is lifted straight from the action repo so it
*should* be okay. @snejus for a sanity check if you wouldn't mind
Apparently, this script isn't actually used for anything; the build
system will automatically generate a script like this when installing
`beets`.
See <https://github.com/beetbox/beets/issues/4604>.
## Description
I noticed that some development work was waiting on cleaner `mypy` runs,
so I thought I would help out a bit. This PR just contains a number of
miscellaneous fixes across the codebase that I hit. I'm happy to add
more, or remove any problematic changes (though I don't think I've
broken anything, only type annotations have changed).
## To Do
- [x] ~Documentation~
- [ ] Changelog
- [x] ~Tests~
Some functions used by the bash completion script have become
deprecated. This was causing the test suite to break on faster-moving
distributions (e.g. Arch Linux and Gentoo). The issue is only noticeable
because the tests for the completion function explicitly disallow
compatibility implementations from being loaded. Rather than allowing
compatibility implementations, I've added some basic logic to the
completion script so that older and newer versions of `bash-completion`
can be supported simultaneously.
Debian 10 LTS only has 'bash-completion' v2.8, but support for it
expires at the end of the month (2024-06-30). Still, this completion
script apparently worked there, so there's no harm in reducing the
version requirement, which I had previously picked arbitrarily.
See https://github.com/beetbox/beets/pull/5301#issuecomment-2164297308.
I haven't run git blame, but this script hasn't been updated in a while.
Apparently development in 'bash-completion' is moving a lot faster now,
so supporting multiple mutually-incompatible versions of it has become
necessary.
For some reason, this issue wasn't caught on CI - I think the newer
'bash-completion' hasn't reached the distribution used there. Still,
this code is now forward-compatible.
I had misinterpreted the pattern type for this query to be 'NoReturn',
thinking that it accepted no pattern at all (even so, I should have
typed it as 'None'). However, it does accept a pattern, and uses it to
decide whether to select only singletons or none at all.
See <https://github.com/beetbox/beets/pull/5282#discussion_r1633212742>.
In changing the implementation of the 'AttrDict' class to eliminate
'mypy' errors, I had accidentally removed support for storing 'None'
values in the dict. This commit restores support for them.
'typing.Never' was introduced later, and 'typing.Type' was used instead
of just 'type' until 3.9. This commit will likely be reverted over time
as these 3.8 etc. get dropped.
Migrate `beets` package configuration to Poetry which nowadays seems to
be the gold standard.
I have been using Poetry since 2019 and I have mostly been happy a happy
user: it makes local dev setup easy and has the tools I need to maintain
python packages day to day, including reliable dependency resolution,
versioning and publishing to Pypi.
It's a user-friendly tool, so it should make it more straightforward for
contributors to setup and navigate the codebase, and ultimately,
hopefully facilitate more frequent releases!
Since poetry manages local virtual environment, we do not have much need
for tox any more. Therefore, it was replaced by a task runner
`poethepoet`. Type `poe` in the project directory to see the available
commands.
- [x] Documentation. (If you've added a new command-line flag, for
example, find the appropriate page under `docs/` to describe it.)
- [x] Changelog. (Add an entry to `docs/changelog.rst` to the bottom of
one of the lists near the top of the document.)
- [x] Tests. (Very much encouraged but not strictly required.)
This reverts commit 5526bd3c184344d63eec8da4db9793b1be7002e7.
Poetry must be installed before `setup-python` action, weirdly. And we
need to install poethepoet globally too!
This reverts commit 4550d39d1e7833557e863de18163f5a4b80db977.
I love this attempt to DRY-up the linting workflow! I remember back in
the day also initially assuming that this is how the jobs work. However,
I had to meet the harsh reality of each job needing to be set up from
zero. :(
This reverts commit af996f42c3e5cacb6f5b68716a11500c1183ac02.
Since `poethepoet` is installed globally in the workflows, running it
does not require `poetry run` suffix. This is actually one of the
reasons why it's preferable to have this tool installed globally.
This reverts commit fc373f5fef8c8dd1656dfdf31c14b3365a0a75bc.
See CONTRIBUTING.rst which has tools setup guidelines for users. They
are expected to install both poetry and poethepoet globally in their
system.
This reverts commit c3b6f07c4336e6639e4597a800700820155ad294.
This commit hardcoded the paths that `isort` and `black` checks. This
means that the `check-format` job will act on the entire codebase
instead of only changed files. We need to define a `path` argument with
a default value in order to achieve the above.
Regarding "." vs "beets beetsplug test", the intention behind using "."
was to also check python files like `docs/conf.py` and
`extra/release.py` which I presume we would also want to format
properly.