forked from fixie-ai/fixie-examples
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Justfile
44 lines (35 loc) · 1.33 KB
/
Justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# This is the main Justfile for the Fixie Examples repo.
# It contains helpful scripts and recipes for maintaining the tree.
# Using Just is not necessary if you are just using the examples.
# To install Just, see: https://github.com/casey/just#installation
# This causes the .env file to be read by Just.
set dotenv-load := true
# Allow for positional arguments in Just receipes.
set positional-arguments := true
# Default recipe that runs if you type "just".
default: format check
# Install dependencies for local development.
install:
pip install poetry
poetry install --sync
poetry run mypy --install-types --non-interactive .
# Format code.
format:
poetry run autoflake . --remove-all-unused-imports --quiet --in-place -r --exclude third_party
poetry run isort . --force-single-line-imports
poetry run black .
# Run code formatting and type checks.
check:
poetry run black . --check
poetry run isort . --check --force-single-line-imports
poetry run autoflake . --check --quiet --remove-all-unused-imports -r --exclude third_party
poetry run mypy .
# Run a Python REPL in the Poetry environment.
python:
poetry run python
# Run the poetry command with the local .env loaded.
poetry *FLAGS:
poetry {{FLAGS}}
# Run a new shell with the Poetry Pyenv environment and .env file loaded.
shell:
poetry shell