Vatsal Gupta kiloconnect[bot] commited on
Commit
a8ddf00
·
unverified ·
1 Parent(s): 3c2d62e

feat: standardize Makefile with help target (#266)

Browse files

* feat: standardize Makefile with help target

* fix: add help target annotations and alphabetical sorting

- Add ## descriptions to all targets for the help target
- Include sync and freeze in .PHONY declarations
- Sort help output alphabetically using sort command

---------

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>

Files changed (1) hide show
  1. Makefile +11 -24
Makefile CHANGED
@@ -1,37 +1,24 @@
1
- #***************************************************************************************
2
- # * File: Makefile
3
- # * Author: Vatsal Gupta
4
- # * Date: 21-Sep-2025
5
- # * Description: Makefile for managing the application.
6
- # **************************************************************************************/
7
 
8
- #***************************************************************************************
9
- # * License
10
- # **************************************************************************************/
11
- # This file is licensed under the Apache 2.0 License.
12
- # License information should be updated as necessary.
13
 
14
- #***************************************************************************************
15
- # * Variables
16
- # **************************************************************************************/
17
  SRC_DIR := src
18
 
19
- #***************************************************************************************
20
- # * Targets
21
- # **************************************************************************************/
22
- .PHONY: all run test clean
23
 
24
- all: clean sync run
25
 
26
- sync:
27
  @uv sync --no-cache
28
- freeze: sync
29
  @uv export --quiet --no-header --no-annotate --no-hashes --format requirements.txt --output-file requirements.txt
30
- run: sync
31
  @uv run --directory $(SRC_DIR) streamlit run app.py --browser.gatherUsageStats false
32
- test: sync
33
  @echo "No tests available currently."
34
  # @uv test
35
- clean:
36
  @rm -rf __pycache__ .pytest_cache .mypy_cache .venv
37
  @uv clean
 
1
+ # Default target
2
+ .DEFAULT_GOAL := help
 
 
 
 
3
 
4
+ help: ## Show this help message
5
+ @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
 
 
 
6
 
 
 
 
7
  SRC_DIR := src
8
 
9
+ .PHONY: all sync freeze run test clean
 
 
 
10
 
11
+ all: clean sync run ## Run clean, sync, and run
12
 
13
+ sync: ## Sync dependencies with uv
14
  @uv sync --no-cache
15
+ freeze: sync ## Export requirements.txt
16
  @uv export --quiet --no-header --no-annotate --no-hashes --format requirements.txt --output-file requirements.txt
17
+ run: sync ## Run the Streamlit app
18
  @uv run --directory $(SRC_DIR) streamlit run app.py --browser.gatherUsageStats false
19
+ test: sync ## Run tests
20
  @echo "No tests available currently."
21
  # @uv test
22
+ clean: ## Clean caches and venv
23
  @rm -rf __pycache__ .pytest_cache .mypy_cache .venv
24
  @uv clean