Skip to content

Commit

Permalink
Use venv python
Browse files Browse the repository at this point in the history
  • Loading branch information
gsarti committed Feb 16, 2024
1 parent 7e414a1 commit c8225b7
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#* Variables
SHELL := /usr/bin/env bash
PYTHON := python3
PYTHON := .venv/bin/python

#* Docker variables
IMAGE := inseq
Expand Down Expand Up @@ -42,7 +41,7 @@ uv-download:
.PHONY: uv-activate
uv-activate:
@if [[ "$(OS)" == "Windows_NT" ]]; then \
./uv/Scripts/activate.ps1 \
./uv/Scripts/activate.ps1; \
else \
source .venv/bin/activate; \
fi
Expand Down Expand Up @@ -70,39 +69,39 @@ update-deps:
#* Linting
.PHONY: check-style
check-style:
ruff format --check --config pyproject.toml ./
ruff check --no-fix --config pyproject.toml ./
# pydoclint --config pyproject.toml inseq/
# mypy --config-file pyproject.toml ./
$(PYTHON) -m ruff format --check --config pyproject.toml ./
$(PYTHON) -m ruff check --no-fix --config pyproject.toml ./
# $(PYTHON) -m pydoclint --config pyproject.toml inseq/
# $(PYTHON) -m mypy --config-file pyproject.toml ./

.PHONY: fix-style
fix-style:
ruff format --config pyproject.toml ./
ruff check --config pyproject.toml ./
$(PYTHON) -m ruff format --config pyproject.toml ./
$(PYTHON) -m ruff check --config pyproject.toml ./

.PHONY: check-safety
check-safety:
safety check --full-report
$(PYTHON) -m safety check --full-report

.PHONY: lint
lint: fix-style check-safety

#* Linting
.PHONY: test
test:
pytest -c pyproject.toml -v
$(PYTHON) -m pytest -c pyproject.toml -v

.PHONY: test-cpu
test-cpu:
pytest -c pyproject.toml -v -m "not require_cuda_gpu"
$(PYTHON) -m pytest -c pyproject.toml -v -m "not require_cuda_gpu"

.PHONY: fast-test
fast-test:
pytest -c pyproject.toml -v -m "not slow"
$(PYTHON) -m pytest -c pyproject.toml -v -m "not slow"

.PHONY: codecov
codecov:
pytest --cov inseq --cov-report html
$(PYTHON) -m pytest --cov inseq --cov-report html

#* Docs
.PHONY: build-docs
Expand Down

0 comments on commit c8225b7

Please sign in to comment.