mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-01-08 17:59:43 -06:00
* feat: initial mkdocs setup * chore: lock * fix: config + start getting docs working * fix: remove lots more redundant :type docs, update config more * feat: split up clients * feat: add pydoclint * fix: rm defaults from docstrings * fix: pydoclint errors * feat: run pydoclint in ci * fix: lint on 3.13 * debug: try explicit config path * fix: ignore venv * feat: index, styling * fix: rm footer * fix: more style tweaks * feat: generated docs * fix: refactor a bit * fix: regen * Revert "fix: regen" This reverts commit 7f66adc77840ad96d0eafe55c8dd467f71eb50fb. * feat: improve prompting * feat: add docs, modify theme config to enable toc for docs * fix: lint * fix: lint * feat: regenerate * feat: bs4 for html parsing * feat: preview correctly * fix: exclude site subdir from all the linters * refactor: break up script into components * feat: remove a bunch more stuff from the html * feat: prettier, enable toc * fix: enable tocs in more places + sort properly * fix: code blocks, ordering * fix: ordering * feat: finish up feature clients * fix: rm unused deps * fix: routing + property tags + sidebar * fix: hatchet client + formatting * fix: allow selecting single set of files * fix: lint * rm: cruft * fix: naming * fix: runs client attrs * fix: rm cruft page * feat: internal linking + top level description * [Python]: Fixing some more issues (#1573) * fix: pass priority through from the task * fix: improve eof handling slightly * chore: version * fix: improve eof handling * fix: send prio from durable * fix: naming * cleanup: use a variable * chore: version * feat: comment explaining page depth thing * chore: bump ver * feat: standalone docs * fix: prompting + heading levels
190 lines
5.2 KiB
YAML
190 lines
5.2 KiB
YAML
name: python
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- '.github/**'
|
|
- 'api/**'
|
|
- 'api-contracts/**'
|
|
- 'internal/**'
|
|
- 'pkg/**'
|
|
- 'sdks/python/**'
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'sdks/python/**'
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: ./sdks/python
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.13"
|
|
|
|
- name: Install Poetry
|
|
uses: snok/install-poetry@v1
|
|
with:
|
|
version: 1.5.1
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
|
|
- name: Install linting tools
|
|
run: poetry install --all-extras
|
|
|
|
- name: Run Black
|
|
run: poetry run black . --check --verbose --diff --color
|
|
|
|
- name: Run Isort
|
|
run: poetry run isort . --check-only --diff
|
|
|
|
- name: Run MyPy
|
|
run: poetry run mypy --config-file=pyproject.toml
|
|
|
|
- name: Run Ruff
|
|
run: poetry run ruff check .
|
|
|
|
- name: Run Pydoclint
|
|
run: poetry run pydoclint .
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Protoc
|
|
uses: arduino/setup-protoc@v3
|
|
with:
|
|
version: '25.1'
|
|
|
|
- name: Install Task
|
|
uses: arduino/setup-task@v2
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.21'
|
|
|
|
- name: Start Docker dependencies
|
|
working-directory: .
|
|
run: docker compose up -d
|
|
|
|
- name: Generate
|
|
working-directory: .
|
|
run: |
|
|
export DATABASE_URL="postgresql://hatchet:hatchet@127.0.0.1:5431/hatchet"
|
|
go run ./cmd/hatchet-migrate
|
|
task generate-go
|
|
|
|
- name: Setup
|
|
working-directory: .
|
|
run: |
|
|
export SEED_DEVELOPMENT=true
|
|
export SERVER_PORT=8080
|
|
export SERVER_URL=http://localhost:8080
|
|
export SERVER_AUTH_COOKIE_DOMAIN=localhost
|
|
export SERVER_AUTH_COOKIE_INSECURE=true
|
|
export SERVER_DEFAULT_ENGINE_VERSION=V1
|
|
|
|
go run ./cmd/hatchet-admin quickstart
|
|
|
|
go run ./cmd/hatchet-engine --config ./generated/ > engine.log 2>&1 &
|
|
go run ./cmd/hatchet-api --config ./generated/ > api.log 2>&1 &
|
|
|
|
sleep 30
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Display Python version
|
|
run: python -c "import sys; print(sys.version)"
|
|
|
|
- name: Install Poetry
|
|
uses: snok/install-poetry@v1
|
|
with:
|
|
version: 1.5.1
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
|
|
- name: Install dependencies
|
|
run: poetry install --no-interaction --all-extras
|
|
|
|
- name: Generate Env File
|
|
working-directory: .
|
|
run: |
|
|
echo "HATCHET_CLIENT_TOKEN=$(go run ./cmd/hatchet-admin token create --config ./generated/ --tenant-id 707d0855-80ab-4e1f-a156-f1c4546cbf52)" >> $GITHUB_ENV
|
|
echo "HATCHET_CLIENT_TLS_ROOT_CA_FILE=../../certs/ca.cert" >> $GITHUB_ENV
|
|
echo "HATCHET_CLIENT_WORKER_HEALTHCHECK_ENABLED=True" >> $GITHUB_ENV
|
|
|
|
- name: Set HATCHET_CLIENT_NAMESPACE
|
|
run: |
|
|
PYTHON_VERSION=$(python -c "import sys; print(f'py{sys.version_info.major}{sys.version_info.minor}')")
|
|
SHORT_SHA=$(git rev-parse --short HEAD)
|
|
echo "HATCHET_CLIENT_NAMESPACE=${PYTHON_VERSION}-${SHORT_SHA}" >> $GITHUB_ENV
|
|
|
|
- name: Run pytest
|
|
run: |
|
|
echo "Using HATCHET_CLIENT_NAMESPACE: $HATCHET_CLIENT_NAMESPACE"
|
|
|
|
poetry run pytest -s -vvv --maxfail=5 --capture=no --retries 3 --retry-delay 2
|
|
|
|
- name: Upload engine logs
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: $HATCHET_CLIENT_NAMESPACE-engine-logs
|
|
path: $HATCHET_CLIENT_NAMESPACE-engine.log
|
|
|
|
- name: Upload API logs
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: $HATCHET_CLIENT_NAMESPACE-api-logs
|
|
path: $HATCHET_CLIENT_NAMESPACE-api.log
|
|
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
needs: [lint, test]
|
|
if: github.ref == 'refs/heads/main'
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- name: Install Poetry
|
|
run: |
|
|
pipx install poetry==1.7.1
|
|
|
|
- name: Run publish.sh script
|
|
run: |
|
|
CURRENT_PYPI_VERSION=$(pip index versions hatchet-sdk | awk 'NR==1 {gsub(/[()]/,"",$2); print $2}')
|
|
NEW_VERSION=$(cat pyproject.toml| grep "^version =" | cut -d '"' -f 2)
|
|
|
|
if [ "$CURRENT_PYPI_VERSION" == "$NEW_VERSION" ]; then
|
|
echo "Version has not changed. Skipping publish."
|
|
exit 0
|
|
fi
|
|
|
|
sh publish.sh
|
|
env:
|
|
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}
|