Skip to content

Commit

Permalink
Merge pull request #75 from r-Norge/feature/just_runner
Browse files Browse the repository at this point in the history
Add justfile for simple command running
  • Loading branch information
Ev-1 authored Feb 12, 2023
2 parents 3a12a84 + c6611a0 commit b605de8
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
env_name := "venv"
python := "./" + env_name+'/bin/python3'

default:
@just --list

# Make a new virtual environment
[private]
make_venv:
python3.10 -m venv {{env_name}}
{{python}} -m pip install --upgrade pip
{{python}} -m pip install -r requirements.txt
{{python}} -m pip install flake8
{{python}} -m pip install isort
{{python}} -m pip install pytest

# Make the environment if it does not exit
[private]
@venv:
[ -d {{env_name}} ] || just make_venv

# Run the bot
run: venv
{{python}} bot.py

# Run with debug logging enabled
debug: run
--debug

clean:
rm -rf {{env_name}}
# Lint with flake8
flake: venv
{{python}} -m flake8 bot.py musicbot

# Fix import order with isort
isort: venv
{{python}} -m isort --sp setup.cfg bot.py musicbot

# Run both isort and flake8
lint: venv
just isort
just flake

# Run tests
test: venv
{{python}} -m pytest

# Run lints and test
pre_commit: venv
just lint
just test

0 comments on commit b605de8

Please sign in to comment.