@@ -15,32 +15,38 @@ RESET := \033[0m
1515.DEFAULT_GOAL := help
1616
1717# Declare phony targets (they don't produce files)
18- .PHONY : install-task install clean test fmt
18+ .PHONY : install install-uv test fmt
1919
20- UV_INSTALL_DIR := " ./bin"
20+ UV_INSTALL_DIR := ./bin
2121
2222# #@ Bootstrap
23- install-task : # # ensure go-task (Taskfile) is installed
23+ install-uv : # # ensure uv (and uvx) are installed locally
2424 @mkdir -p ${UV_INSTALL_DIR}
25-
26- @if [ ! -x "${UV_INSTALL_DIR}/task" ]; then \
27- printf "$(BLUE)Installing go-task (Taskfile)$(RESET)\n"; \
28- curl --location https://taskfile.dev/install.sh | sh -s -- -d -b ${UV_INSTALL_DIR}; \
25+ @if [ -x " ${UV_INSTALL_DIR} /uv" ] && [ -x " ${UV_INSTALL_DIR} /uvx" ]; then \
26+ : ; \
27+ else \
28+ printf " ${BLUE} Installing uv${RESET} \n" ; \
29+ curl -LsSf https://astral.sh/uv/install.sh | UV_INSTALL_DIR=${UV_INSTALL_DIR} sh 2> /dev/null || { printf " ${RED} [ERROR] Failed to install uv ${RESET} \n" ; exit 1; }; \
2930 fi
3031
31- install : install-task # # install
32- @./bin/task build:install --silent
32+ install : install-uv # # install
33+ @printf " ${BLUE} [INFO] Creating virtual environment...${RESET} \n"
34+ # Create the virtual environment
35+ @./bin/uv venv --python 3.12 || { printf " ${RED} [ERROR] Failed to create virtual environment${RESET} \n" ; exit 1; }
36+ @printf " ${BLUE} [INFO] Installing dependencies${RESET} \n"
37+ @./bin/uv sync --all-extras --frozen || { printf " ${RED} [ERROR] Failed to install dependencies${RESET} \n" ; exit 1; }
3338
34- clean : install-task # # clean
35- @./bin/task cleanup:clean --silent
3639
3740# #@ Development and Testing
38- test : install-task # # run all tests
39- @./bin/task docs:test --silent
40-
41- fmt : install-task # # check the pre-commit hooks and the linting
42- @./bin/task quality:lint --silent
43-
41+ test : install # # run all tests
42+ @printf " ${BLUE} [INFO] Running tests...${RESET} \n"
43+ @./bin/uv pip install pytest pytest-cov pytest-html
44+ @mkdir -p _tests/html-coverage _tests/html-report
45+ @./bin/uv run pytest tests --cov=pypfopt --cov-report=term --cov-report=html:_tests/html-coverage --html=_tests/html-report/report.html
46+
47+ fmt : install-uv # # check the pre-commit hooks and the linting
48+ @./bin/uvx pre-commit run --all-files
49+ @./bin/uvx deptry .
4450
4551# #@ Meta
4652help : # # Display this help message
0 commit comments