manga-dlp/justfile

76 lines
1.8 KiB
Makefile
Raw Normal View History

2022-06-25 14:29:09 +02:00
#!/usr/bin/env just --justfile
default: show_receipts
set shell := ["bash", "-uc"]
set dotenv-load
2022-06-25 14:29:09 +02:00
show_receipts:
just --list
2022-06-25 14:29:09 +02:00
show_system_info:
2022-06-26 15:10:36 +02:00
@echo "=================================="
2022-06-25 14:29:09 +02:00
@echo "os : {{os()}}"
@echo "arch: {{arch()}}"
@echo "justfile dir: {{justfile_directory()}}"
@echo "invocation dir: {{invocation_directory()}}"
@echo "running dir: `pwd -P`"
2022-06-26 15:10:36 +02:00
@echo "=================================="
2022-06-25 14:29:09 +02:00
setup:
asdf install
lefthook install
2022-06-25 14:29:09 +02:00
create_venv:
@echo "creating venv"
python3 -m pip install --upgrade pip setuptools wheel
python3 -m venv venv
2022-06-25 14:29:09 +02:00
2022-08-15 14:44:31 +02:00
install_deps:
@echo "installing dependencies"
python3 -m hatch dep show requirements --project-only > /tmp/requirements.txt
pip3 install -r /tmp/requirements.txt
install_deps_dev:
@echo "installing dev dependencies"
python3 -m hatch dep show requirements --project-only > /tmp/requirements.txt
python3 -m hatch dep show requirements --env-only >> /tmp/requirements.txt
pip3 install -r /tmp/requirements.txt
2022-08-15 14:44:31 +02:00
create_reqs:
@echo "creating requirements"
pipreqs --force --savepath requirements.txt src/mangadlp/
2022-06-26 15:10:36 +02:00
test_shfmt:
find . -type f \( -name "**.sh" -and -not -path "./.**" -and -not -path "./venv**" \) -exec shfmt -d -i 4 -bn -ci -sr "{}" \+;
2022-06-26 15:10:36 +02:00
format_shfmt:
find . -type f \( -name "**.sh" -and -not -path "./.**" -and -not -path "./venv**" \) -exec shfmt -w -i 4 -bn -ci -sr "{}" \+;
2022-06-25 14:29:09 +02:00
2022-06-26 19:00:47 +02:00
lint:
just show_system_info
just test_shfmt
hatch run lint:style
hatch run lint:typing
2022-06-26 19:00:47 +02:00
format:
2022-06-26 15:10:36 +02:00
just show_system_info
just format_shfmt
hatch run lint:fmt
2022-06-26 15:10:36 +02:00
check:
just lint
just format
test:
hatch run default:test
coverage:
hatch run default:cov
build:
hatch build --clean
run loglevel *flags:
hatch run mangadlp --loglevel {{loglevel}} {{flags}}