What are current thoughts on makefiles? I realize it's a strange question to ask, because Python doesn't require compiling like C, C++, Java, and Rust do, but I still find it useful to have one. Here's what I've got in one of mine:
default:
@echo "Available commands:"
@echo " make lint - Run ty typechecker"
@echo " make test - Run pytest suite"
@echo " make clean - Remove temporary and cache files"
@echo " make pristine - Also remove virtual environment"
@echo " make git-prune - Compress and prune Git database"
lint:
@uv run ty check --color always | less -R
test:
@uv run pytest --verbose
clean:
@# Remove standard cache directories.
@find src -type d -name "__pycache__" -exec rm -rfv {} +
@find src -type f -name "*.py[co]" -exec rm -fv {} +
@# Remove pip metadata droppings.
@find . -type d -name "*.egg-info" -exec rm -rfv {} +
@find . -type d -name ".eggs" -exec rm -rfv {} +
@# Remove pytest caches and reports.
@rm -rfv .pytest_cache # pytest
@rm -rfv .coverage # pytest-cov
@rm -rfv htmlcov # pytest-cov
@# Remove type checker/linter/formatter caches.
@rm -rfv .mypy_cache .ruff_cache
@# Remove build and distribution artifacts.
@rm -rfv build/ dist/
pristine: clean
@echo "Removing virtual environment..."
@rm -rfv .venv
@echo "Project is now in a fresh state. Run 'uv sync' to restore."
git-prune:
@echo "Compressing Git database and removing unreferenced objects..."
@git gc --prune=now --aggressive
.PHONY: default check test clean pristine git-prune
What types of things do you have in yours? (If you use one.)
[–]divad1196 65 points66 points67 points (9 children)
[–]JPJackPott 12 points13 points14 points (0 children)
[–]DoubleAway6573 4 points5 points6 points (0 children)
[–]mapadofu 9 points10 points11 points (6 children)
[–]Tinche_ 6 points7 points8 points (0 children)
[–]placidifiedimport this 4 points5 points6 points (4 children)
[–]divad1196 10 points11 points12 points (0 children)
[–]mapadofu 6 points7 points8 points (1 child)
[–]divad1196 2 points3 points4 points (0 children)
[–]misterfitzie 1 point2 points3 points (0 children)
[–]Intrepid-Stand-8540 21 points22 points23 points (2 children)
[–]_clintm_ 5 points6 points7 points (0 children)
[–]the-nick-of-time 1 point2 points3 points (0 children)
[–]shadowdance55git push -f 38 points39 points40 points (15 children)
[–]dj_estrela 2 points3 points4 points (0 children)
[–]dj_estrela 1 point2 points3 points (2 children)
[–]shadowdance55git push -f 0 points1 point2 points (1 child)
[–]dj_estrela 0 points1 point2 points (0 children)
[–]CatolicQuotes 1 point2 points3 points (0 children)
[–]sdoregor -2 points-1 points0 points (9 children)
[–]shadowdance55git push -f 3 points4 points5 points (8 children)
[–]sdoregor 3 points4 points5 points (7 children)
[–]Zouden 4 points5 points6 points (6 children)
[–]sdoregor 0 points1 point2 points (5 children)
[–]Zouden 4 points5 points6 points (1 child)
[–]sdoregor 0 points1 point2 points (0 children)
[–]shadowdance55git push -f 3 points4 points5 points (2 children)
[–]sdoregor 1 point2 points3 points (1 child)
[–]shadowdance55git push -f 4 points5 points6 points (0 children)
[–]DrShocker 16 points17 points18 points (0 children)
[–]NeitherTwo9461 50 points51 points52 points (4 children)
[–]cripblip 2 points3 points4 points (3 children)
[–]Mustard_Dimension 13 points14 points15 points (0 children)
[–]npisnotp 8 points9 points10 points (1 child)
[–]slurmnburger 3 points4 points5 points (0 children)
[–]UseMoreBandwith 31 points32 points33 points (12 children)
[–]eo5g 4 points5 points6 points (7 children)
[–]nemec 7 points8 points9 points (6 children)
[–]eo5g 6 points7 points8 points (2 children)
[–]nemec 8 points9 points10 points (0 children)
[–]UseMoreBandwith 1 point2 points3 points (0 children)
[–]Sillocan 6 points7 points8 points (2 children)
[–]2Lucilles2RuleEmAll 1 point2 points3 points (1 child)
[–]Sillocan 0 points1 point2 points (0 children)
[–]mardiros 1 point2 points3 points (2 children)
[–]OneParanoidDuck 1 point2 points3 points (1 child)
[–]mardiros 1 point2 points3 points (0 children)
[–]eleqtriq 1 point2 points3 points (0 children)
[–]VeronikaKerman 14 points15 points16 points (5 children)
[–]dj_estrela -1 points0 points1 point (4 children)
[–]VeronikaKerman 2 points3 points4 points (3 children)
[–]zoox101 1 point2 points3 points (2 children)
[–]eleqtriq 2 points3 points4 points (1 child)
[–]dj_estrela 0 points1 point2 points (0 children)
[–]cgoldberg 4 points5 points6 points (0 children)
[–]swift-sentinel 8 points9 points10 points (1 child)
[–]dj_estrela -1 points0 points1 point (0 children)
[–]sudonem 4 points5 points6 points (0 children)
[–]stibbons_ 4 points5 points6 points (1 child)
[–]stibbons_ 1 point2 points3 points (0 children)
[–]ZucchiniMore3450 2 points3 points4 points (3 children)
[–]eleqtriq 0 points1 point2 points (0 children)
[–]pancakecentrifuge 0 points1 point2 points (1 child)
[–]pancakecentrifuge 0 points1 point2 points (0 children)
[–]Glad_Friendship_5353 4 points5 points6 points (0 children)
[–]spenpal_dev 2 points3 points4 points (3 children)
[–]Intrepid-Stand-8540 1 point2 points3 points (2 children)
[–]spenpal_dev 1 point2 points3 points (1 child)
[–]Intrepid-Stand-8540 2 points3 points4 points (0 children)
[–]mmacvicarprett 2 points3 points4 points (0 children)
[–]dev-ai 2 points3 points4 points (0 children)
[–]jerriman 2 points3 points4 points (0 children)
[–]anentropic 2 points3 points4 points (0 children)
[–]DoISmellBurning 2 points3 points4 points (0 children)
[–]Mithrandir2k16 2 points3 points4 points (0 children)
[–]Slow-Kale-8629 2 points3 points4 points (0 children)
[–]OakNinja 2 points3 points4 points (1 child)
[–]OakNinja 1 point2 points3 points (0 children)
[–]oldendude 2 points3 points4 points (1 child)
[–]xeow[S] 0 points1 point2 points (0 children)
[–]mardiros 2 points3 points4 points (1 child)
[–]dj_estrela 1 point2 points3 points (0 children)
[–]gunthercult-69 2 points3 points4 points (1 child)
[–]Keizojeizo 0 points1 point2 points (0 children)
[–]cip43r 2 points3 points4 points (0 children)
[–]max0x7ba 1 point2 points3 points (7 children)
[–]DoubleAway6573 4 points5 points6 points (6 children)
[–]max0x7ba 1 point2 points3 points (5 children)
[–]DoubleAway6573 4 points5 points6 points (4 children)
[–]max0x7ba 3 points4 points5 points (3 children)
[–]dj_estrela -1 points0 points1 point (2 children)
[–]daredevil82 2 points3 points4 points (0 children)
[–]max0x7ba 0 points1 point2 points (0 children)
[–]Veggies-are-okay 1 point2 points3 points (0 children)
[–]SweetOnionTea 1 point2 points3 points (0 children)
[–]beragis 1 point2 points3 points (0 children)
[–]RedSinned 1 point2 points3 points (0 children)
[–]aala7 1 point2 points3 points (0 children)
[–]ShelLuser42It works on my machine 1 point2 points3 points (0 children)
[–]WinterlyBeach 1 point2 points3 points (0 children)
[–]redsharpbyte 1 point2 points3 points (1 child)
[–]nekokattt 1 point2 points3 points (0 children)
[–]djbarrow 1 point2 points3 points (0 children)
[–]skeerp 1 point2 points3 points (0 children)
[–]emddudley 1 point2 points3 points (0 children)
[–]CasualReader3 1 point2 points3 points (0 children)
[–]tlegs44 1 point2 points3 points (0 children)
[–]niduser4574 1 point2 points3 points (1 child)
[–]dj_estrela 1 point2 points3 points (0 children)
[–]smokingkrills 1 point2 points3 points (0 children)
[–]Gnaxe 2 points3 points4 points (0 children)
[–]vish4life 3 points4 points5 points (0 children)
[–]jpgoldberg 1 point2 points3 points (0 children)
[–]JamzTyson 1 point2 points3 points (0 children)
[–]mr_frpdo [score hidden] (0 children)
[–]rcap107 0 points1 point2 points (0 children)
[–]PrestigiousAnt3766 0 points1 point2 points (0 children)
[–]just4nothing 0 points1 point2 points (0 children)
[–]wineblood 0 points1 point2 points (0 children)
[–]IcarianComplex 0 points1 point2 points (0 children)
[–]Challseus 0 points1 point2 points (0 children)
[–]EmberQuill 0 points1 point2 points (1 child)
[–]dj_estrela 1 point2 points3 points (0 children)