This plugin aims to address the shortcomings of the %title function, as
brought up in issues #152, #3298 and an initial look to improvement with
#3411. It supplies a new string format command, `%titlecase` which
doesn't interfere with any prior expected behavior of the `%title`
format command.
It also adds the ability to apply titlecase logic to metadata fields
that a user selects, which is useful if you, like me, are looking for
stylistic consistency and the minor stylistic differences between
Musizbrainz, Discogs, Deezer etc, with title case are slightly
infuriating.
This will add an optional dependency of
[titlecase](https://pypi.org/project/titlecase/), which allows the
titlecase core logic to be externally maintained.
If there's not enough draw to have this as a core plugin, I can also
spin this into an independent one, but it seemed like a recurring theme
that the %title string format didn't really behave as expected, and I
wanted my metadata to match too.
- [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. - Not 100% coverage, but didn't see a lot of other plugins
with testing for import stages.
Create a custom Sphinx extension to document configuration values with
a simplified syntax. It is based on the `confval` but takes less space
when rendered. The extension provides:
- A `conf` directive for documenting individual configuration values
with optional type and default parameters
- A `conf` role for cross-referencing configuration values
- Automatic formatting of default values in the signature
- A custom domain that handles indexing and cross-references
For example, if we have
.. conf:: search_limit
:default: 5
We refer to this configuration option with :conf:`plugins.discogs:search_limit`.
The extension is loaded by adding the docs/extensions directory to the
Python path and registering it in the Sphinx extensions list.
avoid linter error
avoid other linter error
fix format
changing deps (no lock!)
poetry lock?
lint & format
attempt 2 at poetry lock
crlf -> lf line endings
changelog!
- Replaced unittest.mock with pytest fixtures for better test isolation and readability.
- Simplified test cases by using parameterized tests.
- Added `requests-mock` dependency to `pyproject.toml` and `poetry.lock`.
- Removed redundant helper functions and classes.
Seems like readthedocs build expects docs dependencies to be available
as an extra, see one of the failing builds: https://app.readthedocs.org/projects/beets/builds/26079213/.
You can see this has been failing due to missing 'pydata_sphinx_theme':
raise ThemeError(__('no theme named %r found (missing theme.toml?)') % name)
sphinx.errors.ThemeError: no theme named 'pydata_sphinx_theme' found (missing theme.toml?)
Theme error:
no theme named 'pydata_sphinx_theme' found (missing theme.toml?)
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.
Unfortunately tox does not play very nicely with Poetry. Tox was mostly
useful since it managed virtual environments, however now this is done
by Poetry.
Thus we do not anymore need it since we can run our commands using
`poetry run`. I have extended the internal helper tool 'project' with
those commands that have previously been run using tox.