annetutil / annet

MIT License
35 stars 12 forks source link

Problem with executuion in local repository #64

Open anteron1992 opened 4 weeks ago

anteron1992 commented 4 weeks ago

Hello, Team!

I've faced with wierd issue with annet executuion within repo directory. As assumed annet had should use local files instead venv site-pakages, but something went wrong. What I did:

~/annet > python3.10 -m venv .venv
~/annet > source .venv/bin/activate
~/annet > which python3
.venv/bin/python3
~/annet > python3 -m pip install .
~/annet > export NETBOX_URL= ...
~/annet > export NETBOX_TOKEN= ...
~/annet > which annet
/Users/anteron/annet/.venv/bin/annet
~/annet > annet gen -g lldp ...

And I get a traceback files from .venv, like:

Traceback (most recent call last):
  File "venv/lib/python3.10/site-packages/annet/annlib/netdev/views/hardware.py", line 33, in __getattr__
    return self.__dict__[name]
 ...
 ...

But if check import from root of project, it seems all right:

~/annet > python3 -c'import annet.annlib.netdev.devdb; print(annet.annlib.netdev.devdb.__file__);'
/Users/anteron/annet/annet/annlib/netdev/devdb/__init__.py

After every changes into directory I need to reinstall package, it's so unconvient. And I don't know why python use installed package files instead direct files into git project directory. Versions: Python 3.10.14, pip 24.1.2

azryve commented 3 weeks ago

@Tishka17 i think it was fixed in annetbox, right?