# setup for development
dev: install-hooks check

# install hooks for development
install-hooks:
  cp -f hooks/post-commit .git/hooks/post-commit
  cp -f hooks/pre-commit .git/hooks/pre-commit
  chmod +x .git/hooks/post-commit
  chmod +x .git/hooks/pre-commit

# run test
test:
  hatch run default:python -m unittest tests/test*.py

# try to auto fix
fix: test
  hatch run dev:ruff format
  hatch run dev:ruff check --fix
  hatch run dev:ty check

# for development: check typing error and fix format
check: test
  hatch run dev:ruff check
  hatch run dev:ty check

# generate stubs
stubs:
  hatch run stubs:stubgen -p backscattering_simulation_data --output=typings

# update the package
update:
  git pull
  hatch env prune
  just test
  just uninstall
  just install

# install the package in the current environment
install: test
  python -m pip install . -e

# uninstall the package from the current environment
uninstall:
  python -m pip uninstall backscattering_simulation_data
