Open AnirudhG07 opened 1 day ago
Hi @AnirudhG07,
I think this is usually done by installing your package in a virtual environment in an editable mode (so that any changes that you make are immediately reflected), and then you can refer to your package and modules from your tests as you normally would (e.g. bept.something
).
For example if you use pytest
uv venv
uv pip install --editable .
. .venv/bin/activate
pytest
If you use the more modern workflow that uv
shipped in version 0.4, I think simply running your test command via uv run
should take care of all that automatically. (but I don't have that much experience here)
(not affiliated with astral team, just passing by :-))
Alright. Thanks, ill try it out
But still is there a way i can change bept.something
to src.bept.something
?
Hi, thanks for the amazing tool
uv
. I am making a python package bept for some project. I am new to python packages and I wanted to know that in my src/bept/main.py, I am usingbept.something.somefile
, but is there a way i can dosrc.bept.something
, that way I would be able to access some files outside ofsrc
. (or is there any other way for it? main goal: have test directory use codes in src.) I know its a bit case specific, but some help would be really appreciated!Current version of uv = 0.4.15