The overall principle I would follow is document things unique to beets while give less/no detail on general development / Python development.
If I get a handle on the content and formatting, I can put some of this information into the docs.
How do I run tests?
I got this set up in VS Code but I’m not clear on the relationship between tox and individual Python testing packages. I get that Tox is a meta framework for testing across ex. different platforms but I don’t know what it uses to run actual *test*.py files. Are devs able to replicate the Github actions / test process on their on PCs?
How do I contribute to beets?
In the docs I don’t see any direct reference to how you contribute to the beets core.
Can I install every package called by the test files at once?
Bonus points if I can call this dynamically so the docs are never out of date. I think this is the full list, perfect for requirements.txt. But it was generated from test logs so it could be incomplete.
discogs_client
flask
mock
# for acoustid
pyacoustid
# for mpd
python-mpd2
pylast
requests_oauthlib
responses
xdg
What is a good dev workflow?
Okay, this may be more of a general Python question. I installed an editable clone of beets, per the FAQ, but it feels taped-together. I installed it overtop the old install I had installed the same way and it seems to work for now.
The short answer is that yes, running tox is supposed to reproduce exactly what happens on CI. The longer answer is that tox runs commands from tox.ini:
…which are probably best referred to there rather than duplicating in the documentation? That way, we can change them without the risk of the docs getting out of date.
Hmm; this should have been added to the docs in this PR:
But I don’t think it’s showing up? I don’t immediately see why.
The best way is to use tox, which takes care of installing dependencies for you. Another way is to pip install beets[test] or similar.
We do have some instructions in the contributing guide:
I finally got the whole thing working in a VirtualBox of Lubuntu 20.04. Full test suite is a bit sluggish, as you might expect. I need to add more cores than the default 1 to my VM.
Some pitfalls:
Must install all prerequisite packages. Tox did not manage this for me. pip install beets[test] works. (Not 100% sure on whether to do install -U or without -U. sudo is probably a terrible idea here because it would install system level packages not tracked by your package manager.)
I don’t recommend Windows. WSL is a maybe. (After figuring out #3 it does seem to work… haven’t decided where I’m going to set up shop as a real dev environment.) I have a very bootleg make from Cygwin on my Windows and between Cygwin, pip, and all the dependencies, it seems like a crapshoot getting them all to play nice. Maybe a venv would help?
Had to reset my PATH. Your PATH must contain everything pip installs (ex. flask) and when I ran step 1, my shell didn’t reset to get the new PATH folders in my user folder.
The tox output is not helpful for why it’s failing to run. If you run into issues run it in -vv (or -vvvv) mode, and probably check the /tests/ folder in the beets repo.