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
20 changes: 8 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.14"
python-version-file: ".python-version"

- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-dependency-glob: uv.lock

- name: Install dependencies
run: make install-dev
Expand All @@ -53,13 +53,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.14"
python-version-file: ".python-version"

- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-dependency-glob: uv.lock

- name: Install dependencies
run: make install-dev
Expand Down Expand Up @@ -172,13 +172,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.14"
python-version-file: ".python-version"

- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-dependency-glob: uv.lock

- name: Install dependencies
run: make install-dev
Expand All @@ -189,12 +189,8 @@ jobs:
- name: Verify build artifacts
run: |
ls -la dist/
# Create a fresh venv for testing the wheel installation
python -m venv test-venv
test-venv/bin/pip install dist/*.whl
# Install dependencies that the package needs
test-venv/bin/pip install -r requirements.txt
test-venv/bin/launchpad --help
uv tool install dist/*.whl
launchpad --help
Comment thread
joshuarli marked this conversation as resolved.

- name: Upload build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ build/
.pytest_cache/
.coverage
htmlcov/

# Virtual environments
venv/
.venv/
env/

Expand Down Expand Up @@ -56,5 +53,3 @@ output/
gocd/templates/vendor/
gocd/generated-pipelines/

# uv
uv.lock
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14.4
1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
brew "uv"
50 changes: 0 additions & 50 deletions DEVELOPMENT.md

This file was deleted.

29 changes: 20 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build libdispatch for the strip binary
FROM --platform=linux/amd64 debian:12-slim AS libdispatch-build

Check warning on line 2 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-arm64

FROM --platform flag should not use a constant value

FromPlatformFlagConstDisallowed: FROM --platform flag should not use constant value "linux/amd64" More info: https://docs.docker.com/go/dockerfile/rule/from-platform-flag-const-disallowed/

Check warning on line 2 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-amd64

FROM --platform flag should not use a constant value

FromPlatformFlagConstDisallowed: FROM --platform flag should not use constant value "linux/amd64" More info: https://docs.docker.com/go/dockerfile/rule/from-platform-flag-const-disallowed/

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
Expand Down Expand Up @@ -27,16 +27,21 @@
make install

# Use Python 3.14 slim image
FROM python:3.14-slim-bookworm
FROM python:3.14.4-slim-bookworm

# Build argument to determine if this is a test build
ARG TEST_BUILD=false

# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
PATH="/.venv/bin:$PATH" \
UV_PROJECT_ENVIRONMENT=/.venv \
UV_COMPILE_BYTECODE=1 \
UV_NO_CACHE=1

# Install uv
RUN python3 -m pip --no-cache-dir --disable-pip-version-check install 'uv==0.11.17'

# Create app user and group
RUN groupadd --gid 1000 app && \
Expand Down Expand Up @@ -64,20 +69,21 @@
# Set working directory
WORKDIR /app

# Copy requirements and install Python dependencies
COPY requirements.txt requirements-dev.txt ./
# Copy dependency manifests first for better layer caching
COPY pyproject.toml uv.lock ./

# Install Python dependencies (excluding the project itself)
RUN if [ "$TEST_BUILD" = "true" ]; then \
pip install --no-cache-dir -r requirements.txt -r requirements-dev.txt; \
uv sync --frozen --no-install-project --group dev; \
else \
pip install --no-cache-dir -r requirements.txt; \
uv sync --frozen --no-install-project --no-dev; \
Comment thread
joshuarli marked this conversation as resolved.
fi

# Copy source code, tests, and scripts
COPY src/ ./src/
COPY tests/ ./tests/
COPY scripts/ ./scripts/
COPY devservices/ ./devservices/
COPY pyproject.toml .
COPY README.md .
COPY LICENSE .

Expand All @@ -100,7 +106,12 @@
rm -rf tests/_fixtures; \
fi

RUN pip install -e .
# Install the project itself
RUN if [ "$TEST_BUILD" = "true" ]; then \
uv sync --frozen --group dev; \
else \
uv sync --frozen --no-dev; \
fi

RUN python scripts/deps --install --local-architecture=x86_64 --local-system=linux && \
rm -rf /app/.devenv
Expand Down
57 changes: 24 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,21 @@ help:
@echo "Available targets:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'

# Python and virtual environment setup
VENV_DIR := .venv
UV := uv
PYTHON_VENV := $(VENV_DIR)/bin/python

# Create virtual environment and install dependencies with uv
$(VENV_DIR):
$(UV) venv

install-dev: $(VENV_DIR)
$(UV) pip install -r requirements-dev.txt
$(UV) pip install -e .
$(PYTHON_VENV) scripts/deps
install-dev: ## Install all dependencies including dev tools
uv sync --group dev
$(VENV_DIR)/bin/python scripts/deps
$(VENV_DIR)/bin/pre-commit install

test:
$(PYTHON_VENV) -m pytest -n auto tests/unit/ tests/integration/ -v
uv run pytest -n auto tests/unit/ tests/integration/ -v

test-unit:
$(PYTHON_VENV) -m pytest -n auto tests/unit/ -v
uv run pytest -n auto tests/unit/ -v

test-integration:
$(PYTHON_VENV) -m pytest -n auto tests/integration/ -v
uv run pytest -n auto tests/integration/ -v

test-e2e: ## Run E2E tests with Docker Compose
@echo "Starting E2E test environment..."
Expand All @@ -45,32 +37,31 @@ test-e2e-logs: ## Show logs from E2E environment
docker compose -f docker-compose.e2e.yml logs -f

coverage:
$(PYTHON_VENV) -m pytest tests/unit/ tests/integration/ -v --cov --cov-branch --cov-report=xml --junitxml=junit.xml
uv run pytest tests/unit/ tests/integration/ -v --cov --cov-branch --cov-report=xml --junitxml=junit.xml

# Code quality targets (using ruff and ty)
check-lint:
$(PYTHON_VENV) -m ruff check src/ tests/
uv run ruff check src/ tests/

check-format: ## Check code format without modifying files
$(PYTHON_VENV) -m ruff format --check src/ tests/
uv run ruff format --check src/ tests/

check-types: ## Run type checking with ty
$(PYTHON_VENV) -m ty check --error-on-warning src
uv run ty check --error-on-warning src

check-deps:
$(PYTHON_VENV) scripts/deps --check
uv run python scripts/deps --check

fix: ## Auto-fix code issues (format, remove unused imports, fix line endings)
$(PYTHON_VENV) -m ruff format src/ tests/
$(PYTHON_VENV) -m ruff check --fix src/ tests/
uv run ruff format src/ tests/
uv run ruff check --fix src/ tests/

# Build targets
build: clean $(VENV_DIR) ## Build the package
$(UV) pip install build
$(PYTHON_VENV) -m build
build: clean ## Build the package
uv build
Comment thread
joshuarli marked this conversation as resolved.

build-wheel: ## Build wheel only
$(PYTHON_VENV) -m build --wheel
uv build --wheel

# Maintenance targets
clean:
Expand All @@ -94,30 +85,30 @@ all: clean install-dev check test build

run-cli: ## Run the CLI tool (use ARGS="..." to pass arguments, DEBUG=1 to run with debugger)
@if [ "$(DEBUG)" = "1" ]; then \
$(PYTHON_VENV) -m debugpy --listen 5678 --wait-for-client -m launchpad.cli $(ARGS); \
uv run python -m debugpy --listen 5678 --wait-for-client -m launchpad.cli $(ARGS); \
else \
$(PYTHON_VENV) -m launchpad.cli $(ARGS); \
uv run launchpad $(ARGS); \
fi

worker: ## Start the Launchpad TaskWorker
@echo "Starting Launchpad TaskWorker..."
$(PYTHON_VENV) -m launchpad.cli worker --verbose
uv run launchpad worker --verbose

test-download-artifact:
$(PYTHON_VENV) scripts/test_download_artifact.py --verbose
uv run python scripts/test_download_artifact.py --verbose

test-artifact-update:
$(PYTHON_VENV) scripts/test_artifact_update.py --build-version "1.0.0" --build-number 42 --verbose
uv run python scripts/test_artifact_update.py --build-version "1.0.0" --build-number 42 --verbose

test-artifact-size-analysis-upload:
$(PYTHON_VENV) scripts/test_artifact_size_analysis_upload.py --verbose
uv run python scripts/test_artifact_size_analysis_upload.py --verbose

# Show current status
status:
@echo "Python version: $$($(PYTHON_VENV) --version)"
@echo "Python version: $$(uv run python --version)"
@echo "Virtual environment: $$(if [ -d $(VENV_DIR) ]; then echo 'exists'; else echo 'missing'; fi)"
@echo "Pre-commit hooks: $$(if [ -f .git/hooks/pre-commit ]; then echo 'installed'; else echo 'not installed'; fi)"
@echo "UV version: $$($(UV) --version 2>/dev/null || echo 'not installed')"
@echo "UV version: $$(uv --version 2>/dev/null || echo 'not installed')"


gocd: ## Build GoCD pipelines
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ A service for analyzing iOS and Android apps.
git clone https://github.com/getsentry/launchpad.git
cd launchpad

# Installs our local dependencies
devenv sync
direnv allow
devenv sync (or just uv sync then ./scripts/deps)
```

If you don't have devenv installed, [follow these instructions](https://github.com/getsentry/devenv#install).
Expand Down
2 changes: 1 addition & 1 deletion config/hooks/post-merge
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ trap "rm -f $files_changed_upstream" EXIT

git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD >"$files_changed_upstream"

grep_pattern="requirements-dev-frozen.txt|migrations"
grep_pattern="uv.lock|migrations"

if grep -E --quiet "$grep_pattern" "$files_changed_upstream"; then
cat <<EOF
Expand Down
30 changes: 2 additions & 28 deletions devenv/config.ini
Original file line number Diff line number Diff line change
@@ -1,28 +1,2 @@
[venv.launchpad]
python = 3.14.5
path = .venv
requirements = requirements-dev.txt
editable =
.

[python3.14.5]
darwin_x86_64 = https://github.com/astral-sh/python-build-standalone/releases/download/20260510/cpython-3.14.5%2B20260510-x86_64-apple-darwin-install_only.tar.gz
darwin_x86_64_sha256 = 3f9e5535449001be140b9421b9c0b9b46478f182d9569f2a4e3efe74ae14f5ed
darwin_arm64 = https://github.com/astral-sh/python-build-standalone/releases/download/20260510/cpython-3.14.5%2B20260510-aarch64-apple-darwin-install_only.tar.gz
darwin_arm64_sha256 = 53ab0f338f508356a5e169316972c3a2cf3553fef3f20ff18512e253342d29db
linux_x86_64 = https://github.com/astral-sh/python-build-standalone/releases/download/20260510/cpython-3.14.5%2B20260510-x86_64-unknown-linux-gnu-install_only.tar.gz
linux_x86_64_sha256 = b3916b829fb0bc9efe93e800e6738a629ee4ade4aad798378d9326f4a0bac2db
linux_arm64 = https://github.com/astral-sh/python-build-standalone/releases/download/20260510/cpython-3.14.5%2B20260510-aarch64-unknown-linux-gnu-install_only.tar.gz
linux_arm64_sha256 = aa63daf3aff8360baf6888c24fb5dde155f0895f3d83eb9ddf172ba5c6c17c33

[uv]
darwin_arm64 = https://github.com/astral-sh/uv/releases/download/0.7.21/uv-aarch64-apple-darwin.tar.gz
darwin_arm64_sha256 = c73af7a4e0bcea9b5b593a0c7e5c025ee78d8be3f7cd60bfeadc8614a16c92ef
darwin_x86_64 = https://github.com/astral-sh/uv/releases/download/0.7.21/uv-x86_64-apple-darwin.tar.gz
darwin_x86_64_sha256 = f8a9b4f4a80a44653344d36b53e148134176e8f7cc99f8e823676a57c884595e
linux_arm64 = https://github.com/astral-sh/uv/releases/download/0.7.21/uv-aarch64-unknown-linux-gnu.tar.gz
linux_arm64_sha256 = 1dae18211605b9d00767d913da5108aea50200a88372bf8a2e1f56abdbe509f0
linux_x86_64 = https://github.com/astral-sh/uv/releases/download/0.7.21/uv-x86_64-unknown-linux-gnu.tar.gz
linux_x86_64_sha256 = ca3e8898adfce5fcc891d393a079013fa4bd0d9636cef11aded8a7485bcba312
# used for autoupdate
version = 0.7.21
[devenv]
minimum_version = 1.22.1
Loading
Loading