Setting up dev environment for vak

Hello all :slight_smile:
I’m trying to set a development environment with vak (for some fiddling and learning) and having trouble setting it up using conda. I would appreciate any help!

I’ve cloned the repository, installed (via conda) all requirements, and ran:
‘conda develop <path_to_local_repo>’.
Still, my computer didn’t recognize the word ‘vak’, nor I managed to run the module directly via python -m.

I then tried to conda build* the project, which took several hours and yet yielded no different results.

The vak docs suggest using make command, but I didn’t find any makefile to be run on the repository.

What is the correct way to create such a copy?

Thank you, and hello again :slight_smile:
Itamar

P.s:
*While trying to build I had to remove the version number assertion on the conda.recipe for crowsetta, as it said it is ‘unsatisfiable’ on my linux machine. It is at 1.1.1 which my conda couldn’t find (only newer versions).

1 Like

Hi @Itamar.F and welcome to the forums!

I’m trying to set a development environment with vak (for some fiddling and learning) and having trouble setting it up using conda.

Sorry you’re having such a hard time setting up a dev environment.

The vak docs suggest using make command, but I didn’t find any makefile to be run on the repository.

You are right that this documentation is out of date, and I need to fix it.

Could you please raise an issue on the pointing out we need to update this section of the contributors guide?

In the meantime:
We are using nox instead of Make to run tasks like setting up development environments. We’ve adopted this tool because it’s platform agnostic and Python is a lot easier to read and work with. It’s recommended by projects like SciKit-HEP (Redirecting…) and used by many core Python projects like pip.

To use nox to set up a dev environment, please follow these directions from the songdkl repo (GitHub - NickleDave/songdkl: automated quantitation of vocal learning in the songbird) (I knew I had documented it in at least one repo :flushed: :sweat_smile: )

as a developer

This project uses the library nox as a task runner, to automate tasks like setting up a development environment. Each task is represented as what nox calls a “session”, and you can run a session by invoking nox at the command-line with the name of the session.

So, to set up a virtual environment for development with songdkl installed in “editable” mode, run the “dev” session.

We suggest using pipx to install nox in an isolated environment, so that nox can be accessed system-wide without affecting anything else on your machine.

  1. Install pipx, e.g. with brew (and brew works on Linux too)
  2. Install nox with pipx: pipx install nox
  3. Use nox to run the dev session: nox -s dev
  4. Activate the virtual environment: . ./.venv/bin/activate (and/or tell your IDE to use it)
1 Like

I’m trying to set a development environment with vak (for some fiddling and learning) and having trouble setting it up using conda. I would appreciate any help!

Just so it’s clear, we don’t use conda to develop. We develop in plain old vanilla Python virtual envs so we can be sure it will work there first, and then provide conda packages because people expect them. It’s unfortunate for newbies that there are two ways to do everything in the ecosystem but here we are. (Not saying you’re a newbie, I’m just saying I don’t like having more than one way to do everything even if there were good reasons for it historically. Even expert developers get confused by it, case in point this topic right here.)

1 Like

Guessing you saw but just for completeness replying here too:
I did fix the dev instructions in this pull request, DOC: Fix instructions to set up dev env, fixes #591 by NickleDave · Pull Request #592 · vocalpy/vak · GitHub, and added you as a contributor, thank you @Itamar.F for catching that

Fixed dev env instructions are now live here: