File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 11.PHONY : test clean
22
3+ VENV_ACTIVATE := venv/bin/activate
4+
35# Default target
46test : setup-venv install-test-deps run-tests
57
68# Check if we're in a virtual environment and create one if not
79setup-venv :
810 @echo " Checking virtual environment..."
9- @if [ -z " $$ VIRTUAL_ENV " ]; then \
11+ @if [ ! -e " $( VENV_ACTIVATE ) " ]; then \
1012 echo " No virtual environment detected. Creating one..." ; \
1113 python3 -m venv venv; \
12- echo " Virtual environment created. Please activate it with: source venv/bin/activate" ; \
13- echo " Then run 'make test' again." ; \
14- exit 1; \
14+ echo " Virtual environment created" ; \
1515 else \
16- echo " Virtual environment detected: $$ VIRTUAL_ENV " ; \
16+ echo " Virtual environment detected: " $( VENV_ACTIVATE ) " " ; \
1717 fi
1818
1919# Install test requirements
2020install-test-deps :
2121 @echo " Installing test requirements..."
22- @pip install -r test_requirements.txt
22+ @. " $( VENV_ACTIVATE ) " && pip install -r test_requirements.txt
2323
2424# Run the tests
2525run-tests :
2626 @echo " Running tests..."
27- @python run_tests.py
27+ @. " $( VENV_ACTIVATE ) " && python run_tests.py
2828
2929# Clean up generated files
3030clean :
You can’t perform that action at this time.
0 commit comments