Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ build/
examples/

src/dlthub_init/_telemetry_key.py

# Local release secrets loaded by the Makefile (e.g. DLTHUB_INIT_POSTHOG_KEY)
.make.env
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ DLTHUB_INIT_POSTHOG_HOST=https://eu.i.posthog.com \
uv run dlthub-init my-workspace --yes
```

For releases, put the real key in a gitignored `.make.env`
(`DLTHUB_INIT_POSTHOG_KEY=phc_…`); the Makefile loads it into `uv build`, and
`make publish` refuses to run without it.

## Code style

Write self-explanatory code. Do not add comments that narrate what the code
Expand Down
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
.DEFAULT_GOAL := help

.PHONY: help dev lint lint-fix format format-check fl lint-ci test test-integration build clean-dist version-upgrade version-upgrade-patch version-upgrade-minor version-upgrade-major publish ci lock-upgrade lock-check scaffold-lock-upgrade scaffold-lock-check generate-skills update-skills check-skills workspace workspace-init
.PHONY: help dev lint lint-fix format format-check fl lint-ci test test-integration build clean-dist version-upgrade version-upgrade-patch version-upgrade-minor version-upgrade-major require-posthog-key publish ci lock-upgrade lock-check scaffold-lock-upgrade scaffold-lock-check generate-skills update-skills check-skills workspace workspace-init

PYTHON_SOURCES := src tests tests_integration scripts
SCAFFOLD_DIR ?= src/dlthub_init/scaffolds/minimal_workspace

-include .make.env
export DLTHUB_INIT_POSTHOG_KEY

help: ## Show this help message
@echo "Available targets:"
@grep -E '^[a-zA-Z0-9_.-]+:.*?## .*$$' $(MAKEFILE_LIST) \
Expand Down Expand Up @@ -89,7 +92,13 @@ version-upgrade-minor: ## Bump the minor version non-interactively (AI/CI-friend
version-upgrade-major: ## Bump the major version non-interactively (AI/CI-friendly)
@$(MAKE) version-upgrade LEVEL=major

publish: clean-dist build ## Build and publish dlthub-init to PyPI
require-posthog-key:
@case "$(DLTHUB_INIT_POSTHOG_KEY)" in \
phc_*) ;; \
*) echo "publish: DLTHUB_INIT_POSTHOG_KEY not set (or not a phc_ key) — add it to .make.env"; exit 1;; \
esac

publish: require-posthog-key clean-dist build ## Build and publish dlthub-init to PyPI
ls -l dist/
@bash -c 'read -s -p "Enter PyPI API token: " PYPI_API_TOKEN; echo; \
uv publish --token "$$PYPI_API_TOKEN"'
Expand Down
Loading