|
|
|
|
|
|
|
|
|
|
|
SHELL := /bin/bash |
|
|
.SHELLFLAGS := -eu -o pipefail -c |
|
|
|
|
|
|
|
|
ENSURE_UV := which uv > /dev/null || pip install uv |
|
|
|
|
|
|
|
|
PYTHON_VERSION := 3.12 |
|
|
|
|
|
|
|
|
all: install format lint build test |
|
|
|
|
|
.PHONY: help |
|
|
help: |
|
|
@echo "Usage: make [target]" |
|
|
@echo "" |
|
|
@echo "Targets:" |
|
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) |
|
|
|
|
|
.PHONY: init |
|
|
init: |
|
|
@$(ENSURE_UV) |
|
|
@echo "Creating virtual environment..." |
|
|
@uv venv |
|
|
|
|
|
.PHONY: install |
|
|
install: |
|
|
@$(ENSURE_UV) |
|
|
@echo "Installing dependencies..." |
|
|
@uv pip install -e .[dev] |
|
|
|
|
|
.PHONY: format |
|
|
format: |
|
|
@$(ENSURE_UV) |
|
|
@echo "Formatting code..." |
|
|
@uv pip install isort black |
|
|
@if [ -n "$(filter-out $@,$(MAKECMDGOALS))" ]; then \ |
|
|
echo "Formatting $(filter-out $@,$(MAKECMDGOALS))..."; \ |
|
|
uvx isort $(filter-out $@,$(MAKECMDGOALS)); \ |
|
|
uvx black $(filter-out $@,$(MAKECMDGOALS)); \ |
|
|
else \ |
|
|
uvx isort src tests; \ |
|
|
uvx black src tests; \ |
|
|
fi |
|
|
|
|
|
.PHONY: lint |
|
|
lint: |
|
|
@$(ENSURE_UV) |
|
|
@echo "Linting and type-checking..." |
|
|
@uv pip install ruff mypy |
|
|
@uvx ruff format src tests |
|
|
@uvx ruff check --fix src tests |
|
|
@uv run mypy src |
|
|
|
|
|
.PHONY: test |
|
|
test: |
|
|
@$(ENSURE_UV) |
|
|
@echo "Running tests..." |
|
|
@uv pip install pytest pytest-asyncio |
|
|
@if [ -n "$(filter-out $@,$(MAKECMDGOALS))" ]; then \ |
|
|
uv run pytest -v $(filter-out $@,$(MAKECMDGOALS)); \ |
|
|
else \ |
|
|
uv run pytest; \ |
|
|
fi |
|
|
|
|
|
.PHONY: build |
|
|
build: |
|
|
@$(ENSURE_UV) |
|
|
@echo "Building project..." |
|
|
@uv pip install hatchling |
|
|
@uvx hatchling build |
|
|
|
|
|
.PHONY: clean |
|
|
clean: |
|
|
@echo "Cleaning up..." |
|
|
@rm -rf build dist .eggs *.egg-info |
|
|
@find . -type d -name '__pycache__' -exec rm -rf {} + |
|
|
@find . -type f -name '*.pyc' -exec rm -f {} + |
|
|
@find . -type f -name '*.pyo' -exec rm -f {} + |
|
|
@find . -type f -name '*~' -exec rm -f {} + |
|
|
|
|
|
.PHONY: all |
|
|
all: install format lint build test |
|
|
|
|
|
|
|
|
AWS_PROFILE_NAME := Geometric-PowerUserAccess |
|
|
AWS_SSO_START_URL := https://geometric.awsapps.com/start |
|
|
AWS_SSO_REGION := us-east-1 |
|
|
AWS_ACCOUNT_ID := 339713096219 |
|
|
AWS_ROLE_NAME := PowerUserAccess |
|
|
AWS_REGION := us-east-1 |
|
|
|
|
|
.PHONY: configure-aws-sso |
|
|
configure-aws-sso: |
|
|
@echo "Configuring AWS SSO..." |
|
|
@mkdir -p ~/.aws |
|
|
@echo "# AWS SSO Configuration" > ~/.aws/config |
|
|
@echo "" >> ~/.aws/config |
|
|
@echo "[profile $(AWS_PROFILE_NAME)]" >> ~/.aws/config |
|
|
@echo "sso_session = geometric" >> ~/.aws/config |
|
|
@echo "sso_account_id = $(AWS_ACCOUNT_ID)" >> ~/.aws/config |
|
|
@echo "sso_role_name = $(AWS_ROLE_NAME)" >> ~/.aws/config |
|
|
@echo "region = $(AWS_REGION)" >> ~/.aws/config |
|
|
@echo "" >> ~/.aws/config |
|
|
@echo "[sso-session geometric]" >> ~/.aws/config |
|
|
@echo "sso_start_url = $(AWS_SSO_START_URL)" >> ~/.aws/config |
|
|
@echo "sso_region = $(AWS_SSO_REGION)" >> ~/.aws/config |
|
|
@echo "sso_registration_scopes = sso:account:access" >> ~/.aws/config |
|
|
@echo "AWS SSO configuration complete." |
|
|
@aws sso login --profile $(AWS_PROFILE_NAME) |