all: doc

##########
tests:
	pip install -e ".[tests]"
	echo make sure you use the uv virtual env - see tests/AA-SETUP.md
	pytest

.PHONY: tests

########## sphinx
doc:
	$(MAKE) -C sphinx html

doc-clean:
	$(MAKE) -C sphinx clean

.PHONY: doc doc-clean

##########
pyfiles:
	@git ls-files | grep '\.py$$' | grep -v '/conf.py$$'

pep8:
	$(MAKE) pyfiles | xargs flake8 --max-line-length=80 --exclude=__init__.py

pylint:
	$(MAKE) pyfiles | xargs pylint

.PHONY: pyfiles pep8 pylint

########## actually install
infra:
	apssh -t r2lab.infra pip install --upgrade apssh
check:
	apssh -t r2lab.infra apssh --version

.PHONY: infra check

########## push on faraday for live testing
r2lab:
	rsync -ai --exclude .git --exclude .venv --exclude apssh/__pycache__ ./ faraday:/tmp/r2lab-dev-apssh
	@echo "on faraday"
	@echo "conda activate r2lab-dev-313"
	@echo "pip install -e /tmp/r2lab-dev-apssh"
