Skip to content

Commit

Permalink
Merge pull request #70 from geigerzaehler/g/modernize
Browse files Browse the repository at this point in the history
Modernize project tools
  • Loading branch information
wisp3rwind committed May 2, 2023
2 parents 288299e + 14f5cf0 commit a69117c
Show file tree
Hide file tree
Showing 15 changed files with 1,231 additions and 569 deletions.
3 changes: 3 additions & 0 deletions .flake8
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 88
extend-ignore = E203
47 changes: 47 additions & 0 deletions .github/workflows/main.yaml
@@ -0,0 +1,47 @@
name: Check and test

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
python-version:
- "3.8" # minimum required
- "3.11" # latest
- "3.12-dev" # next

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- run: pip install poetry
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- run: poetry env use $(which python)
- run: poetry install
- run: poetry run black --check .
- run: poetry run isort --check .
- run: poetry run flake8
- run: poetry run pytest
- uses: coverallsapp/github-action@v2
if: github.event_name == 'pull_request' && matrix.python-version == '3.8'

build-beets-master:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- run: pip install poetry
- uses: actions/setup-python@v3
with:
python-version: 3.8
cache: poetry
- run: poetry env use $(which python)
- run: poetry install
# We cannot use `poetry add` because poetry does not install beets
# dependencies properly
- run: poetry run pip install "git+https://github.com/beetbox/beets#master"
- run: poetry run pytest
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,10 @@
Change Log
==========

## Upcoming
* Drop support for Python 2. Require Python >= 3.8
* Require beets >= 1.6.0

## v0.10.2 - 2020-07-15
* Add `beet alt list-tracks` command
* SymlinkView: Fix stale symlinks not being removed when files are moved in the
Expand Down
28 changes: 17 additions & 11 deletions DEVELOPING.md
@@ -1,28 +1,34 @@
Developer Guide
===============
# Developer Guide

Releasing
---------
This project uses [Poetry][] for packaging and dependency management.

We’re using the following tools to ensure consistency and quality

- [black](https://github.com/psf/black)
- [isort](https://github.com/PyCQA/isort)
- [flake8](https://github.com/PyCQA/flake8)
- [pytest](https://docs.pytest.org/)

[poetry]: https://python-poetry.org/

## Releasing

To release a new version of this project follow these steps:

1. Replace the “Upcoming” heading of the changelog with the new version number
and date of release.
2. Update the version in `setup.py`
2. Update the version in `pyproject.toml`
3. Commit the changes with the commit message “Release vX.Y.Z” to `master`.
4. Tag the master branch with a signed and annotated tag: `git tag -as vX.Y.Z`.
Use the version and date as the tag title and the changelog entry as the tag body. E.g.

```
v0.10.0 - 2019-08-25
* Symlink views now support relative symlinks (@daviddavo)
```

5. Push the master branch and tag with `git push --tags`
6. Create a release on Github using the version as the title and the changelog
entries as the description.
7. Upload the new version to PyPI with the following commands
```
rm dist
python3 setup.py sdist
twine upload dist/*
```
7. Publish the new version to PyPI with `poetry publish`.
52 changes: 28 additions & 24 deletions README.md
@@ -1,7 +1,7 @@
beets-alternatives
==================

[![Build Status](https://travis-ci.org/geigerzaehler/beets-alternatives.svg?branch=master)](https://travis-ci.org/geigerzaehler/beets-alternatives)
[![Check and test](https://github.com/geigerzaehler/beets-alternatives/actions/workflows/main.yaml/badge.svg)](https://github.com/geigerzaehler/beets-alternatives/actions/workflows/main.yaml)
[![Coverage Status](https://coveralls.io/repos/github/geigerzaehler/beets-alternatives/badge.svg?branch=master)](https://coveralls.io/github/geigerzaehler/beets-alternatives?branch=master)

You want to manage multiple versions of your audio files with beets?
Expand All @@ -12,13 +12,17 @@ symlink your audio to other locations?
With this [beets][beets-docs] plugin every file in you music library have
multiple alternate versions in separate locations.

If you’re interested in contributing to this project, check out the [developer
documentation](./DEVELOPING.md).

Getting Started
---------------

You will also need at least version 1.4.7 of beets.
Install the plugin and make sure you using at least version 1.6.0 of beets and
Python 3.8.

```
pip install --upgrade beets>=1.4.7 beets-alternatives
```bash
pip install --upgrade beets>=1.6.0 beets-alternatives
```

Then, [enable the plugin][using plugins]. You may use the `beet config --edit`
Expand Down Expand Up @@ -65,15 +69,15 @@ from the `query` option. (Since we use boolean values for the
‘onplayer’ field it might be a good idea to set the type of this field
to `bool` using the *types* plugin)

```
$ beet modify onplayer=true artist:Bach
```bash
beet modify onplayer=true artist:Bach
```

The configured query also matches all tracks that are part of an album
where the `onplayer` attribute is ‘true’. We could also use

```
$ beet modify -a onplayer=true albumartist:Bach
```bash
beet modify -a onplayer=true albumartist:Bach
```

We then tell beets to create the external files.
Expand All @@ -88,30 +92,29 @@ The question makes sure that you don’t recreate a external collection
if the device is not mounted. Since this is our first go, we answer the
question with yes.

The command will copy all files with the artist ‘Bach’ and format
either ‘AAC’ or ‘MP3’ to the `/player` directory. All other formats
will be transcodec to the ‘AAC’ format unsing the [*convert* plugin][].
The transcoding process can be configured through [*convert’s*
configuration][convert config].
The command will copy all files with the artist ‘Bach’ and format either ‘AAC’
or ‘MP3’ to the `/player` directory. All other formats will be transcodec to the
‘AAC’ format unsing the [*convert* plugin][convert plugin]. The transcoding
process can be configured through [*convert’s* configuration][convert config].

If you update some tracks in your main collection, the `alt update`
command will propagate the changes to your external collection. Since
we don’t need to convert the files but just update the tags, this will
be much faster the second time.

```
$ beet modify composer="Johann Sebastian Bach" artist:Bach
$ beet alt update myplayer
```bash
beet modify composer="Johann Sebastian Bach" artist:Bach
beet alt update myplayer
```

After going for a run you mitght realize that Bach is probably not the
right thing to work out to. So you decide to put Beethoven on your
player.

```
$ beet modify onplayer! artist:Bach
$ beet modify onplayer=true artist:Beethoven
$ beet alt update myplayer
```bash
beet modify onplayer! artist:Bach
beet modify onplayer=true artist:Beethoven
beet alt update myplayer
```

This removes all Bach tracks from the player and adds Beethoven’s.
Expand Down Expand Up @@ -147,7 +150,7 @@ still add a query to select only parts of your collection.
The `beet alt update by-year` command will now create the symlinks. For
example

```
```plain
/music/by-year/1982/Thriller/Beat It.mp3
-> /music/Michael Jackson/Thriller/Beat It.mp3
```
Expand All @@ -166,7 +169,8 @@ alternatives:
```

With this config, the `beet alt update by-year` command will create relative symlinks. E.g:
```

```plain
/music/by-year/1982/Thriller/Beat It.mp3
-> ../../../Michael Jackson/Thriller/Beat It.mp3
```
Expand All @@ -177,7 +181,7 @@ will continue working
CLI Reference
-------------

```
```plain
beet alt update [--create|--no-create] NAME
```

Expand Down Expand Up @@ -271,7 +275,7 @@ The following is a list of things I might add in the feature.
License
-------

Copyright (c) 2014 Thomas Scholtes.
Copyright (c) 2014-2023 Thomas Scholtes.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"), to
Expand Down
1 change: 1 addition & 0 deletions beetsplug/__init__.py
@@ -1,2 +1,3 @@
from pkgutil import extend_path

__path__ = extend_path(__path__, __name__)

0 comments on commit a69117c

Please sign in to comment.