Commit graph

59 commits

Author SHA1 Message Date
Šarūnas Nejus
8e237d62c8
Make LazyClassProperty / cached_classproperty reusable 2024-06-21 08:49:10 +01:00
Šarūnas Nejus
2800a323a2
Revert "Make queries fast, filter all flexible attributes (#5240)"
This reverts commit 143b9202f3, reversing
changes made to 8508a57d77.
2024-06-19 21:51:44 +01:00
Šarūnas Nejus
265e40b14e
Make LazyClassProperty / cached_classproperty reusable 2024-06-16 14:20:07 +01:00
Šarūnas Nejus
6b63a3090d
Remove flake8 docstrings and its exclusion rules (#5234) 2024-06-16 02:55:49 +01:00
Šarūnas Nejus
3e075f2a9a
Add 'test-with-coverage' command
And do not measure coverage by default.
2024-06-15 23:52:18 +01:00
Šarūnas Nejus
fa788e2e5a
Remove flake8-docstrings and its exclusion rules 2024-06-15 13:09:33 +01:00
Šarūnas Nejus
09b67c1da6
Ignore aura.py/flake8-docstrings 2024-06-14 20:12:19 +01:00
Šarūnas Nejus
347911cdee
Introduce Poe the Poet task runner and define tasks.
This makes it easier for people to interact with the project in
a unified manner.
2024-06-10 13:46:25 +01:00
Šarūnas Nejus
c75f07a0da Define paths to lint in mypy configuration 2024-05-07 21:16:24 +01:00
Šarūnas Nejus
1713011089 Move mypy configuration to setup.cfg 2024-05-07 21:16:24 +01:00
Šarūnas Nejus
8b4983fe7c
Add pytest and coverage configuration
Add `pytest-cov` which automatically measures coverage while tests are
executing and update tox and ci build configuration accordingly.

Add configuration for coverage:
  1. Enable analysing logical branches
  2. Save coverage details as HTML for local development use
  3. Configure the HTML output to include coverage context: on the
     right-hand side of each covered code line there is an expandable
     section which lists every test that ran that line.
2024-05-04 10:24:28 +01:00
Serene-Arc
35257c7cd0 Exclude flake8 rule for black compatibility 2024-03-01 15:34:50 +10:00
Lars Kruse
508d28f66b tests: move reusable test-related modules into the beets package
External Python packages interfacing beets may want to use an in-memory
beets library instance for testing beets-related code.
The `TestHelper` class is very helpful for this purpose.
Previously `TestHelper` was located in the `test/` directory.
Now it is part of `beets` itself (`beets.test.helper.TestHelper`) and
can be easily imported.
2024-01-15 19:40:57 +01:00
Serene-Arc
15d7d2a7f6 Make flake8 black compatible 2023-10-22 09:50:33 +10:00
Adrian Sampson
5dee3e6ef4
Ignore docs warnings in all test files
These references were out-of-date as of #4951. Not sure why we were
listing these individually in the first place; it's not like we want to
be strict about docstrings in tests...
2023-10-20 15:28:12 -04:00
tandy1000
7961cf3aaa Add autobpm plugin
This plugin uses librosa to automatically calculate the BPM for a track.
It is based on the keyfinder plugin, and rounds the BPM to an int.

Co-authored-by: Adrian Sampson <adrian@radbox.org>
2023-09-30 16:25:06 +01:00
Adrian Sampson
abc3dfbf42
Reformat flake8 config comments
A recent release of flake8 broke the syntax we were using for comments:
https://github.com/pycqa/flake8/issues/1689#issuecomment-1326319235

It requires comments to be on their own lines.
2022-11-28 07:58:01 -08:00
patrick-nicholson
c3829c52c8 Lint ignore. 2021-12-27 13:38:20 -05:00
patrick-nicholson
a3754f7592 Test failing due to unidentified argument processing issue; replacing with API calls gives expected results.
Fixed some linting issues.
2021-12-27 13:26:38 -05:00
Andrew Rogl
277f4e72d1 Remove unrequired flake8 checks 2021-08-27 08:26:07 +10:00
Andrew Rogl
e262766580 pyupgrade root 2021-08-25 15:27:16 +10:00
Adrian Sampson
8d3cfe46ed
Ignore a new pep8-naming error
The new error <https://github.com/PyCQA/pep8-naming/pull/157> strikes me
as a little overzealous: while most exceptions are errors, there are
some Exception subclasses that are *not* properly considered errors
(e.g., when they're only a base class for other error classes).
2021-07-15 09:52:43 -04:00
Jacob Pavlock
4e93469421 fix missing docstring-convention declaration 2020-07-29 20:32:53 -07:00
Jacob Pavlock
019055c156 add docstring checks to flake8
currently ignore all errors on a per-file basis
2020-07-29 17:21:15 -07:00
Jacob Pavlock
52afd717aa remove docstring-convention and update comment 2020-07-11 19:10:04 -07:00
Jacob Pavlock
124c882b4d un-ignore E221 2020-07-11 18:33:08 -07:00
Jacob Pavlock
abad0f9c08 un-ignore flake8 E226, E242, E704
none of these required any code changes
2020-07-11 18:22:43 -07:00
Jacob Pavlock
1db46dfeb6 reformat flake8 errors 2020-07-11 18:15:41 -07:00
Jacob Pavlock
dabde74683 nose -> pytest and clean-up tox 2020-07-06 17:03:11 -07:00
Adrian Sampson
966108b72c Enable flake8 E226
This is the rule that prohibits `1+2` in favor of `1 + 2`. I didn't
realize it was disabled by default!
2018-08-13 10:37:45 -04:00
Adrian Sampson
7c9ce0da7a Ignore yet another new flake8 error
As described in PyCQA/pycodestyle#598, pycodestyle has exposed a new
error for "ambiguous variable names." I really wish this project were
less eager to add new warnings of questionable value that are enabled by
default...
2017-10-29 16:29:06 -04:00
zigarrre
e30513db9b Added the default ignore list of flake8
This fixes the W503 warnings and possibly other, unwanted errors and
warnings in the future.
2017-09-12 18:19:18 +02:00
Adrian Sampson
4c6bf782a2 Ignore a new flake8 style warning
It's always fun when the style checker suddenly decides something new is bad
style. :/
2016-11-16 12:01:37 -05:00
Johnny Robeson
08cd22834b add flake8-coding to our tox config
Now we can enforce that all py files have the coding magic comment with
utf-8.
2016-08-07 04:09:58 -04:00
Johnny Robeson
e1d1d7b026 remove eval-attr for slow tests in setup.cfg
The code that relied on this in the tests was removed in 84c82cc44b

I don't think this was a good global option anyways, so I don't see us
returning to it.

This was discovered by @JesseWeinstein
2016-07-21 01:58:08 -04:00
Johnny Robeson
167544bcbe add F405 to flake8 ignore list 2016-06-16 02:43:01 -04:00
Johnny Robeson
7ab0964826 add C901 (function complexity)to flake8 ignore list
I'm adding this both as a TODO item and to work around flake8 preferring
global ($HOME) configuration over project
2016-06-03 16:10:31 -04:00
Jack Wilsdon
10ce4fa8c5 Re-add min-version for flake8 in setup.cfg 2016-06-03 02:44:37 +01:00
Jack Wilsdon
82df8d18df Update tox configuration
- Add support for Python 3 testing.
 - Add Python 3.3, 3.4 and 3.5 tests to Travis and AppVeyor.
 - Allow arguments to be passed to tox from test matrix.
 - Simplify tox configuration so that we now only have `test`, `flake8`
   and `docs` tasks.
2016-06-03 00:46:02 +01:00
Johnny Robeson
32d4545b5e set min-version to 2.7 in setup.cfg 2016-05-30 16:32:34 -04:00
Jack Wilsdon
205f868a20 Add description for all errors we ignore 2016-04-16 01:26:47 +02:00
Adrian Sampson
53b5faf7a8 Add __future__ import style checker
This adds the [flake8-future-import][f] plugin for flake8, which enforces the
standard set of `__future__` imports at the top of all Python files. This
revealed a fair number of files that need to be fixed.

To be revisited after #1887 is merged.

[f]: https://github.com/xZise/flake8-future-import
2016-04-16 01:26:47 +02:00
Adrian Sampson
e7f8a627e9 Style fixes for pep8 1.6 2015-02-07 12:51:54 -08:00
Fabrice Laporte
356c1f44b5 nosetests: don't run slow tests by default 2014-11-06 22:46:42 +01:00
Thomas Scholtes
98ae8cbbc9 Make tests conform to PEP8 2014-09-09 22:31:46 +02:00
Adrian Sampson
908584bde8 Revamp FormattedItemMapping
This subclass was not cleanly conforming to the Mapping abstract base. Now
we're in business -- the thing looks like a dict. Brought up by #782.
2014-05-20 16:24:40 -07:00
Adrian Sampson
5f4a9c6446 fix Windows path manipulation in importfeeds 2014-04-18 15:52:23 -07:00
Thomas Scholtes
a6aed22ddd Flake8 fixes 2014-04-17 12:25:59 +02:00
Thomas Scholtes
4b012e5ddf Import tests use TestHelper
Removes duplicate code, increases speed and makes some files clake8 clean.
2014-04-15 14:57:01 +02:00
Adrian Sampson
03bea61ac0 commands.py is flake8-clean 2014-04-14 10:53:32 -07:00