# Request: Updated dev guide

**URL:** <https://discourse.beets.io/t/request-updated-dev-guide/1527>\
**Category:** Development\
**Created:** [September 30, 2020, 1:15am UTC](https://discourse.beets.io/t/request-updated-dev-guide/1527 "2020-09-30T01:15:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RollingStar](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/rollingstar/32/728_2.png) [@RollingStar](https://discourse.beets.io/u/RollingStar)\
**Post date:** [September 30, 2020, 1:15am UTC](https://discourse.beets.io/t/request-updated-dev-guide/1527/1 "2020-09-30T01:15:15Z")

</div>

Seems there is some knowledge that isn’t in the dev guide itself. [https://beets.readthedocs.io/en/stable/dev/index.html](https://beets.readthedocs.io/en/stable/dev/index.html)

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.

1. How do I run tests?

I got this [set up in VS Code](https://code.visualstudio.com/docs/python/testing) 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?

1. How do I contribute to beets?

In the docs I don’t see any direct reference to how you contribute to the beets core.

1. 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.

```auto
discogs_client
flask
mock
# for acoustid
pyacoustid
# for mpd
python-mpd2
pylast
requests_oauthlib
responses
xdg

```

1. 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,](https://beets.readthedocs.io/en/stable/faq.html#run-the-latest-source-version-of-beets) 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.

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [September 30, 2020, 1:25pm UTC](https://discourse.beets.io/t/request-updated-dev-guide/1527/2 "2020-09-30T13:25:48Z")

</div>

> [@RollingStar](#):
>
> I got this [set up in VS Code](https://code.visualstudio.com/docs/python/testing) 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?

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`:

> <https://github.com/beetbox/beets/blob/master/tox.ini#L21>

…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.

> [@RollingStar](#):
>
> In the docs I don’t see any direct reference to how you contribute to the beets core.

Hmm; this should have been added to the docs in this PR:

> <https://github.com/beetbox/beets/pull/3680>
>
> \## Description
> 
> This does a few things:
> 1. Converts CONTRIBUTING.md to CONTRI…BUTING.rst - this allows it to be in the docs
> 2. Adds CONTRIBUTING.rst to the docs
> 3. Adds the Testing wiki to CONTRIBUTING.rst
> 4. Adds a table of contents to the top of CONTRIBUTING.rst

But I don’t think it’s showing up? I don’t immediately see why.

> [@RollingStar](#):
>
> Can I install every package called by the test files at once?

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.

> [@RollingStar](#):
>
> What is a good dev workflow?

We do have some instructions in the contributing guide:

> <https://github.com/beetbox/beets/blob/master/CONTRIBUTING.rst#getting-the-source>

---

<div class="post-metadata">

**Author:** ![RollingStar](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/rollingstar/32/728_2.png) [@RollingStar](https://discourse.beets.io/u/RollingStar)\
**Post date:** [October 1, 2020, 3:29am UTC](https://discourse.beets.io/t/request-updated-dev-guide/1527/3 "2020-10-01T03:29:12Z")

</div>

Thanks. I needed to `pip install -U sphinx` on WSL Ubuntu before I could run tox.

---

<div class="post-metadata">

**Author:** ![RollingStar](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/rollingstar/32/728_2.png) [@RollingStar](https://discourse.beets.io/u/RollingStar)\
**Post date:** [October 9, 2020, 1:42am UTC](https://discourse.beets.io/t/request-updated-dev-guide/1527/4 "2020-10-09T01:42:17Z")

</div>

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:

1. 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.)
2. 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?
3. 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.
4. 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.

---

<div class="post-metadata">

**Author:** ![RollingStar](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/rollingstar/32/728_2.png) [@RollingStar](https://discourse.beets.io/u/RollingStar)\
**Post date:** [October 11, 2020, 10:22pm UTC](https://discourse.beets.io/t/request-updated-dev-guide/1527/5 "2020-10-11T22:22:44Z")

</div>

Is it possible to add sphinx (and maybe tox, if it’s not in there already) to the same suite that is installed with `pip install beets[test]`?

edit: I can’t get tox to run a specific test. The test correctly shows as failed when I run `tox` on the whole suite.

This was of no use to me. :\ [https://stackoverflow.com/questions/35697353/how-to-run-only-one-test-in-tox](https://stackoverflow.com/questions/35697353/how-to-run-only-one-test-in-tox)

I can run `python3 -m pytest -q test_files.py` which does what I need in this early phase.
