unibe-cns / NEAT

NEAT (NEural Analysis Toolkit)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not execute tests without installing

jakobj opened this issue · comments

when executing pytest in the NEAT top folder or the test subfolder the neat package is not found. we should make sure one can execute the tests even without installing NEAT as this avoids one annoying step during development. An easy solution would be to manually alter the path variable (e.g., import sys; sys.path.insert(0, '../')), but maybe there is a better way @WillemWybo @benelot ?

[edit]
apparently these lines are better, since they drop the dependence on where pytest is executed:

import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

[/edit]

[edit2]
apparently the preferred way to approach this is to make editable installs, e.g., https://stackoverflow.com/questions/35064426/when-would-the-e-editable-option-be-useful-with-pip-install, not manually edit the path variable. guess we should follow this best practice
[/edit2]

I'm not sure how that would work with the compilation of ion channels and the c code? Surely, this is the time-intensive step...

i guess this only works for changes in the .py files, changes in .h/.cpp will only show up once one recompiles. i guess the latter is unavoidable when working with a compiled language