Skip to content

Commit 7949042

Browse files
authored
Merge pull request #1 from taskiq-python/feat-project-skeleton
feat: add result backend and broker
2 parents aa8151a + f0d49a3 commit 7949042

24 files changed

Lines changed: 3173 additions & 3 deletions

‎.github/dependabot.yml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "uv"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
cooldown:
8+
default-days: 30
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "monthly"
13+
cooldown:
14+
default-days: 30

‎.github/workflows/code-check.yml‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches: [main]
5+
paths-ignore:
6+
- "*.md"
7+
- "docs/**"
8+
pull_request:
9+
branches: [main]
10+
paths-ignore:
11+
- "*.md"
12+
- "docs/**"
13+
14+
permissions:
15+
actions: read
16+
contents: read
17+
pull-requests: read
18+
19+
jobs:
20+
test:
21+
name: Tests
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
python-version: [ "3.11", "3.12", "3.13", "3.14" ]
26+
fail-fast: true
27+
services:
28+
mongodb:
29+
image: mongo:7
30+
ports:
31+
- 27017:27017
32+
env:
33+
MONGO_INITDB_ROOT_USERNAME: root
34+
MONGO_INITDB_ROOT_PASSWORD: password # pragma: allowlist secret
35+
MONGO_INITDB_DATABASE: taskiq
36+
options: >-
37+
--health-cmd="echo 'db.runCommand(\"ping\").ok' | mongosh localhost:27017/test --quiet"
38+
--health-interval=5s
39+
--health-timeout=5s
40+
--health-retries=10
41+
steps:
42+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
43+
with:
44+
persist-credentials: false
45+
- id: setup-uv
46+
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
47+
with:
48+
enable-cache: true
49+
version: "latest"
50+
python-version: ${{ matrix.python-version }}
51+
- name: Install Dependencies
52+
run: uv sync --all-extras
53+
- name: Run tests
54+
run: uv run pytest

‎.github/workflows/release.yml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
# Publish on any tag starting with a `v`, e.g. v1.2.3
7+
- v*
8+
9+
jobs:
10+
pypi:
11+
name: Publish to PyPI
12+
runs-on: ubuntu-latest
13+
environment:
14+
name: release
15+
permissions:
16+
contents: read
17+
steps:
18+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
19+
with:
20+
persist-credentials: false
21+
- id: setup-uv
22+
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
23+
with:
24+
enable-cache: false
25+
python-version: "3.12"
26+
version: "latest"
27+
- run: uv version "${GITHUB_REF_NAME}"
28+
- run: uv build
29+
- run: uv publish --trusted-publishing always # zizmor: ignore[use-trusted-publishing]

‎.gitignore‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ cython_debug/
195195
.abstra/
196196

197197
# Visual Studio Code
198-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
198+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199199
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
200+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
201201
# you could uncomment the following to ignore the entire vscode folder
202202
# .vscode/
203203
# Temporary file for partial code execution

‎.pre-commit-config.yaml‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
repos:
2+
- repo: builtin
3+
hooks:
4+
- id: trailing-whitespace
5+
- id: check-toml
6+
- id: end-of-file-fixer
7+
8+
- repo: https://github.com/crate-ci/typos
9+
rev: v1.50.2
10+
hooks:
11+
- id: typos
12+
13+
- repo: https://github.com/Yelp/detect-secrets
14+
rev: v1.5.0
15+
hooks:
16+
- id: detect-secrets
17+
18+
- repo: local
19+
hooks:
20+
- id: ruff
21+
name: Run ruff lints
22+
entry: uv run ruff
23+
language: system
24+
pass_filenames: false
25+
types: [python]
26+
args:
27+
- "check"
28+
- "--fix"
29+
- "src"
30+
- "tests"
31+
32+
- id: ty
33+
name: Validate types with ty
34+
entry: uv run ty
35+
language: system
36+
pass_filenames: false
37+
types: [python]
38+
args:
39+
- "check"
40+
- ./src/taskiq_mongodb
41+
- ./tests
42+
43+
- id: zizmor
44+
name: zizmor
45+
language: python
46+
entry: uv run --active --frozen zizmor .
47+
files: ^\.github
48+
require_serial: true
49+
verbose: true
50+
pass_filenames: false

‎Makefile‎

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
args := $(wordlist 2, 100, $(MAKECMDGOALS))
2+
3+
VIRTUAL_ENV=.venv
4+
5+
.DEFAULT:
6+
@echo "No such command (or you pass two or many targets to ). List of possible commands: make help"
7+
8+
.DEFAULT_GOAL := help
9+
10+
##@ Local development
11+
12+
.PHONY: help
13+
help: ## Show this help
14+
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target> <arg=value>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m %s\033[0m\n\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
15+
16+
.PHONY: venv
17+
venv: ## Create a new virtual environment
18+
@uv venv
19+
20+
.PHONY: check_venv
21+
check_venv: ## Check that virtual environment is activated
22+
@if [ -z $$VIRTUAL_ENV ]; then \
23+
echo "Error: Virtual environment is not activated"; \
24+
exit 1; \
25+
fi
26+
27+
.PHONY: init
28+
init: ## Install all project dependencies with extras
29+
@$(MAKE) check_venv
30+
@uv sync --all-extras
31+
32+
.PHONY: run_docs
33+
run_docs: ## Run documentation server
34+
@uv run zensical serve
35+
36+
.PHONY:
37+
run_infra: ## Run MongoDB in docker for local development and integration tests
38+
@docker compose -f docker-compose.yml up -d mongodb
39+
40+
##@ Code quality
41+
42+
.PHONY: lint
43+
lint: ## Run linting
44+
@$(MAKE) ruff
45+
@$(MAKE) mypy
46+
47+
.PHONY: ruff
48+
ruff: ## Run ruff linting
49+
@uv run --active --frozen ruff check src tests
50+
51+
.PHONY: mypy
52+
mypy: ## Run mypy type checking
53+
@uv run --active --frozen mypy src
54+
55+
.PHONY: format
56+
format: ## Run formatting
57+
@uv run ruff check . --fix
58+
59+
##@ Testing
60+
61+
.PHONY: test
62+
test: ## Run all pytest tests
63+
@uv run pytest tests
64+
65+
.PHONY: test_cov
66+
test_cov: ## Generate test coverage report
67+
@pytest --cov='src' --cov-report=html
68+
69+
70+
.PHONY: test_install
71+
test_install: ## Verify package installation by importing it
72+
@uv run --with taskiq-sqs --no-project -- python -c "import taskiq_mongodb"

0 commit comments

Comments
 (0)